Is it true that for a pure Compose app, we should ...
# compose
a
Is it true that for a pure Compose app, we should set
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden"
?
l
Everything actually, which is more than that.
a
Interesting. Thanks! I guess I gotta try and see how the app works after setting that. Didn't realize that was the recommendation.
l
It's not properly documented yet, but Adam Powell from Google participated in a discussion on this Slack not long ago. You can probably find it by searching with the right keywords.
🙏 2
a
It is still not clear how Compose will deal with configuration specific resources in this case. And I am afraid it won't.
l
Compose dedicated functions like
stringResource
should trigger a local recomposition on config change.
a
Yeah, it hooks to
AndroidComposeView.configurationChangeObserver
under the hood.
Then shouldn't this be a recommended approach and the
ViewModel
be discouraged from using?
l
It should, and eventually, it will, as you can see in the linked thread above your messages.
👍 2
a
Tried it just now without any issues. Strings/dimensions/etc are updated, UI state is preserved, looks fine.
🎉 1