merono
08/28/2020, 4:31 PMConfiguration
changes stop working recently? That’s what it seems like when I use the code snippet below and specify android:configChanges="uiMode"
in my manifest.
MaterialTheme(
colors = if (isSystemInDarkTheme()) darkColors() else lightColors()
) {
Box(
Modifier.size(48.dp),
backgroundColor = MaterialTheme.colors.onBackground
)
}
The color of the Box
doesn’t change when I toggle dark mode on my device (pixel 3), but I feel like it did on an older version of compose. The color does get updated correctly if I kill the app and re-open it. I’m seeing this behavior on alpha01
and dev17
, using API 29.
I also tried similar things by using ConfigurationAmbient.current
directly, and saw the same behavior. When debugging the app, I was able to see AndroidComposeView.onConfigurationChanged
get called with the new Configuration
though.Louis Pullen-Freilich [G]
08/28/2020, 4:56 PMmerono
08/28/2020, 5:47 PMLouis Pullen-Freilich [G]
08/28/2020, 6:57 PMmaven { url '<https://androidx.dev/snapshots/builds/6798052/artifacts/ui/repository>' }
inside the
allProjects {
repositories {
block, and then change the version to be: compose_version = '1.0.0-SNAPSHOT'
)
Does this then work correctly for you on your setup?merono
08/29/2020, 2:38 PMLouis Pullen-Freilich [G]
08/29/2020, 2:43 PM