File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
openclaw-android/src/main/java/ai/openclaw/app/ui Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 11package ai.openclaw.app.ui
22
33import android.app.Activity
4+ import android.os.Build
45import androidx.compose.foundation.isSystemInDarkTheme
56import androidx.compose.material3.MaterialTheme
7+ import androidx.compose.material3.darkColorScheme
68import androidx.compose.material3.dynamicDarkColorScheme
79import androidx.compose.material3.dynamicLightColorScheme
10+ import androidx.compose.material3.lightColorScheme
811import androidx.compose.runtime.Composable
912import androidx.compose.runtime.CompositionLocalProvider
1013import androidx.compose.runtime.SideEffect
@@ -17,7 +20,14 @@ import androidx.core.view.WindowCompat
1720fun OpenClawTheme (content : @Composable () -> Unit ) {
1821 val context = LocalContext .current
1922 val isDark = isSystemInDarkTheme()
20- val colorScheme = if (isDark) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
23+ val colorScheme = when {
24+ // Dynamic colors require Android 12+ (API 31)
25+ Build .VERSION .SDK_INT >= Build .VERSION_CODES .S -> {
26+ if (isDark) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
27+ }
28+ isDark -> darkColorScheme()
29+ else -> lightColorScheme()
30+ }
2131 val mobileColors = if (isDark) darkMobileColors() else lightMobileColors()
2232
2333 val view = LocalView .current
You can’t perform that action at this time.
0 commit comments