From 38cfe2f80e7682401b59512fb38b9ac188b4d0ea Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Wed, 2 Sep 2026 22:23:17 -0700 Subject: [PATCH] app: sync system bar icon colors with theme Because the base post-splash theme is a dark theme, the window defaults to light (white) status bar icons. When the app is in light theme, the icons blend into the light background and become invisible. Synchronize WindowInsetsControllerCompat's appearance flags with the active theme so dark icons are used in light theme and light icons in dark theme. Assisted-by: Gemini 3.8 Flash --- .../java/com/topjohnwu/magisk/ui/MagiskTheme.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/apk/src/main/java/com/topjohnwu/magisk/ui/MagiskTheme.kt b/app/apk/src/main/java/com/topjohnwu/magisk/ui/MagiskTheme.kt index e67fab9da..fe4a84b75 100644 --- a/app/apk/src/main/java/com/topjohnwu/magisk/ui/MagiskTheme.kt +++ b/app/apk/src/main/java/com/topjohnwu/magisk/ui/MagiskTheme.kt @@ -1,6 +1,7 @@ package com.topjohnwu.magisk.ui import android.os.Build +import androidx.activity.compose.LocalActivity import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.MaterialTheme @@ -11,13 +12,16 @@ import androidx.compose.material3.dynamicDarkColorScheme import androidx.compose.material3.dynamicLightColorScheme import androidx.compose.material3.lightColorScheme import androidx.compose.runtime.Composable +import androidx.compose.runtime.SideEffect import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.setValue import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalView import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.font.FontWeight +import androidx.core.view.WindowCompat import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.topjohnwu.magisk.core.Config @@ -193,6 +197,17 @@ fun MagiskTheme( else -> MagiskLightColorScheme } + val activity = LocalActivity.current + val view = LocalView.current + if (!view.isInEditMode && activity != null) { + SideEffect { + val window = activity.window + val controller = WindowCompat.getInsetsController(window, view) + controller.isAppearanceLightStatusBars = !isDarkTheme + controller.isAppearanceLightNavigationBars = !isDarkTheme + } + } + MaterialTheme( colorScheme = colorScheme, shapes = MagiskShapes,