🤔 Did recomposing on
Configuration
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.