Fixed checkboxes on homescreen not writing values to static fields
This commit is contained in:
parent
cbe64fd559
commit
e426090a18
@ -1,6 +1,7 @@
|
||||
package com.topjohnwu.magisk.ui.home
|
||||
|
||||
import android.content.res.Resources
|
||||
import com.skoumal.teanity.extensions.addOnPropertyChangedCallback
|
||||
import com.skoumal.teanity.util.KObservableField
|
||||
import com.topjohnwu.magisk.*
|
||||
import com.topjohnwu.magisk.model.events.*
|
||||
@ -24,11 +25,6 @@ class HomeViewModel(
|
||||
val isForceEncryption = KObservableField(Config.keepEnc)
|
||||
val isKeepVerity = KObservableField(Config.keepVerity)
|
||||
|
||||
private val prefsObserver = Observer(isForceEncryption, isKeepVerity) {
|
||||
Config.keepEnc = isForceEncryption.value
|
||||
Config.keepVerity = isKeepVerity.value
|
||||
}
|
||||
|
||||
val magiskState = KObservableField(MagiskState.LOADING)
|
||||
val magiskStateText = Observer(magiskState) {
|
||||
when (magiskState.value) {
|
||||
@ -90,6 +86,14 @@ class HomeViewModel(
|
||||
|
||||
init {
|
||||
Event.register(this)
|
||||
|
||||
isForceEncryption.addOnPropertyChangedCallback {
|
||||
Config.keepEnc = it ?: return@addOnPropertyChangedCallback
|
||||
}
|
||||
isKeepVerity.addOnPropertyChangedCallback {
|
||||
Config.keepVerity = it ?: return@addOnPropertyChangedCallback
|
||||
}
|
||||
|
||||
refresh()
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user