New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update app's theme when system theme is updated #3211
Conversation
Updated the base branch and the description, ready for review |
It seems like this should also be a theme setting - either a separate "match system" theme in the list or something that automatically switches to the black theme from whatever the selected theme is. Probably worth discussing with the rest of the team. |
Good idea, closing this in favor of trait_theme. A couple things that are missing - adjusting theme on launch and making the initial onboarding themeable. |
https://phabricator.wikimedia.org/T227123
traitCollectionDidChange(_:)
,updateViewConstraints()
,viewWillLayoutSubviews()
andviewDidLayoutSubviews()
- I chose to usetraitCollectionDidChange(_:)
*I don't update the theme right away, instead I broadcast our own
Theme.didChangeNotification
(we do the same thing when the theme change is initiated by the user in Settings or via Article reading controls) and VCs adjust their themesKnown issues:
adjustTheme
, after theguard
, to reproduce.traitCollectionDidChange
wasn't called). The same is not true for webViews - the theme gets fully applied only when the app becomes active again.