diff --git a/app/src/main/java/com/topjohnwu/magisk/redesign/MainActivity.kt b/app/src/main/java/com/topjohnwu/magisk/redesign/MainActivity.kt index b87ffaf31..884e45e6a 100644 --- a/app/src/main/java/com/topjohnwu/magisk/redesign/MainActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/redesign/MainActivity.kt @@ -16,6 +16,7 @@ import com.topjohnwu.magisk.ui.log.LogFragment import com.topjohnwu.magisk.ui.module.ModulesFragment import com.topjohnwu.magisk.ui.settings.SettingsFragment import com.topjohnwu.magisk.ui.superuser.SuperuserFragment +import com.topjohnwu.superuser.Shell import org.koin.androidx.viewmodel.ext.android.viewModel import kotlin.reflect.KClass @@ -66,6 +67,16 @@ open class MainActivity : CompatActivity( } } + override fun onResume() { + super.onResume() + binding.mainNavigation.menu.apply { + val isRoot = Shell.rootAccess() + findItem(R.id.modulesFragment)?.isEnabled = isRoot + findItem(R.id.superuserFragment)?.isEnabled = isRoot + findItem(R.id.logFragment)?.isEnabled = isRoot + } + } + override fun onDestroy() { binding.mainNavigation.viewTreeObserver.removeOnGlobalLayoutListener(navObserver) super.onDestroy() diff --git a/app/src/main/res/color/color_menu_tint.xml b/app/src/main/res/color/color_menu_tint.xml index 7e45559cd..030b0e573 100644 --- a/app/src/main/res/color/color_menu_tint.xml +++ b/app/src/main/res/color/color_menu_tint.xml @@ -1,5 +1,6 @@ + \ No newline at end of file diff --git a/app/src/main/res/values-night/styles_md2.xml b/app/src/main/res/values-night/styles_md2.xml index c1b767bea..aef51115d 100644 --- a/app/src/main/res/values-night/styles_md2.xml +++ b/app/src/main/res/values-night/styles_md2.xml @@ -17,6 +17,7 @@ #BABABA #80BABABA #808080 + #66808080 @color/color_text_transient @color/color_primary_transient @color/color_error_transient diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 6c1bd516c..23996c090 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -81,6 +81,7 @@ + diff --git a/app/src/main/res/values/styles_md2.xml b/app/src/main/res/values/styles_md2.xml index 5c2455c3f..6eeaebda3 100644 --- a/app/src/main/res/values/styles_md2.xml +++ b/app/src/main/res/values/styles_md2.xml @@ -100,6 +100,7 @@ #444444 #80444444 #808080 + #66808080 @color/color_text_transient @color/color_primary_transient @color/color_error_transient