Repository navigation
Let people choose a light or dark theme, or follow the system - #238
Open
shanesmithdev wants to merge 1 commit into
Open
shanesmithdev wants to merge 1 commit into
shanesmithdev wants to merge 1 commit into
Conversation
Account has a new Theme section between Color and Timezone, with System, Light and Dark. System is the default, so nothing changes for anyone who never touches it. Choosing Light or Dark switches the whole app straight away, bars, sheets and keyboard included, and the app stays in that theme after it restarts. Choosing System makes it follow the phone again. It uses System::setAppearance() from NativePHP mobile 4.9.0. The choice belongs to the phone, not the account. It doesn't sync to the web, and signing in to another account keeps it.
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.
Sam Shupac (@samshupac) asked on /dev/null for a way to set the app to dark mode himself, rather than only following his iOS setting, and Simon said he was open to PRs.
This adds a Theme section to Account, between Color and Timezone, with System · Light · Dark. System is the default, so nothing changes for anyone who never touches it, and it doesn't force dark mode (the reason #2 was closed).
System::setAppearance(), which shipped in NativePHP mobile 4.9.0, so there are no dependency changes.Testing
ThisDeviceThemeTestcovers System by default with no native call, Light and Dark pinning the app and being remembered, System handing back to the phone, an unknown choice being ignored, the section's place on the screen, and the theme surviving sign-out.Screenshots
Account, dark mode
Overriding the device