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"
|
applicationId "me.lucky.wasted"
|
||||||
minSdk 25
|
minSdk 25
|
||||||
targetSdk 31
|
targetSdk 31
|
||||||
versionCode 2
|
versionCode 3
|
||||||
versionName "1.0.1"
|
versionName "1.0.2"
|
||||||
|
|
||||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,20 +35,16 @@ class MainActivity : AppCompatActivity() {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
binding = ActivityMainBinding.inflate(layoutInflater)
|
binding = ActivityMainBinding.inflate(layoutInflater)
|
||||||
setContentView(binding.root)
|
setContentView(binding.root)
|
||||||
|
init()
|
||||||
setup()
|
setup()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onStart() {
|
||||||
super.onResume()
|
super.onStart()
|
||||||
update()
|
update()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun update() {
|
private fun update() {
|
||||||
if (prefs.code == "") prefs.code = makeCode()
|
|
||||||
binding.apply {
|
|
||||||
code.text = prefs.code
|
|
||||||
toggle.isChecked = prefs.isServiceEnabled
|
|
||||||
}
|
|
||||||
if (!isAdminActive() && prefs.isServiceEnabled)
|
if (!isAdminActive() && prefs.isServiceEnabled)
|
||||||
Toast.makeText(
|
Toast.makeText(
|
||||||
this,
|
this,
|
||||||
|
@ -57,6 +53,14 @@ class MainActivity : AppCompatActivity() {
|
||||||
).show()
|
).show()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun init() {
|
||||||
|
if (prefs.code == "") prefs.code = makeCode()
|
||||||
|
binding.apply {
|
||||||
|
code.text = prefs.code
|
||||||
|
toggle.isChecked = prefs.isServiceEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun setup() {
|
private fun setup() {
|
||||||
binding.apply {
|
binding.apply {
|
||||||
code.setOnLongClickListener {
|
code.setOnLongClickListener {
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Not provided by developer
|
Loading…
Reference in New Issue