chore(android-terminal): drop deprecated Window.statusBarColor write
Some checks failed
Some checks failed
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:
@@ -6,7 +6,6 @@ import androidx.compose.material3.*
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.SideEffect
|
import androidx.compose.runtime.SideEffect
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.toArgb
|
|
||||||
import androidx.compose.ui.platform.LocalView
|
import androidx.compose.ui.platform.LocalView
|
||||||
import androidx.core.view.WindowCompat
|
import androidx.core.view.WindowCompat
|
||||||
|
|
||||||
@@ -44,11 +43,14 @@ fun RewardFlowTheme(
|
|||||||
) {
|
) {
|
||||||
val colorScheme = if (darkTheme) DarkColorScheme else LightColorScheme
|
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
|
val view = LocalView.current
|
||||||
if (!view.isInEditMode) {
|
if (!view.isInEditMode) {
|
||||||
SideEffect {
|
SideEffect {
|
||||||
val window = (view.context as Activity).window
|
val window = (view.context as Activity).window
|
||||||
window.statusBarColor = colorScheme.primaryContainer.toArgb()
|
|
||||||
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
|
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user