Skip to content

Commit e975d25

Browse files
updates
1 parent 2894e3d commit e975d25

File tree

1 file changed

+12
-0
lines changed
  • app/src/main/java/com/example/reply/ui/theme

1 file changed

+12
-0
lines changed

app/src/main/java/com/example/reply/ui/theme/Theme.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.example.reply.ui.theme
1818

19+
import android.app.Activity
1920
import android.os.Build
2021
import androidx.compose.foundation.isSystemInDarkTheme
2122
import androidx.compose.material3.MaterialTheme
@@ -24,7 +25,10 @@ import androidx.compose.material3.dynamicDarkColorScheme
2425
import androidx.compose.material3.dynamicLightColorScheme
2526
import androidx.compose.material3.lightColorScheme
2627
import androidx.compose.runtime.Composable
28+
import androidx.compose.runtime.SideEffect
2729
import androidx.compose.ui.platform.LocalContext
30+
import androidx.compose.ui.platform.LocalView
31+
import androidx.core.view.WindowCompat
2832

2933
private val LightColorScheme = lightColorScheme(
3034
primary = md_theme_light_primary,
@@ -110,6 +114,14 @@ fun ReplyTheme(
110114
else -> LightColorScheme
111115
}
112116

117+
val view = LocalView.current
118+
if (!view.isInEditMode) {
119+
SideEffect {
120+
val window = (view.context as Activity).window
121+
WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = !darkTheme
122+
}
123+
}
124+
113125
MaterialTheme(
114126
colorScheme = colorScheme,
115127
typography = Typography,

0 commit comments

Comments
 (0)