|
17 | 17 | package com.example.jetcaster.ui.theme |
18 | 18 |
|
19 | 19 | import android.os.Build |
20 | | -import androidx.compose.foundation.isSystemInDarkTheme |
21 | 20 | import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi |
22 | 21 | import androidx.compose.material3.MaterialExpressiveTheme |
23 | 22 | import androidx.compose.material3.MotionScheme |
24 | 23 | import androidx.compose.material3.darkColorScheme |
25 | 24 | import androidx.compose.material3.dynamicDarkColorScheme |
26 | | -import androidx.compose.material3.dynamicLightColorScheme |
27 | 25 | import androidx.compose.material3.lightColorScheme |
28 | 26 | import androidx.compose.runtime.Composable |
29 | | -import androidx.compose.runtime.Immutable |
30 | | -import androidx.compose.ui.graphics.Color |
31 | 27 | import androidx.compose.ui.platform.LocalContext |
32 | 28 | import com.example.jetcaster.designsystem.theme.JetcasterShapes |
33 | 29 | import com.example.jetcaster.designsystem.theme.JetcasterTypography |
@@ -470,29 +466,15 @@ private val highContrastDarkColorScheme = darkColorScheme( |
470 | 466 | surfaceContainerHighest = surfaceContainerHighestDarkHighContrast, |
471 | 467 | ) |
472 | 468 |
|
473 | | -@Immutable |
474 | | -data class ColorFamily(val color: Color, val onColor: Color, val colorContainer: Color, val onColorContainer: Color) |
475 | | - |
476 | | -val unspecified_scheme = ColorFamily( |
477 | | - Color.Unspecified, Color.Unspecified, Color.Unspecified, Color.Unspecified, |
478 | | -) |
479 | | - |
480 | 469 | @OptIn(ExperimentalMaterial3ExpressiveApi::class) |
481 | 470 | @Composable |
482 | | -fun JetcasterTheme( |
483 | | - darkTheme: Boolean = isSystemInDarkTheme(), |
484 | | - // Dynamic color is available on Android 12+ |
485 | | - dynamicColor: Boolean = false, |
486 | | - content: @Composable () -> Unit, |
487 | | -) { |
| 471 | +fun JetcasterTheme(dynamicColor: Boolean = false, content: @Composable () -> Unit) { |
488 | 472 | val colorScheme = when { |
489 | 473 | dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { |
490 | 474 | val context = LocalContext.current |
491 | | - if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) |
| 475 | + dynamicDarkColorScheme(context) |
492 | 476 | } |
493 | | - |
494 | | - darkTheme -> darkScheme |
495 | | - else -> lightScheme |
| 477 | + else -> darkScheme |
496 | 478 | } |
497 | 479 |
|
498 | 480 | MaterialExpressiveTheme( |
|
0 commit comments