Skip to content

fix: apply dynamic (Material You) colors to backgrounds, toggles, and status bar on API 31+#587

Open
mvanhorn wants to merge 1 commit into
TrianguloY:masterfrom
mvanhorn:fix/560-urlcheck-dynamic-colors
Open

fix: apply dynamic (Material You) colors to backgrounds, toggles, and status bar on API 31+#587
mvanhorn wants to merge 1 commit into
TrianguloY:masterfrom
mvanhorn:fix/560-urlcheck-dynamic-colors

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jul 8, 2026

Copy link
Copy Markdown

Summary

On Android 12+ with dynamic colors, backgrounds, switches, the status bar, and dialog surfaces now follow the wallpaper-derived palette instead of keeping stock colors. Text and icons already picked it up; this fills in the surfaces that did not.

Why this matters

You confirmed the report in #560 (One UI screenshots) and noted a special configuration for switches and backgrounds would probably be needed, with the constraint that no appcompat/Material dependency be added. This stays library-free: it wires the platform's own @android:color/system_accent1_* / system_neutral1_* resources (API 31+) into the existing Theme.DeviceDefault* styles through resource-qualifier overlays, which the OEM skins populate from the dynamic-color engine.

Changes

  • values-v31/styles.xml redefines the existing theme styles with explicit colorAccent, colorControlActivated, colorControlHighlight, colorBackground, windowBackground, and statusBarColor entries; the v29 items (windowLightStatusBar, navigationBarColor) are carried over so nothing regresses.
  • The DayNight style references alias colors defined in values-v31/colors.xml (day) and overridden in values-night-v31/colors.xml (night).
  • No Java changes and no new dependencies. AndroidSettings.setTheme already applies these style IDs; resource resolution picks the v31 variants on Android 12+, so behavior below API 31 is untouched.

Testing

Built and inspected resource resolution for the v31 qualifiers. Verified the style names and item sets mirror the base values/styles.xml definitions so pre-31 devices resolve exactly the resources they resolve today.

Fixes #560

@github-actions github-actions Bot added the Assets Changes some assets (set automatically) label Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This PR builds correctly, here is the generated apk.
This unsigned version can be installed alongside the original app and should only be used for testing the changes, not for daily usage.

Download testing apk

You must be logged in for the link to work.
The link will expire at 2026-07-22T07:07:44Z.


This is an automatic comment created by a Github Action based on a previous Github Action

@TrianguloY

Copy link
Copy Markdown
Owner

Thank you for the PR, much appreciated.

As I mentioned in the other one, I'm currently out-of-programming for a bit, so it may take time until I can properly review this (feel free to ping me in a month if needed).

This pr however only touches assets, so it may be faster (a bit concerned about the 88 lines to the style file though)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Assets Changes some assets (set automatically)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic colors are not applying to some parts of the app

2 participants