mirror of
https://github.com/lizongying/my-tv.git
synced 2026-11-17 00:46:30 +08:00
help page
This commit is contained in:
@@ -5,6 +5,7 @@ import android.content.pm.PackageInfo
|
|||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.content.pm.Signature
|
import android.content.pm.Signature
|
||||||
import android.content.pm.SigningInfo
|
import android.content.pm.SigningInfo
|
||||||
|
import android.graphics.Color
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.os.Handler
|
import android.os.Handler
|
||||||
@@ -20,6 +21,7 @@ import android.widget.LinearLayout
|
|||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
|
import androidx.core.view.setPadding
|
||||||
import androidx.fragment.app.FragmentActivity
|
import androidx.fragment.app.FragmentActivity
|
||||||
import com.lizongying.mytv.models.TVViewModel
|
import com.lizongying.mytv.models.TVViewModel
|
||||||
import java.security.MessageDigest
|
import java.security.MessageDigest
|
||||||
@@ -192,16 +194,24 @@ class MainActivity : FragmentActivity() {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
KeyEvent.KEYCODE_SETTINGS -> {
|
||||||
|
Toast.makeText(this, "KEYCODE_SETTINGS", Toast.LENGTH_SHORT).show()
|
||||||
|
}
|
||||||
KeyEvent.KEYCODE_MENU -> {
|
KeyEvent.KEYCODE_MENU -> {
|
||||||
|
Toast.makeText(this, "KEYCODE_MENU", Toast.LENGTH_SHORT).show()
|
||||||
val versionName = getPackageInfo().versionName
|
val versionName = getPackageInfo().versionName
|
||||||
|
|
||||||
val textView = TextView(this)
|
val textView = TextView(this)
|
||||||
textView.text =
|
textView.text =
|
||||||
"当前版本: $versionName\n获取最新: https://github.com/lizongying/my-tv/releases/"
|
"当前版本: $versionName\n获取最新: https://github.com/lizongying/my-tv/releases/"
|
||||||
|
textView.setBackgroundColor(0xFF263238.toInt())
|
||||||
|
textView.setPadding(20, 50, 20, 20)
|
||||||
|
|
||||||
|
|
||||||
val imageView = ImageView(this)
|
val imageView = ImageView(this)
|
||||||
val drawable = ContextCompat.getDrawable(this, R.drawable.appreciate)
|
val drawable = ContextCompat.getDrawable(this, R.drawable.appreciate)
|
||||||
imageView.setImageDrawable(drawable)
|
imageView.setImageDrawable(drawable)
|
||||||
|
imageView.setBackgroundColor(Color.WHITE)
|
||||||
|
|
||||||
val linearLayout = LinearLayout(this)
|
val linearLayout = LinearLayout(this)
|
||||||
linearLayout.orientation = LinearLayout.VERTICAL
|
linearLayout.orientation = LinearLayout.VERTICAL
|
||||||
@@ -209,11 +219,15 @@ class MainActivity : FragmentActivity() {
|
|||||||
linearLayout.addView(imageView)
|
linearLayout.addView(imageView)
|
||||||
|
|
||||||
val layoutParams = LinearLayout.LayoutParams(
|
val layoutParams = LinearLayout.LayoutParams(
|
||||||
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
|
LinearLayout.LayoutParams.WRAP_CONTENT,
|
||||||
|
)
|
||||||
|
textView.layoutParams = layoutParams
|
||||||
|
val layoutParams2 = LinearLayout.LayoutParams(
|
||||||
LinearLayout.LayoutParams.MATCH_PARENT,
|
LinearLayout.LayoutParams.MATCH_PARENT,
|
||||||
LinearLayout.LayoutParams.WRAP_CONTENT
|
LinearLayout.LayoutParams.WRAP_CONTENT
|
||||||
)
|
)
|
||||||
imageView.layoutParams = layoutParams
|
imageView.layoutParams = layoutParams2
|
||||||
textView.layoutParams = layoutParams
|
|
||||||
|
|
||||||
val builder: AlertDialog.Builder = AlertDialog.Builder(this)
|
val builder: AlertDialog.Builder = AlertDialog.Builder(this)
|
||||||
builder
|
builder
|
||||||
|
|||||||
Reference in New Issue
Block a user