1
1
package com.mutkuensert.airqualitymonitor.ui.theme
2
2
3
- import android.os.Build
4
- import androidx.compose.foundation.isSystemInDarkTheme
5
3
import androidx.compose.material3.MaterialTheme
6
4
import androidx.compose.material3.darkColorScheme
7
- import androidx.compose.material3.dynamicDarkColorScheme
8
- import androidx.compose.material3.dynamicLightColorScheme
9
5
import androidx.compose.material3.lightColorScheme
10
6
import androidx.compose.runtime.Composable
11
- import androidx.compose.ui.platform.LocalContext
12
7
13
8
private val DarkColorScheme = darkColorScheme(
14
9
primary = Purple80 ,
@@ -34,23 +29,10 @@ private val LightColorScheme = lightColorScheme(
34
29
35
30
@Composable
36
31
fun AirQualityMeterTheme (
37
- darkTheme : Boolean = isSystemInDarkTheme(),
38
- // Dynamic color is available on Android 12+
39
- dynamicColor : Boolean = true,
40
32
content : @Composable () -> Unit
41
33
) {
42
- val colorScheme = when {
43
- dynamicColor && Build .VERSION .SDK_INT >= Build .VERSION_CODES .S -> {
44
- val context = LocalContext .current
45
- if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
46
- }
47
-
48
- darkTheme -> DarkColorScheme
49
- else -> LightColorScheme
50
- }
51
-
52
34
MaterialTheme (
53
- colorScheme = colorScheme ,
35
+ colorScheme = LightColorScheme ,
54
36
typography = Typography ,
55
37
content = content
56
38
)
0 commit comments