chore(android-terminal): drop deprecated Window.statusBarColor write
Some checks failed
CI / ruff (push) Successful in 13s
CI / pytest (push) Failing after 2h24m23s
CI / validate (push) Successful in 28s
CI / dependency-scanning (push) Successful in 30s
CI / docs (push) Has been skipped
CI / deploy (push) Has been skipped

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) <noreply@anthropic.com>
This commit is contained in:
2026-05-08 00:22:39 +02:00
parent c1d367bac2
commit fc7dc0ccd5

View File

@@ -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
}
}