Skip to content

Commit

Permalink
Adding view activity
Browse files Browse the repository at this point in the history
  • Loading branch information
awxkee committed Sep 20, 2024
1 parent a68861a commit 15d2647
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 17 deletions.
31 changes: 18 additions & 13 deletions app/src/main/java/com/awxkee/jxlcoder/app/glide/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ import android.content.Intent
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Button
import androidx.compose.material3.FilledTonalButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
Expand All @@ -32,20 +35,22 @@ class MainActivity : ComponentActivity() {
) {
Greeting("Android")

Button(modifier = Modifier
.width(50.dp)
.height(
50.dp
), onClick = {
startActivity(Intent(this@MainActivity, ProbeActivity::class.java))
}) {
Text("View Activity")
}
Column {
GlideImage(
model = "https://wh.aimuse.online/preset/jxl_icc_12.bit.jxl",
contentDescription = ""
)

GlideImage(
model = "https://wh.aimuse.online/preset/jxl_icc_12.bit.jxl",
contentDescription = ""
)
FilledTonalButton(modifier = Modifier
.padding(start = 8.dp, top = 8.dp)
.height(
50.dp
), onClick = {
startActivity(Intent(this@MainActivity, ProbeActivity::class.java))
}) {
Text("View View Activity")
}
}

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
package com.awxkee.jxlcoder.app.glide

import android.os.Bundle
import android.widget.Button
import androidx.activity.ComponentActivity
import com.bumptech.glide.Glide

Expand All @@ -42,6 +43,10 @@ class ProbeActivity: ComponentActivity() {
.asBitmap()
.load("https://wh.aimuse.online/preset/jxl_icc_12.bit.jxl")
.into(findViewById(R.id.image_view))

findViewById<Button>(R.id.out_button).setOnClickListener {
finish()
}
}

}
16 changes: 12 additions & 4 deletions app/src/main/res/layout/activity_probe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,21 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
android:orientation="vertical">

<ImageView
android:layout_width="wrap_content"
android:id="@+id/image_view"
android:layout_height="wrap_content"/>
android:layout_width="wrap_content"
android:layout_height="wrap_content" />

<Button
android:id="@+id/out_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="@string/finish" />

</LinearLayout>
1 change: 1 addition & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>
<string name="app_name">JxlCoderGlide</string>
<string name="finish">Finish</string>
</resources>

0 comments on commit 15d2647

Please sign in to comment.