mirror of https://github.com/x13a/Wasted.git
ref
This commit is contained in:
parent
727de2b6ac
commit
b8de10eaf3
|
@ -10,8 +10,8 @@ android {
|
|||
applicationId "me.lucky.wasted"
|
||||
minSdk 25
|
||||
targetSdk 31
|
||||
versionCode 2
|
||||
versionName "1.0.1"
|
||||
versionCode 3
|
||||
versionName "1.0.2"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
|
@ -35,20 +35,16 @@ class MainActivity : AppCompatActivity() {
|
|||
super.onCreate(savedInstanceState)
|
||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||
setContentView(binding.root)
|
||||
init()
|
||||
setup()
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
update()
|
||||
}
|
||||
|
||||
private fun update() {
|
||||
if (prefs.code == "") prefs.code = makeCode()
|
||||
binding.apply {
|
||||
code.text = prefs.code
|
||||
toggle.isChecked = prefs.isServiceEnabled
|
||||
}
|
||||
if (!isAdminActive() && prefs.isServiceEnabled)
|
||||
Toast.makeText(
|
||||
this,
|
||||
|
@ -57,6 +53,14 @@ class MainActivity : AppCompatActivity() {
|
|||
).show()
|
||||
}
|
||||
|
||||
private fun init() {
|
||||
if (prefs.code == "") prefs.code = makeCode()
|
||||
binding.apply {
|
||||
code.text = prefs.code
|
||||
toggle.isChecked = prefs.isServiceEnabled
|
||||
}
|
||||
}
|
||||
|
||||
private fun setup() {
|
||||
binding.apply {
|
||||
code.setOnLongClickListener {
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Not provided by developer
|
Loading…
Reference in New Issue