ThemeEngine: Don't apply color to systembar on Android 15+
Android 15 enforces transparent colors on system bars Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -65,6 +65,10 @@ fun isUAndAbove(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE
|
||||
}
|
||||
|
||||
fun isVAndAbove(): Boolean {
|
||||
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM
|
||||
}
|
||||
|
||||
fun isMIUI(): Boolean {
|
||||
return getSystemProperty("ro.miui.ui.version.name").isNotEmpty()
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ fun AppCompatActivity.applyThemeAccent() {
|
||||
}
|
||||
|
||||
1 -> {
|
||||
setSystemBarConfiguration(light = true)
|
||||
if (!isVAndAbove()) setSystemBarConfiguration(light = true)
|
||||
if (isSAndAbove()) {
|
||||
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_NO)
|
||||
} else {
|
||||
@@ -60,7 +60,7 @@ fun AppCompatActivity.applyThemeAccent() {
|
||||
}
|
||||
|
||||
else -> {
|
||||
setSystemBarConfiguration(light = false)
|
||||
if (!isVAndAbove()) setSystemBarConfiguration(light = false)
|
||||
if (isSAndAbove()) {
|
||||
uiModeManager.setApplicationNightMode(UiModeManager.MODE_NIGHT_YES)
|
||||
} else {
|
||||
@@ -70,6 +70,7 @@ fun AppCompatActivity.applyThemeAccent() {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
private fun AppCompatActivity.setSystemBarConfiguration(light: Boolean) {
|
||||
WindowInsetsControllerCompat(this.window, this.window.decorView.rootView).apply {
|
||||
// Status bar color
|
||||
|
||||
Reference in New Issue
Block a user