Root Cause: The palette preview's text color inherits dynamic colors from the BC pattern, leading to insufficient contrast against some backgrounds. This wasn't a problem in the original design, as the BC pattern was introduced later.
Solution: Set the palette preview text color to textColorPrimary to ensure the text remains legible against a wider range of background colors.
Bug: 378775277
Flag: EXEMPT bugfix
Test: atest PaletteListPreferenceTest
Change-Id: I8efb9f9d916d618b450df169292202e499d8ac0d
Root cause: The orientation of the gradient drawable follows the view alignment. It should consider the text alignment.
Solution: Use getLayoutDirectionFromLocale# to get the text alignment to
set the correct orientation of the gradient drawable.
Bug: 278950655
Test: Manual test for RTL and LTR language
Change-Id: If94af75172ace137ac5168763f4cb47951f9e943
Add the corner radii in to be consistent with the Settings style.
Bug: 213440059
Test: manual test
Change-Id: I68edf243ae33e9bb1e39020ad7553451fad66477
Root Cause:
Using the listener to update the UI dynamically might have some time delay.
Solution:
Refactor to another implementation and avoid using the listener to update it.
Additional condition:
Add height restriction in preference to avoid the palette view to cover whole screen.
Bug: 148785841
Test: make RunSettingsRoboTests ROBOTEST_FILTER=PaletteListPreferenceTest
Change-Id: I6a854e16321b3426e2f8ff65c6404036d55caed4
Limit the preview measure for one time to avoid unnecessary
measure and draw performance.
Bug: 145968068
Test: make RunSettingsRoboTests ROBOTEST_FILTER=PaletteListViewTest
Test: make RunSettingsRoboTests2
Change-Id: Ib8ea13e511351c71babcbd1376817cea3a47cac4