What’s the correct way to update an AndroidView wh...
# compose
a
What’s the correct way to update an AndroidView when the Theme/Configuration changes? The view doesn’t update when changing Light/Dark theme
c
Have you setup your themes for Views to handle dark theme? Theming for Views is handled differently and separately than Compose
👀 1
m
If you have UIThemes setup, Compose will recompose the UI when Theme changes happen. You can differ the UI based on isSystemInDarkMode or your custom theme based on changes set in ui themes, typography and color.
There is a codelab sample for same
a
@/Chris you mean setting a night and day resource right? Basically theming works initially, but doesn’t update anymore when changing theme at runtime. Hmm, one thing is that I disabled all
configChange
as recommended in some thread here, so it doesn’t re-create the Activity. Now usually that means handling stuff in
onConfigurationChange
myself, and Compose handles that gracefully, but it doesn’t work for AndroidViews and I’m not sure how to.
If there’s some way for AndroidView to re-inflate somehow…
c
cc @Nick Rout
🙏 1