Closed data-sync-user closed 4 years ago
➤ Sebastian Kaspari commented:
Can we dynamically change the Android theme of an app?
We can. But it always requires an activity restart to apply the configuration changes.
In WebView apps you do not want to restart because this would mean restoring/reloading the website. With GeckoView this seems to work fine. With the Session/View split we can recreate the activity and re-attach our previous session.
In Fennec we have all those
Themed*
classes: https://searchfox.org/mozilla-central/search?q=&path=Themed*.javaRocket is building something similar for "night mode": https://github.com/mozilla-tw/Rocket/tree/master/app/src/main/java/org/mozilla/rocket/nightmode/themed
Is there a better way? Can we dynamically change the Android theme of an app?
At the very least we could land the
Themed*
classes in a component - so that our other widgets can be based on them.┆Issue is synchronized with this Jira Task