Commit dd912901 authored by Viktor De Pasquale's avatar Viktor De Pasquale Committed by John Wu

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

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