refactor(android): drop legacy theme fallback

main
Peter Steinberger 2025-12-18 01:39:57 +01:00
parent 460e170f7a
commit 3351c972e7
1 changed files with 1 additions and 10 deletions

View File

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