new pig icon, some improvements
This commit is contained in:
@@ -2,11 +2,10 @@ package ru.shadowsparky.ui.theme
|
||||
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.ColorScheme
|
||||
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||
import androidx.compose.material3.MaterialExpressiveTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.compositionLocalOf
|
||||
|
||||
val lightScheme = lightColorScheme(
|
||||
primary = primaryLight,
|
||||
@@ -84,21 +83,11 @@ val darkScheme = darkColorScheme(
|
||||
surfaceContainerHighest = surfaceContainerHighestDark,
|
||||
)
|
||||
|
||||
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||
@Composable
|
||||
fun AppTheme(
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
MaterialExpressiveTheme(
|
||||
colorScheme = getColorScheme(),
|
||||
typography = AppTypography,
|
||||
content = content
|
||||
)
|
||||
}
|
||||
val LocalColorSchemeProvider = compositionLocalOf<ColorScheme?> { null }
|
||||
|
||||
@Composable
|
||||
fun getColorScheme(): ColorScheme {
|
||||
return when {
|
||||
return LocalColorSchemeProvider.current ?: when {
|
||||
isSystemInDarkTheme() -> darkDynamicScheme() ?: darkScheme
|
||||
else -> lightDynamicScheme() ?: lightScheme
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user