-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
Given the following:
@Preview(name = "TestBox - Light")
@Composable
fun TestPreviewLight() {
TestBox()
}
@Preview(name = "TestBox - Dark", uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun TestPreviewDark() {
TestBox()
}
@Composable
fun TestBox(
modifier: Modifier = Modifier
) {
Box(
modifier = modifier.size(100.dp)
) {
Image(
imageVector = ImageVector.vectorResource(id = R.drawable.test_drawable),
contentDescription = "Testing background",
)
}
}
where the R.drawable.test_drawable
is a vector that references night/day qualified colors or has a drawable-night
equivalent, the recorded snapshots only show the light variant - somehow the dark/night qualified assets are not being picked up:
Tried the following to try to force it, but didn't work either:
@Preview...
fun TestPreview() {
val customConfiguration = Configuration(LocalConfiguration.current).apply {
uiMode = Configuration.UI_MODE_NIGHT_YES
}
CompositionLocalProvider(LocalConfiguration provides customConfiguration) {
TestBox()
}
}
Is this a bug/limitation or is it a config issue? Thanks!
Metadata
Metadata
Assignees
Labels
No labels