Added a condition to hide reboot button when no root is available

This commit is contained in:
Viktor De Pasquale 2020-02-01 14:48:39 +01:00 committed by John Wu
parent cbe3602cb7
commit dd9129017f

View File

@ -13,8 +13,6 @@
<import type="com.topjohnwu.magisk.R" />
<import type="com.topjohnwu.superuser.Shell" />
<variable
name="viewModel"
type="com.topjohnwu.magisk.ui.home.HomeViewModel" />
@ -51,7 +49,7 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/home_device_action_reboot"
style="@style/WidgetFoundation.Button.Text"
gone="@{!Shell.rootAccess()}"
invisibleUnless="@{XSUKt.hasRoot}"
popupMenu="@{R.menu.menu_reboot}"
popupMenuOnClickListener="@{(it) -> viewModel.rebootPressed(it)}"
android:layout_width="wrap_content"