Add Follow system theme mode#1363
Open
jacob-sinex wants to merge 1 commit into
Open
Conversation
Adds an optional "Follow system theme" setting that switches between a light and a dark theme automatically based on the device's dark-mode setting. Settings (Appearance): - When "Follow system theme" is enabled, separate "Light theme" and "Dark theme" selectors are shown; when disabled, a single "Theme" selector is shown. - The currently-active theme is carried across the toggle so it is not replaced by a stale value the user never chose: disabling adopts the active light/dark theme into the single Theme, and enabling routes the single Theme into its natural light or dark slot (themes are inherently one or the other). The selector rows update their shown selection immediately. Quick theme selector (options menu): - While following the system theme, it offers only the themes for the current mode (titled "Light theme"/"Dark theme") and writes to that mode's key, so every choice changes the theme currently on screen instead of silently doing nothing. Behaviour is unchanged when not following the system. Theme resolution (PrefsUtility): when following the system theme, the active theme is resolved from the light or dark selection according to the current uiMode night flag.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional "Follow system theme" setting that switches between a light and
a dark theme automatically, based on the device's dark-mode setting.
When enabled, separate "Light theme" and "Dark theme" selectors are shown (a
single "Theme" selector otherwise), and the active theme carries across the
toggle so it isn't replaced by a value the user never chose. The quick theme
selector in the options menu also becomes mode-aware while following the system,
offering only the current mode's themes so every choice changes what's on screen.
pmd, checkstyle, lint, test and assembleRelease all pass locally; tested on-device.
Closes #1241