Repository navigation
Give watches before Android 12 fixed Wear material colors - #281
Merged
Merged
Conversation
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.
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.
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, andvalues-watch-v30/colors.xmlapplied 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 examplegoogle_grey900forsystem_neutral1_900.utils/src/main/res/values-v31/colors.xml: the dynamic colors, unchanged, for Android 12 and later.talkback/src/wear/res/values-watch-v30/colors.xml. A-watchqualifier outranks-v31, so keeping it, even with fixed colors, would have hidden the dynamic colors on newer watches.Watches on Android 12 and later get the same colors as before.
:lintPhoneDebug,:lintWearDebug,assembleWearDebugandassemblePhoneDebugpass. Not tested on a Wear OS 3 watch.