Fixed magisk button states
This commit is contained in:
parent
17fb8f2298
commit
067cb0cd9d
@ -140,15 +140,12 @@ class HomeViewModel(
|
||||
fun onManagerPressed() = ManagerInstallDialog().publish()
|
||||
|
||||
fun onMagiskPressed() {
|
||||
//pre-fix so user doesn't click twice accidentally
|
||||
stateMagiskProgress.value = 1
|
||||
|
||||
withPermissions(
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||
).map { check(it);it }.subscribeK(onError = {
|
||||
stateManagerProgress.value = 0
|
||||
}) {
|
||||
).map { check(it);it }.subscribeK {
|
||||
//pre-fix so user doesn't click twice accidentally
|
||||
stateMagiskProgress.value = 1
|
||||
DownloadService(get()) {
|
||||
subject = Magisk(Configuration.Download)
|
||||
}
|
||||
|
@ -118,7 +118,7 @@
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="?styleButtonDefault"
|
||||
gone="@{viewModel.stateMagisk != MagiskState.OBSOLETE}"
|
||||
isEnabled="@{viewModel.stateManager == MagiskState.UP_TO_DATE}"
|
||||
isEnabled="@{viewModel.stateManager == MagiskState.UP_TO_DATE && (viewModel.stateMagiskProgress == 0 || viewModel.stateMagiskProgress == 100)}"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
|
Loading…
Reference in New Issue
Block a user