diff --git a/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIActivity.kt b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIActivity.kt index e327820e5..2f3c0da00 100644 --- a/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIActivity.kt +++ b/app/src/main/java/com/topjohnwu/magisk/arch/BaseUIActivity.kt @@ -1,5 +1,8 @@ package com.topjohnwu.magisk.arch +import android.content.res.Resources +import android.graphics.Color +import android.os.Build import android.os.Bundle import android.view.KeyEvent import android.view.View @@ -59,6 +62,31 @@ abstract class BaseUIActivity : directionsDispatcher.value = null } } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + window?.decorView?.let { + it.systemUiVisibility = (it.systemUiVisibility + or View.SYSTEM_UI_FLAG_LAYOUT_STABLE + or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + or View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION) + } + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + window?.decorView?.post { + // If navigation bar is short enough (gesture navigation enabled), make it transparent + if (window.decorView.rootWindowInsets?.systemWindowInsetBottom ?: 0 < Resources.getSystem().displayMetrics.density * 40) { + window.navigationBarColor = Color.TRANSPARENT + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + window.navigationBarDividerColor = Color.TRANSPARENT + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { + window.isNavigationBarContrastEnforced = false + window.isStatusBarContrastEnforced = false + } + } + } + } + } } fun setContentView() { diff --git a/app/src/main/res/values-night/styles_md2.xml b/app/src/main/res/values-night/styles_md2.xml new file mode 100644 index 000000000..2c8a3c5c3 --- /dev/null +++ b/app/src/main/res/values-night/styles_md2.xml @@ -0,0 +1,8 @@ + + + + - diff --git a/app/src/main/res/values-v19/themes.xml b/app/src/main/res/values-v19/themes.xml new file mode 100644 index 000000000..6b4e43bf4 --- /dev/null +++ b/app/src/main/res/values-v19/themes.xml @@ -0,0 +1,18 @@ + + + + + + + + - diff --git a/app/src/main/res/values-v21/themes.xml b/app/src/main/res/values-v21/themes.xml new file mode 100644 index 000000000..54ccddd36 --- /dev/null +++ b/app/src/main/res/values-v21/themes.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + +