Skip to content

Add a custom color theme picker with a color wheel#482

Merged
LivingWithHippos merged 5 commits into
LivingWithHippos:masterfrom
ElCruncharino:feat/custom-color-theme
Jul 7, 2026
Merged

Add a custom color theme picker with a color wheel#482
LivingWithHippos merged 5 commits into
LivingWithHippos:masterfrom
ElCruncharino:feat/custom-color-theme

Conversation

@ElCruncharino

Copy link
Copy Markdown
Contributor

Lets the user pick any seed color from a color wheel instead of only choosing between the app's
9 fixed color themes, generating a full Material 3 palette from it the same way Material You
does from the wallpaper, via DynamicColorsOptions' content-based source. There is only one
custom slot: applying a new color overwrites whatever was picked before, matching how every
other theme choice already works. The existing 9 themes double as quick-select swatches that
seed the wheel with their primary color as a starting point, with a brightness slider alongside
for the one HSV component a 2D wheel can't represent.

Reworked the resume-triggered instant theme switch to compare more than just the saved style id:
the custom theme always keeps the same style id no matter which seed color is active, since the
color itself lives in a separate preference, so switching from one custom color to another while
staying on the custom theme was invisible to the existing mismatch check and never triggered the
switch on other open screens. The comparison now folds the active seed color into the signature
it tracks whenever the custom theme is the one applied.

This branch is stacked on #481 (Material You), which is itself stacked on #476 (instant theme
switch). The diff here will shrink to just this PR's changes once both merge.

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.
Lets the user pick any seed color from a color wheel instead of only
choosing between the app's 9 fixed color themes, generating a full
Material 3 palette from it the same way Material You does from the
wallpaper, via DynamicColorsOptions' content-based source. There is
only one custom slot: applying a new color overwrites whatever was
picked before, matching how every other theme choice already works.
The existing 9 themes double as quick-select swatches that seed the
wheel with their primary color as a starting point, with a brightness
slider alongside for the one HSV component a 2D wheel can't represent.

Reworked the resume-triggered instant theme switch to compare more
than just the saved style id: the custom theme always keeps the same
style id no matter which seed color is active, since the color itself
lives in a separate preference, so switching from one custom color to
another while staying on the custom theme was invisible to the
existing mismatch check and never triggered the switch to other open
screens. The comparison now folds the active seed color into the
signature it tracks whenever the custom theme is the one applied.
@LivingWithHippos

Copy link
Copy Markdown
Owner

Nice job, I tested with an older API 27, and everything worked while the custom theme was skipped. I was fixcing the duplicated function but you were faster ;D

@LivingWithHippos LivingWithHippos merged commit fc49009 into LivingWithHippos:master Jul 7, 2026
3 checks passed
@ElCruncharino ElCruncharino deleted the feat/custom-color-theme branch July 7, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants