Commit 067cb0cd authored by Viktor De Pasquale's avatar Viktor De Pasquale

Fixed magisk button states

parent 17fb8f22
......@@ -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 &amp;&amp; (viewModel.stateMagiskProgress == 0 || viewModel.stateMagiskProgress == 100)}"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment