Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Request for new functionality
View staffing
Description
Component used: Activity
Version used: 1.9.0
Devices/Android versions reproduced on: All
Calling
enableEdgeToEdge
without params sets up the system bars with the correct values based on the current theme. Some pure Compose apps rely on recomposition rather than activity recreation to update the UI. That means the user can open the app and initially see the right colors, but change the system theme will result in the Compose UI correctly updating but the system UI (e.g., status bar icon color) does not update.Rather than having all users override onConfigurationChanged to call
enableEdgeToEdge
again, it'd be nice to haveenableEdgeToEdge
calladdOnConfigurationChangedListener
to set up a listener to automatically update the system bar colors when the theme changes.The one caveat is that a Compose theme isn't necessarily changing based on the system theme (e.g., it might have user selectable themes), which means a system theme change might not need to change the colors. Maybe only calls that pass
SystemBarStyle.auto(...)
should attach the listener since that's what 99% of developers will use/want and others can set explicit colors as needed.