refactor(android): drop legacy theme fallback

This commit is contained in:
Peter Steinberger
2025-12-18 01:39:57 +01:00
parent 460e170f7a
commit 3351c972e7

View File

@@ -1,12 +1,9 @@
package com.steipete.clawdis.node.ui
import android.os.Build
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.dynamicDarkColorScheme
import androidx.compose.material3.dynamicLightColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
@@ -15,12 +12,7 @@ import androidx.compose.ui.platform.LocalContext
fun ClawdisTheme(content: @Composable () -> Unit) {
val context = LocalContext.current
val isDark = isSystemInDarkTheme()
val colorScheme =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
if (isDark) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
} else {
if (isDark) darkColorScheme() else lightColorScheme()
}
val colorScheme = if (isDark) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
MaterialTheme(colorScheme = colorScheme, content = content)
}
@@ -38,4 +30,3 @@ fun overlayContainerColor(): Color {
fun overlayIconColor(): Color {
return MaterialTheme.colorScheme.onSurfaceVariant
}