I’m taking easy with some codelabs about compose a...
# compose
c
I’m taking easy with some codelabs about compose and I’m facing a weird problem with “*theme and preview*” It’s a very simple Composable
Copy code
@Preview(showBackground = true, name = "myPreview (Dark)")
@Composable
fun DefaultPreviewDark() {
    MyTheme(darkTheme = true) {
        MyScreeContentWithArgument()
    }
}
where
Copy code
@Composable
fun MyTheme(
    darkTheme: Boolean = isSystemInDarkTheme(),
    content: @Composable () -> Unit
) {
    val colors = if (darkTheme) {
        myDarkTheme
    } else {
        myLightTheme
    }

    MaterialTheme(
        colors = colors,
        typography = Typography,
        shapes = Shapes,
        content = content
    )
}
Android studio doesn’t show up the preview in dark mode but installing on a device everything work correctly. compose_version = 1.0.1 kotlin 1.5.21