Skip to content

Commit

Permalink
恢复代码
Browse files Browse the repository at this point in the history
  • Loading branch information
陈少平 committed Jul 20, 2021
1 parent 604585b commit a1c0883
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 4 additions & 0 deletions app/src/main/java/com/quwan/tt/asmdemoapp/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package com.quwan.tt.asmdemoapp

import android.content.Intent
import android.content.res.Resources
import android.os.AsyncTask
import android.os.Build
import android.os.Bundle
import android.os.HandlerThread
import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.RequiresApi


Expand All @@ -17,6 +19,8 @@ class MainActivity : BaseActivity() {
setContentView(R.layout.activity_main)
val imageView: ImageView =findViewById(R.id.iv)
imageView.setImageDrawable(getDrawable(R.drawable.ic_launcher_background))
println("====>imageView:${ resources.getResourceEntryName(imageView.id)}")
println("====>tv:${ findViewById<TextView>(R.id.tv).toString()}")
Thread()
object : AsyncTask<Void?, Void?, Void?>() {
override fun doInBackground(vararg params: Void?): Void? {
Expand Down
15 changes: 9 additions & 6 deletions app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
Expand All @@ -11,10 +11,13 @@
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/tp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:scaleType="centerCrop"
app:layout_constraintTop_toTopOf="parent" />
/>

</androidx.constraintlayout.widget.ConstraintLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tv"
/>

</RelativeLayout>
2 changes: 2 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,5 @@ publishing {





0 comments on commit a1c0883

Please sign in to comment.