File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
app/src/main/java/com/example/reply/ui/theme Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package com.example.reply.ui.theme
18
18
19
+ import android.app.Activity
19
20
import android.os.Build
20
21
import androidx.compose.foundation.isSystemInDarkTheme
21
22
import androidx.compose.material3.MaterialTheme
@@ -24,7 +25,10 @@ import androidx.compose.material3.dynamicDarkColorScheme
24
25
import androidx.compose.material3.dynamicLightColorScheme
25
26
import androidx.compose.material3.lightColorScheme
26
27
import androidx.compose.runtime.Composable
28
+ import androidx.compose.runtime.SideEffect
27
29
import androidx.compose.ui.platform.LocalContext
30
+ import androidx.compose.ui.platform.LocalView
31
+ import androidx.core.view.WindowCompat
28
32
29
33
private val LightColorScheme = lightColorScheme(
30
34
primary = md_theme_light_primary,
@@ -110,6 +114,14 @@ fun ReplyTheme(
110
114
else -> LightColorScheme
111
115
}
112
116
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
+
113
125
MaterialTheme (
114
126
colorScheme = colorScheme,
115
127
typography = Typography ,
You can’t perform that action at this time.
0 commit comments