Colton Idle
03/22/2023, 4:51 PM@Preview(uiMode = UI_MODE_NIGHT_YES)
@Composable
fun HelloWorldPreview() {
MaterialTheme() { Surface { Text("Hello kotlinglang") } }
}
Alex Vanyo
03/22/2023, 4:54 PMMaterialTheme
just uses a light color scheme by default, and doesn’t react to light and dark mode automaticallyColton Idle
03/22/2023, 4:58 PMColton Idle
03/22/2023, 4:58 PMColton Idle
03/22/2023, 5:00 PM@Composable
fun Mytheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
AppTheme(colors = if (darkTheme) darkColors() else lightColors(), content = content)
}
Colton Idle
03/22/2023, 5:09 PMStylianos Gakis
03/22/2023, 5:54 PMchanjungskim
03/23/2023, 12:33 AMStylianos Gakis
03/23/2023, 12:34 AMdon’t you need background?Surface sets a background along with the ContentColor composition local by itself
Colton Idle
03/23/2023, 3:56 AMChris Sinco [G]
03/23/2023, 5:11 PMStylianos Gakis
03/23/2023, 5:15 PMColton Idle
03/23/2023, 5:23 PMChris Sinco [G]
03/23/2023, 5:30 PMChris Sinco [G]
03/23/2023, 5:30 PMColton Idle
03/26/2023, 2:20 PMChris Sinco [G]
03/26/2023, 6:18 PMChris Sinco [G]
05/05/2023, 11:43 PM