I want to load different resource files according to Dark/Light theme in Jetpack Compose, but it is not working.
What should I do next?
Image(
modifier = Modifier.align(Alignment.CenterHorizontally),
painter = painterResource(id = R.drawable.ic_daynight),
contentDescription = null
)
res/drawable/ic_daynight.xml:
res/drawable-night/ic_daynight.xml:
Res folder:
theme.xml: