summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chen Bai <chenbai@google.com> 2024-12-12 15:17:15 -0800
committer Chen Bai <chenbai@google.com> 2024-12-12 16:47:43 -0800
commit85efbd471fa30dcd95acaf9fbb7c83602a56da47 (patch)
tree08991d5f454015a714e7186589f5c0ce871232c2
parent41ef600b957a2e1625f51bec4f8b2c3aa76e24cb (diff)
m3: allow determinate option for watch ProgressBar widget
Historically, Widget.ProgressBar's most children don't allow determinate behavior. Phone uses *.ProgressBar.Horizontal as the way to enable determinate. For watch, the Progress Indicator(determinate ProgressBar) is a ring which is too far from being "Horizontal". So, instead of overriding the Widget.DeviceDefault.ProgressBar.Horizontal, we decide to enable determinate option for Widget.DeviceDefault.ProgressBar and pass in our own progress drawable as the default for such option. Since this style doesn't allow determinate in base res dir, our drawble won't override existing settings. Flag: EXEMPT. append instead of overriding existing res Test: manual Bug: 379994435 Change-Id: Ib7186acb2c33609d8351e3d5ac7feb8387d30275
-rw-r--r--core/res/res/values-watch/styles_device_defaults.xml7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/res/res/values-watch/styles_device_defaults.xml b/core/res/res/values-watch/styles_device_defaults.xml
index f3c85a96936f..d8d424ae15c6 100644
--- a/core/res/res/values-watch/styles_device_defaults.xml
+++ b/core/res/res/values-watch/styles_device_defaults.xml
@@ -85,4 +85,11 @@
<item name="maxHeight">@dimen/progress_bar_height</item>
<item name="mirrorForRtl">true</item>
</style>
+
+ <style name="Widget.DeviceDefault.ProgressBar" parent="Widget.Material.ProgressBar">
+ <!-- Allow determinate option -->
+ <item name="indeterminateOnly">false</item>
+ <!-- Use Wear Material3 ring shape as default determinate drawable -->
+ <item name="progressDrawable">@drawable/progress_ring_watch</item>
+ </style>
</resources>