Skip to content

Give watches before Android 12 fixed Wear material colors - #281

Merged
trypsynth merged 1 commit into
masterfrom
watch-colors
Oct 26, 2026
Merged

trypsynth merged 1 commit into
masterfrom
watch-colors

Conversation

@trypsynth

Copy link
Copy Markdown
Owner

The a11y_wear_material_color_* colors point at @android:color/system_* dynamic colors, which only exist from Android 12 (API 31). The watch build supports API 30, Wear OS 3, and values-watch-v30/colors.xml applied them there too. The watch tutorial's list items use these colors, so on a Wear OS 3 watch they could fail to load. Lint reported this as 11 MissingDefaultResource and 9 NewApi errors on the watch, plus 9 NewApi errors on the phone for the shared file.

  • utils/src/main/res/values/colors.xml: close fixed colors from the existing Google palette, for example google_grey900 for system_neutral1_900.
  • utils/src/main/res/values-v31/colors.xml: the dynamic colors, unchanged, for Android 12 and later.
  • Removed talkback/src/wear/res/values-watch-v30/colors.xml. A -watch qualifier outranks -v31, so keeping it, even with fixed colors, would have hidden the dynamic colors on newer watches.
  • Removed the 29 baseline entries for these errors.

Watches on Android 12 and later get the same colors as before. :lintPhoneDebug, :lintWearDebug, assembleWearDebug and assemblePhoneDebug pass. Not tested on a Wear OS 3 watch.

The Wear material colors pointed at the system's dynamic colors, which only exist from Android 12,
and the watch's values-watch-v30 copy applied them on Wear OS 3 too, where the training list items
that use them could fail to load. The base colors are now close fixed colors, and values-v31 uses
the dynamic ones. Without the watch override, Android 12 and later watches still get the dynamic
colors, since a watch qualifier would outrank values-v31.
@trypsynth
trypsynth merged commit cc09126 into master Oct 26, 2026
2 checks passed
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.

1 participant