From fc7dc0ccd54ac05d3e338651a3f4da16d272f112 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Fri, 8 May 2026 00:22:39 +0200 Subject: [PATCH] chore(android-terminal): drop deprecated Window.statusBarColor write Window.setStatusBarColor was deprecated in API 35; the recommended path is enableEdgeToEdge() (already called in MainActivity) which lets the theme drive the color. Keep the isAppearanceLightStatusBars line so the icon tint stays correct on the brief moments immersive mode reveals the bars on swipe. Silences the last Kotlin compile warning. Build is clean. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../src/main/java/lu/rewardflow/terminal/ui/theme/Theme.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clients/terminal-android/app/src/main/java/lu/rewardflow/terminal/ui/theme/Theme.kt b/clients/terminal-android/app/src/main/java/lu/rewardflow/terminal/ui/theme/Theme.kt index 9abcb650..dccd1a7a 100644 --- a/clients/terminal-android/app/src/main/java/lu/rewardflow/terminal/ui/theme/Theme.kt +++ b/clients/terminal-android/app/src/main/java/lu/rewardflow/terminal/ui/theme/Theme.kt @@ -6,7 +6,6 @@ import androidx.compose.material3.* import androidx.compose.runtime.Composable import androidx.compose.runtime.SideEffect import androidx.compose.ui.graphics.Color -import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.platform.LocalView import androidx.core.view.WindowCompat @@ -44,11 +43,14 @@ fun RewardFlowTheme( ) { val colorScheme = if (darkTheme) DarkColorScheme else LightColorScheme + // Status-bar color is handled by enableEdgeToEdge() in MainActivity + // (Window.statusBarColor is deprecated since API 35). We only need to + // set the icon tint for the brief moments the bars are revealed via + // swipe (immersive mode keeps them hidden the rest of the time). val view = LocalView.current if (!view.isInEditMode) { SideEffect { val window = (view.context as Activity).window - window.statusBarColor = colorScheme.primaryContainer.toArgb() WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme } }