https://kotlinlang.org logo
#compose
Title
# compose
l

louiscad

08/17/2019, 9:18 AM
If found the following comment in Compose codebase:
// onConfigurationChange is the correct hook to update configuration, however it is
// possible that the configuration object itself may come from a wrapped
// context / themed activity, and may not actually reflect the system. So instead we
// use this hook to grab the applicationContext's configuration, which accurately
// reflects the state of the application / system.
(from https://android.googlesource.com/platform/frameworks/support/+/androidx-master-dev/ui/ui-framework/src/main/java/androidx/ui/core/Wrapper.kt#170) and I'm concerned it would break the usage of
Context.createConfigurationContext()
usually used when you want to change the language to be different from the default one in the system, or use an app local custom configuration for other purposes. Why not use the configuration from the given context instead?
i

itnoles

08/17/2019, 9:22 PM
Context can be from anything like Themed, Activity and Application. How they can tell if it is correct one to use?
4 Views