Coverage Summary for Class: ThemeKt (com.javiersc.samples.features._theme)
Class |
Method, %
|
Branch, %
|
Line, %
|
Instruction, %
|
ThemeKt |
0%
(0/4)
|
0%
(0/38)
|
0%
(0/14)
|
0%
(0/257)
|
ThemeKt$ComposePlaygroundTheme$1 |
|
Total |
0%
(0/4)
|
0%
(0/38)
|
0%
(0/14)
|
0%
(0/257)
|
package com.javiersc.samples.features._theme
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.material3.ColorScheme
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
internal val DarkColorScheme =
darkColorScheme(primary = Purple80, secondary = PurpleGrey80, tertiary = Pink80)
internal val LightColorScheme =
lightColorScheme(
primary = Purple40,
secondary = PurpleGrey40,
tertiary = Pink40
/* Other default colors to override
background = Color(0xFFFFFBFE),
surface = Color(0xFFFFFBFE),
onPrimary = Color.White,
onSecondary = Color.White,
onTertiary = Color.White,
onBackground = Color(0xFF1C1B1F),
onSurface = Color(0xFF1C1B1F),
*/
)
@Composable
fun ComposePlaygroundTheme(
isDarkTheme: Boolean = isSystemInDarkTheme(),
// Dynamic color is available on Android 12+
dynamicColor: Boolean = true,
content: @Composable () -> Unit
) {
val colorScheme = colorScheme(dynamicColor, isDarkTheme)
AndroidConfig(colorScheme, isDarkTheme)
MaterialTheme(colorScheme = colorScheme, typography = Typography, content = content)
}
@Composable expect fun colorScheme(dynamicColor: Boolean, isDarkTheme: Boolean): ColorScheme
@Composable expect fun AndroidConfig(colorScheme: ColorScheme, isDarkTheme: Boolean)