Add Material You dynamic color and fix system bar icon contrast#481
Open
ElCruncharino wants to merge 2 commits into
Open
Add Material You dynamic color and fix system bar icon contrast#481ElCruncharino wants to merge 2 commits into
ElCruncharino wants to merge 2 commits into
Conversation
Picking a new theme now recreates the current activity right away. Since the app has two activities (MainActivity and SettingsActivity), ThemingCallback also checks on every activity resume whether the saved theme differs from what that activity was created with, and recreates it too, so MainActivity picks up the change as soon as you back out of Settings instead of needing a full app restart. Removes the now-inaccurate "restart to apply" summary and string.
…LivingWithHippos#315) Adds a wallpaper-based Material You option to the theme picker on Android 12+, using Material Components' own DynamicColors API, which overlays the device's wallpaper-derived palette on top of the app's existing Material 3 theme structure. Also fixes the actual bug reported in LivingWithHippos#315: status and navigation bar icon color was set once, statically, per day/night mode, assuming every theme gets darker at night. None of the 9 existing themes actually have night-specific colors, so the assumption doesn't hold, and the mismatch between the static assumption and each theme's real colors could make system icons invisible in either mode depending on which theme was active, not just the reporter's. Icon color is now computed from the actual applied colorPrimary/colorSurface luminance after each theme (static or dynamic) is applied, so it stays legible regardless of theme or day/night mode. While in there, rebuilt the theme picker itself as a bottom sheet instead of a plain alert dialog with a custom view. The old dialog's RecyclerView height didn't resolve reliably against the alert dialog's own ambiguous sizing, silently clipping the list short of whatever fit by coincidence, cutting off the last couple of themes together with Material You without any indication there was more below. Each theme row now also shows a check mark for the active one instead of a separate label that could overlap the list at larger font scales.
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 a wallpaper-based Material You option to the theme picker on Android 12+, using Material
Components' own DynamicColors API, which overlays the device's wallpaper-derived palette on top
of the app's existing Material 3 theme structure.
Also fixes the actual bug reported in #315: status and navigation bar icon color was set once,
statically, per day/night mode, assuming every theme gets darker at night. None of the 9
existing themes actually have night-specific colors, so the assumption doesn't hold, and the
mismatch between the static assumption and each theme's real colors could make system icons
invisible in either mode depending on which theme was active, not just the reporter's. Icon
color is now computed from the actual applied colorPrimary/colorSurface luminance after each
theme (static or dynamic) is applied, so it stays legible regardless of theme or day/night mode.
While in there, rebuilt the theme picker itself as a bottom sheet instead of a plain alert
dialog with a custom view. The old dialog's RecyclerView height didn't resolve reliably against
the alert dialog's own ambiguous sizing, silently clipping the list short of whatever fit by
coincidence, cutting off the last couple of themes together with Material You without any
indication there was more below. Each theme row now also shows a check mark for the active one
instead of a separate label that could overlap the list at larger font scales.
This branch is stacked on #476 (apply theme changes instantly), since the picker's instant
recreate-on-select behavior comes from there. Once #476 merges the diff here will shrink to just
this PR's changes.
Closes #315