diff options
| author | 2024-12-02 20:11:04 -0800 | |
|---|---|---|
| committer | 2024-12-10 10:15:15 -0800 | |
| commit | 3442efc042dab16de07d00976aebbefd509e407d (patch) | |
| tree | bfdd7d8da53c94a7f705b577eed4eb2a1a4a8d48 | |
| parent | dbe27bd837e12dc15a12a9e79fb2c9f4bfacccd1 (diff) | |
m3: move res out of *-watch-v36 dir
The trunk_staging sdk version is set to large dummy value, so it looks
like it always work no matter what sdk version the device is using. But
"next" is using the real sdk version value, so, the -v36 will be work on
"next" build. Currently "next" is still using v35, therefore, v36
resource won't be included in the image.
Since we isolate the Wear Material3 style and resources from the global
platform ones, we can use feature flags and Compat to control them.
This CL will move everything from *-watch-v36 dir to base dir, the ones
without qualifiers. See car's example:
frameworks/base/core/res/res/values/dimens_car.xml
Flag: EXEMPT. migrating files
Test: no boot crash
Bug: 381450700
Bug: 381152203
Change-Id: I6e4f19d075b1d42d77f3567e46883ee67f27411e
| -rw-r--r-- | core/res/res/color/btn_material_filled_background_color_watch.xml (renamed from core/res/res/color-watch-v36/btn_material_filled_background_color.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/color/btn_material_filled_content_color_watch.xml (renamed from core/res/res/color-watch-v36/btn_material_filled_content_color.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/color/btn_material_filled_tonal_background_color_watch.xml (renamed from core/res/res/color-watch-v36/btn_material_filled_tonal_background_color.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/color/btn_material_filled_tonal_content_color_watch.xml (renamed from core/res/res/color-watch-v36/btn_material_filled_tonal_content_color.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/color/btn_material_outlined_background_color_watch.xml (renamed from core/res/res/color-watch-v36/btn_material_outlined_background_color.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/drawable/btn_background_material_filled_tonal_watch.xml (renamed from core/res/res/drawable-watch-v36/btn_background_material_filled_tonal.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/drawable/btn_background_material_filled_watch.xml (renamed from core/res/res/drawable-watch-v36/btn_background_material_filled.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/drawable/btn_background_material_outlined_watch.xml (renamed from core/res/res/drawable-watch-v36/btn_background_material_outlined.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/drawable/btn_background_material_text_watch.xml (renamed from core/res/res/drawable-watch-v36/btn_background_material_text.xml) | 0 | ||||
| -rw-r--r-- | core/res/res/drawable/dialog_alert_button_background_negative_watch.xml (renamed from core/res/res/drawable-watch-v36/dialog_alert_button_background_negative.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/drawable/dialog_alert_button_background_positive_watch.xml (renamed from core/res/res/drawable-watch-v36/dialog_alert_button_background_positive.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/drawable/dialog_alert_button_negative_watch.xml (renamed from core/res/res/drawable-watch-v36/dialog_alert_button_negative.xml) | 4 | ||||
| -rw-r--r-- | core/res/res/drawable/dialog_alert_button_positive_watch.xml (renamed from core/res/res/drawable-watch-v36/dialog_alert_button_positive.xml) | 4 | ||||
| -rw-r--r-- | core/res/res/drawable/ic_check_watch.xml (renamed from core/res/res/drawable-watch-v36/ic_check.xml) | 4 | ||||
| -rw-r--r-- | core/res/res/drawable/ic_close_watch.xml (renamed from core/res/res/drawable-watch-v36/ic_close.xml) | 4 | ||||
| -rw-r--r-- | core/res/res/drawable/progress_ring_watch.xml (renamed from core/res/res/drawable-watch-v36/progress_ring_wear_material3.xml) | 0 | ||||
| -rw-r--r-- | core/res/res/layout/alert_dialog_icon_button_watch.xml (renamed from core/res/res/layout-watch-v36/alert_dialog_icon_button_wear_material3.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/layout/alert_dialog_watch.xml (renamed from core/res/res/layout-watch-v36/alert_dialog_wear_material3.xml) | 0 | ||||
| -rw-r--r-- | core/res/res/values-watch-v36/colors.xml | 18 | ||||
| -rw-r--r-- | core/res/res/values-watch-v36/styles_material.xml | 105 | ||||
| -rw-r--r-- | core/res/res/values-watch/styles_device_default.xml | 40 | ||||
| -rw-r--r-- | core/res/res/values-watch/styles_device_defaults.xml | 88 | ||||
| -rw-r--r-- | core/res/res/values/config_watch.xml (renamed from core/res/res/values-watch-v36/config.xml) | 2 | ||||
| -rw-r--r-- | core/res/res/values/dimens_watch.xml (renamed from core/res/res/values-watch-v36/dimens_material.xml) | 18 | ||||
| -rw-r--r-- | core/res/res/values/styles_device_defaults.xml | 6 | ||||
| -rw-r--r-- | core/res/res/values/styles_watch.xml | 52 |
26 files changed, 181 insertions, 186 deletions
diff --git a/core/res/res/color-watch-v36/btn_material_filled_background_color.xml b/core/res/res/color/btn_material_filled_background_color_watch.xml index 39b5b10a774d..78547bc52f00 100644 --- a/core/res/res/color-watch-v36/btn_material_filled_background_color.xml +++ b/core/res/res/color/btn_material_filled_background_color_watch.xml @@ -16,7 +16,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" - android:alpha="?attr/disabledAlpha" + android:alpha="@dimen/disabled_alpha_wear_material3" android:color="@color/materialColorOnSurface" /> <item android:color="@color/materialColorPrimary" /> </selector>
\ No newline at end of file diff --git a/core/res/res/color-watch-v36/btn_material_filled_content_color.xml b/core/res/res/color/btn_material_filled_content_color_watch.xml index a70586b08bab..3a4ec3cff935 100644 --- a/core/res/res/color-watch-v36/btn_material_filled_content_color.xml +++ b/core/res/res/color/btn_material_filled_content_color_watch.xml @@ -16,7 +16,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" - android:alpha="?attr/primaryContentAlpha" + android:alpha="@dimen/primary_content_alpha_wear_material3" android:color="@color/materialColorOnSurface" /> <item android:color="@color/materialColorOnPrimary" /> </selector>
\ No newline at end of file diff --git a/core/res/res/color-watch-v36/btn_material_filled_tonal_background_color.xml b/core/res/res/color/btn_material_filled_tonal_background_color_watch.xml index e2e274efb2b1..e9b7e4c286bd 100644 --- a/core/res/res/color-watch-v36/btn_material_filled_tonal_background_color.xml +++ b/core/res/res/color/btn_material_filled_tonal_background_color_watch.xml @@ -16,7 +16,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" - android:alpha="?attr/disabledAlpha" + android:alpha="@dimen/disabled_alpha_wear_material3" android:color="@color/materialColorOnSurface" /> <item android:color="@color/materialColorSurfaceContainer" /> </selector>
\ No newline at end of file diff --git a/core/res/res/color-watch-v36/btn_material_filled_tonal_content_color.xml b/core/res/res/color/btn_material_filled_tonal_content_color_watch.xml index 32de68868d53..8b5deda05745 100644 --- a/core/res/res/color-watch-v36/btn_material_filled_tonal_content_color.xml +++ b/core/res/res/color/btn_material_filled_tonal_content_color_watch.xml @@ -16,7 +16,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" - android:alpha="?attr/primaryContentAlpha" + android:alpha="@dimen/primary_content_alpha_wear_material3" android:color="@color/materialColorOnSurface" /> <item android:color="@color/materialColorOnSurface" /> </selector>
\ No newline at end of file diff --git a/core/res/res/color-watch-v36/btn_material_outlined_background_color.xml b/core/res/res/color/btn_material_outlined_background_color_watch.xml index 3f43ca7b91df..f9c9a3f82341 100644 --- a/core/res/res/color-watch-v36/btn_material_outlined_background_color.xml +++ b/core/res/res/color/btn_material_outlined_background_color_watch.xml @@ -16,7 +16,7 @@ <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" - android:alpha="?attr/disabledAlpha" + android:alpha="@dimen/disabled_alpha_wear_material3" android:color="@color/materialColorOnSurface" /> <item android:color="@color/materialColorOutline" /> </selector> diff --git a/core/res/res/drawable-watch-v36/btn_background_material_filled_tonal.xml b/core/res/res/drawable/btn_background_material_filled_tonal_watch.xml index fbd697371329..69c467b19fa0 100644 --- a/core/res/res/drawable-watch-v36/btn_background_material_filled_tonal.xml +++ b/core/res/res/drawable/btn_background_material_filled_tonal_watch.xml @@ -18,7 +18,7 @@ android:color="?attr/colorControlHighlight"> <item> <shape android:shape="rectangle"> - <solid android:color="@color/btn_material_filled_tonal_background_color"/> + <solid android:color="@color/btn_material_filled_tonal_background_color_watch"/> <corners android:radius="@dimen/config_wearMaterial3_buttonCornerRadius"/> <size android:width="@dimen/btn_material_width" diff --git a/core/res/res/drawable-watch-v36/btn_background_material_filled.xml b/core/res/res/drawable/btn_background_material_filled_watch.xml index 6e74f64fea60..76ba84724f0b 100644 --- a/core/res/res/drawable-watch-v36/btn_background_material_filled.xml +++ b/core/res/res/drawable/btn_background_material_filled_watch.xml @@ -18,7 +18,7 @@ android:color="?attr/colorControlHighlight"> <item> <shape android:shape="rectangle"> - <solid android:color="@color/btn_material_filled_background_color"/> + <solid android:color="@color/btn_material_filled_background_color_watch"/> <corners android:radius="@dimen/config_wearMaterial3_buttonCornerRadius"/> <size android:width="@dimen/btn_material_width" diff --git a/core/res/res/drawable-watch-v36/btn_background_material_outlined.xml b/core/res/res/drawable/btn_background_material_outlined_watch.xml index 7bc40604dc25..16190aa0279f 100644 --- a/core/res/res/drawable-watch-v36/btn_background_material_outlined.xml +++ b/core/res/res/drawable/btn_background_material_outlined_watch.xml @@ -30,7 +30,7 @@ <corners android:radius="@dimen/config_wearMaterial3_buttonCornerRadius"/> <stroke android:width="1dp" - android:color="@color/btn_material_outlined_background_color" /> + android:color="@color/btn_material_outlined_background_color_watch" /> <size android:width="@dimen/btn_material_width" android:height="@dimen/btn_material_height" /> diff --git a/core/res/res/drawable-watch-v36/btn_background_material_text.xml b/core/res/res/drawable/btn_background_material_text_watch.xml index 145685c8095c..145685c8095c 100644 --- a/core/res/res/drawable-watch-v36/btn_background_material_text.xml +++ b/core/res/res/drawable/btn_background_material_text_watch.xml diff --git a/core/res/res/drawable-watch-v36/dialog_alert_button_background_negative.xml b/core/res/res/drawable/dialog_alert_button_background_negative_watch.xml index 0314bbec2b55..495fa4aabe3a 100644 --- a/core/res/res/drawable-watch-v36/dialog_alert_button_background_negative.xml +++ b/core/res/res/drawable/dialog_alert_button_background_negative_watch.xml @@ -17,7 +17,7 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> - <solid android:color="@color/btn_material_filled_tonal_background_color"/> + <solid android:color="@color/btn_material_filled_tonal_background_color_watch"/> <corners android:radius="@dimen/config_wearMaterial3_bottomDialogCornerRadius" /> <size android:width="@dimen/dialog_btn_negative_width" diff --git a/core/res/res/drawable-watch-v36/dialog_alert_button_background_positive.xml b/core/res/res/drawable/dialog_alert_button_background_positive_watch.xml index 92262fb6d89d..20a4c0b6db90 100644 --- a/core/res/res/drawable-watch-v36/dialog_alert_button_background_positive.xml +++ b/core/res/res/drawable/dialog_alert_button_background_positive_watch.xml @@ -21,7 +21,7 @@ android:pivotX="50%" android:pivotY="50%"> <shape android:shape="rectangle"> - <solid android:color="@color/btn_material_filled_background_color"/> + <solid android:color="@color/btn_material_filled_background_color_watch"/> <corners android:radius="200dp" /> <size android:width="63dp" diff --git a/core/res/res/drawable-watch-v36/dialog_alert_button_negative.xml b/core/res/res/drawable/dialog_alert_button_negative_watch.xml index c155ba1ba077..1776962dbfaf 100644 --- a/core/res/res/drawable-watch-v36/dialog_alert_button_negative.xml +++ b/core/res/res/drawable/dialog_alert_button_negative_watch.xml @@ -15,8 +15,8 @@ --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:drawable="@drawable/dialog_alert_button_background_negative"/> + <item android:drawable="@drawable/dialog_alert_button_background_negative_watch"/> <item - android:drawable="@drawable/ic_close" + android:drawable="@drawable/ic_close_watch" android:gravity="center" /> </layer-list>
\ No newline at end of file diff --git a/core/res/res/drawable-watch-v36/dialog_alert_button_positive.xml b/core/res/res/drawable/dialog_alert_button_positive_watch.xml index 01ab0734d8e8..ab08e2a1d67d 100644 --- a/core/res/res/drawable-watch-v36/dialog_alert_button_positive.xml +++ b/core/res/res/drawable/dialog_alert_button_positive_watch.xml @@ -15,8 +15,8 @@ --> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> - <item android:drawable="@drawable/dialog_alert_button_background_positive"/> + <item android:drawable="@drawable/dialog_alert_button_background_positive_watch"/> <item - android:drawable="@drawable/ic_check" + android:drawable="@drawable/ic_check_watch" android:gravity="center" /> </layer-list>
\ No newline at end of file diff --git a/core/res/res/drawable-watch-v36/ic_check.xml b/core/res/res/drawable/ic_check_watch.xml index 7b01e64ffdd3..2fc161fbbdb6 100644 --- a/core/res/res/drawable-watch-v36/ic_check.xml +++ b/core/res/res/drawable/ic_check_watch.xml @@ -19,7 +19,7 @@ android:height="28dp" android:viewportWidth="960" android:viewportHeight="960" - android:tint="@color/btn_material_filled_content_color"> - <path android:fillColor="@color/btn_material_filled_content_color" + android:tint="@color/btn_material_filled_content_color_watch"> + <path android:fillColor="@color/btn_material_filled_content_color_watch" android:pathData="M382,597.87L716.7,263.17Q730.37,249.5 748.76,249.5Q767.15,249.5 780.83,263.17Q794.5,276.85 794.5,295.62Q794.5,314.39 780.83,328.07L414.07,695.59Q400.39,709.26 382,709.26Q363.61,709.26 349.93,695.59L178.41,524.07Q164.74,510.39 165.12,491.62Q165.5,472.85 179.17,459.17Q192.85,445.5 211.62,445.5Q230.39,445.5 244.07,459.17L382,597.87Z"/> </vector> diff --git a/core/res/res/drawable-watch-v36/ic_close.xml b/core/res/res/drawable/ic_close_watch.xml index 1f3da367ac3f..55e721337f14 100644 --- a/core/res/res/drawable-watch-v36/ic_close.xml +++ b/core/res/res/drawable/ic_close_watch.xml @@ -19,7 +19,7 @@ android:height="28dp" android:viewportWidth="960" android:viewportHeight="960" - android:tint="@color/btn_material_filled_tonal_content_color"> - <path android:fillColor="@color/btn_material_filled_tonal_content_color" + android:tint="@color/btn_material_filled_tonal_content_color_watch"> + <path android:fillColor="@color/btn_material_filled_tonal_content_color_watch" android:pathData="M480,543.65L287.83,735.83Q275.15,748.5 256,748.5Q236.85,748.5 224.17,735.83Q211.5,723.15 211.5,704Q211.5,684.85 224.17,672.17L416.35,480L224.17,287.83Q211.5,275.15 211.5,256Q211.5,236.85 224.17,224.17Q236.85,211.5 256,211.5Q275.15,211.5 287.83,224.17L480,416.35L672.17,224.17Q684.85,211.5 704,211.5Q723.15,211.5 735.83,224.17Q748.5,236.85 748.5,256Q748.5,275.15 735.83,287.83L543.65,480L735.83,672.17Q748.5,684.85 748.5,704Q748.5,723.15 735.83,735.83Q723.15,748.5 704,748.5Q684.85,748.5 672.17,735.83L480,543.65Z"/> </vector> diff --git a/core/res/res/drawable-watch-v36/progress_ring_wear_material3.xml b/core/res/res/drawable/progress_ring_watch.xml index 8250ee600a8f..8250ee600a8f 100644 --- a/core/res/res/drawable-watch-v36/progress_ring_wear_material3.xml +++ b/core/res/res/drawable/progress_ring_watch.xml diff --git a/core/res/res/layout-watch-v36/alert_dialog_icon_button_wear_material3.xml b/core/res/res/layout/alert_dialog_icon_button_watch.xml index 407ec7a42740..e5bc86c7bc6c 100644 --- a/core/res/res/layout-watch-v36/alert_dialog_icon_button_wear_material3.xml +++ b/core/res/res/layout/alert_dialog_icon_button_watch.xml @@ -114,7 +114,7 @@ <ImageView android:layout_width="match_parent" android:layout_height="match_parent" - android:src="@drawable/dialog_alert_button_positive"/> + android:src="@drawable/dialog_alert_button_positive_watch"/> </FrameLayout> </LinearLayout> </FrameLayout> diff --git a/core/res/res/layout-watch-v36/alert_dialog_wear_material3.xml b/core/res/res/layout/alert_dialog_watch.xml index 8f7545690142..8f7545690142 100644 --- a/core/res/res/layout-watch-v36/alert_dialog_wear_material3.xml +++ b/core/res/res/layout/alert_dialog_watch.xml diff --git a/core/res/res/values-watch-v36/colors.xml b/core/res/res/values-watch-v36/colors.xml deleted file mode 100644 index 4bc2a66fa206..000000000000 --- a/core/res/res/values-watch-v36/colors.xml +++ /dev/null @@ -1,18 +0,0 @@ -<!-- - ~ Copyright (C) 2024 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> -<!-- TODO(b/372524566): update color token's value to match material3 design. --> -<resources> -</resources>
\ No newline at end of file diff --git a/core/res/res/values-watch-v36/styles_material.xml b/core/res/res/values-watch-v36/styles_material.xml deleted file mode 100644 index 6e5ef68a70c3..000000000000 --- a/core/res/res/values-watch-v36/styles_material.xml +++ /dev/null @@ -1,105 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- - ~ Copyright (C) 2024 The Android Open Source Project - ~ - ~ Licensed under the Apache License, Version 2.0 (the "License"); - ~ you may not use this file except in compliance with the License. - ~ You may obtain a copy of the License at - ~ - ~ http://www.apache.org/licenses/LICENSE-2.0 - ~ - ~ Unless required by applicable law or agreed to in writing, software - ~ distributed under the License is distributed on an "AS IS" BASIS, - ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - ~ See the License for the specific language governing permissions and - ~ limitations under the License. - --> - -<resources> - <!-- Button Styles --> - <!-- Material Button - Filled (primary colored) --> - <style name="Widget.DeviceDefault.Button.Filled" parent="Widget.DeviceDefault.Button.WearMaterial3"> - <item name="android:background">@drawable/btn_background_material_filled</item> - <item name="textAppearance">@style/TextAppearance.Widget.Button.Material.Filled</item> - </style> - - <!-- Material Button - Filled Tonal (Override system default button styles) --> - <style name="Widget.DeviceDefault.Button.WearMaterial3"> - <item name="background">@drawable/btn_background_material_filled_tonal</item> - <item name="textAppearance">@style/TextAppearance.Widget.Button.Material</item> - <item name="minHeight">@dimen/btn_material_height</item> - <item name="maxWidth">@dimen/btn_material_width</item> - <item name="android:paddingStart">@dimen/btn_horizontal_edge_padding</item> - <item name="android:paddingEnd">@dimen/btn_horizontal_edge_padding</item> - <item name="android:drawablePadding">@dimen/btn_drawable_padding</item> - <item name="android:maxLines">2</item> - <item name="android:ellipsize">end</item> - <item name="android:breakStrategy">simple</item> - <item name="stateListAnimator">@anim/button_state_list_anim_material</item> - <item name="focusable">true</item> - <item name="clickable">true</item> - <item name="gravity">center_vertical</item> - </style> - - <!-- Material Button - Outlined --> - <style name="Widget.DeviceDefault.Button.Outlined" parent="Widget.DeviceDefault.Button.WearMaterial3"> - <item name="android:background">@drawable/btn_background_material_outlined</item> - </style> - - <!-- Material Button - Text --> - <style name="Widget.DeviceDefault.Button.Text" parent="Widget.DeviceDefault.Button.WearMaterial3"> - <item name="android:background">@drawable/btn_background_material_text</item> - </style> - - <!-- Text Styles --> - <!-- TextAppearance for Material Button - Filled --> - <style name="TextAppearance.Widget.Button.Material.Filled"> - <item name="textColor">@color/btn_material_filled_content_color</item> - </style> - - <!-- TextAppearance for Material Button - Filled Tonal --> - <style name="TextAppearance.Widget.Button.Material" parent="TextAppearance.DeviceDefault"> - <item name="android:fontFamily">font-family-flex-device-default</item> - <item name="android:fontVariationSettings">"'wdth' 90, 'wght' 500, 'ROND' 100, 'opsz' 15, 'GRAD' 0"</item> - <item name="textSize">@dimen/btn_textSize</item> - <item name="textColor">@color/btn_material_filled_tonal_content_color</item> - <item name="lineHeight">@dimen/btn_lineHeight</item> - </style> - - <!-- AlertDialog Styles --> - <style name="AlertDialog.DeviceDefault.WearMaterial3"> - <item name="layout">@layout/alert_dialog_wear_material3</item> - </style> - - <style name="Widget.DeviceDefault.Button.ButtonBar.AlertDialog.WearMaterial3" parent="Widget.DeviceDefault.Button"> - <item name="android:textSize">0sp</item> - <item name="android:gravity">center</item> - <item name="android:paddingStart">0dp</item> - <item name="android:paddingEnd">0dp</item> - <item name="android:drawablePadding">0dp</item> - </style> - - <style name="Widget.DeviceDefault.Button.ButtonBar.AlertDialog.WearMaterial3.Confirm"> - <!-- Use a ImageView as background --> - <item name="background">@android:color/transparent</item> - <item name="minWidth">@dimen/dialog_btn_confirm_width</item> - <item name="minHeight">@dimen/dialog_btn_confirm_height</item> - </style> - - <style name="Widget.DeviceDefault.Button.ButtonBar.AlertDialog.WearMaterial3.Negative"> - <item name="background">@drawable/dialog_alert_button_negative</item> - <item name="minWidth">@dimen/dialog_btn_negative_width</item> - <item name="minHeight">@dimen/dialog_btn_negative_height</item> - <item name="maxWidth">@dimen/dialog_btn_negative_width</item> - <item name="maxHeight">@dimen/dialog_btn_negative_height</item> - </style> - - <!-- Wear Material3 Progress Bar style: progressed ring.--> - <style name="Widget.DeviceDefault.ProgressBar.WearMaterial3"> - <item name="indeterminateOnly">false</item> - <item name="progressDrawable">@drawable/progress_ring_wear_material3</item> - <item name="minHeight">@dimen/progress_bar_height</item> - <item name="maxHeight">@dimen/progress_bar_height</item> - <item name="mirrorForRtl">true</item> - </style> -</resources>
\ No newline at end of file diff --git a/core/res/res/values-watch/styles_device_default.xml b/core/res/res/values-watch/styles_device_default.xml deleted file mode 100644 index 8a2ce5da5985..000000000000 --- a/core/res/res/values-watch/styles_device_default.xml +++ /dev/null @@ -1,40 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2021 The Android Open Source Project - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. ---> - -<resources> - <style name="DialogWindowTitle.DeviceDefault" parent="DialogWindowTitle.Material"> - <item name="maxLines">2</item> - <item name="shadowRadius">0</item> - <item name="ellipsize">end</item> - <item name="textAppearance">@style/TextAppearance.DeviceDefault.Title</item> - </style> - <style name="TextAppearance.DeviceDefault.Body1" parent="TextAppearance.Material.Body1"> - <item name="android:textSize">15sp</item> - <item name="android:fontFamily">sans-serif</item> - </style> - <style name="TextAppearance.DeviceDefault.Title" parent="TextAppearance.Material.Title"> - <item name="android:textSize">16sp</item> - <item name="android:fontFamily">google-sans</item> - <item name="android:textStyle">bold</item> - </style> - <style name="TextAppearance.DeviceDefault.Subhead" parent="TextAppearance.Material.Subhead"> - <item name="android:textSize">16sp</item> - <item name="android:fontFamily">google-sans-medium</item> - </style> - <style name="BaseErrorDialog.DeviceDefault" parent="AlertDialog.DeviceDefault"> - <item name="layout">@layout/watch_base_error_dialog</item> - </style> -</resources> diff --git a/core/res/res/values-watch/styles_device_defaults.xml b/core/res/res/values-watch/styles_device_defaults.xml new file mode 100644 index 000000000000..f3c85a96936f --- /dev/null +++ b/core/res/res/values-watch/styles_device_defaults.xml @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Copyright (C) 2021 The Android Open Source Project + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<resources> + <style name="DialogWindowTitle.DeviceDefault" parent="DialogWindowTitle.Material"> + <item name="maxLines">2</item> + <item name="shadowRadius">0</item> + <item name="ellipsize">end</item> + <item name="textAppearance">@style/TextAppearance.DeviceDefault.Title</item> + </style> + <style name="TextAppearance.DeviceDefault.Body1" parent="TextAppearance.Material.Body1"> + <item name="android:textSize">15sp</item> + <item name="android:fontFamily">sans-serif</item> + </style> + <style name="TextAppearance.DeviceDefault.Title" parent="TextAppearance.Material.Title"> + <item name="android:textSize">16sp</item> + <item name="android:fontFamily">google-sans</item> + <item name="android:textStyle">bold</item> + </style> + <style name="TextAppearance.DeviceDefault.Subhead" parent="TextAppearance.Material.Subhead"> + <item name="android:textSize">16sp</item> + <item name="android:fontFamily">google-sans-medium</item> + </style> + <style name="BaseErrorDialog.DeviceDefault" parent="AlertDialog.DeviceDefault"> + <item name="layout">@layout/watch_base_error_dialog</item> + </style> + + <!-- Button Styles --> + <!-- Material Button - Filled (primary colored) --> + <style name="Widget.DeviceDefault.Button.Filled" parent="Widget.DeviceDefault.Button.WearMaterial3"> + <item name="android:background">@drawable/btn_background_material_filled_watch</item> + <item name="textAppearance">@style/TextAppearance.Widget.Button.Material.Filled</item> + </style> + + <!-- Material Button - Filled Tonal (Override system default button styles) --> + <style name="Widget.DeviceDefault.Button.WearMaterial3"> + <item name="background">@drawable/btn_background_material_filled_tonal_watch</item> + <item name="textAppearance">@style/TextAppearance.Widget.Button.Material</item> + <item name="minHeight">@dimen/btn_material_height</item> + <item name="maxWidth">@dimen/btn_material_width</item> + <item name="android:paddingStart">@dimen/btn_horizontal_edge_padding</item> + <item name="android:paddingEnd">@dimen/btn_horizontal_edge_padding</item> + <item name="android:drawablePadding">@dimen/btn_drawable_padding</item> + <item name="android:maxLines">2</item> + <item name="android:ellipsize">end</item> + <item name="android:breakStrategy">simple</item> + <item name="stateListAnimator">@anim/button_state_list_anim_material</item> + <item name="focusable">true</item> + <item name="clickable">true</item> + <item name="gravity">center_vertical</item> + </style> + + <!-- Wear Material3 Button - Outlined --> + <style name="Widget.DeviceDefault.Button.Outlined" parent="Widget.DeviceDefault.Button.WearMaterial3"> + <item name="android:background">@drawable/btn_background_material_outlined_watch</item> + </style> + + <!-- Wear Material3 Button - Text --> + <style name="Widget.DeviceDefault.Button.Text" parent="Widget.DeviceDefault.Button.WearMaterial3"> + <item name="android:background">@drawable/btn_background_material_text_watch</item> + </style> + + <!-- Wear Material3 AlertDialog Styles --> + <style name="AlertDialog.DeviceDefault.WearMaterial3"> + <item name="layout">@layout/alert_dialog_watch</item> + </style> + + <!-- Wear Material3 Progress Bar style: progressed ring.--> + <style name="Widget.DeviceDefault.ProgressBar.WearMaterial3"> + <item name="indeterminateOnly">false</item> + <item name="progressDrawable">@drawable/progress_ring_watch</item> + <item name="minHeight">@dimen/progress_bar_height</item> + <item name="maxHeight">@dimen/progress_bar_height</item> + <item name="mirrorForRtl">true</item> + </style> +</resources> diff --git a/core/res/res/values-watch-v36/config.xml b/core/res/res/values/config_watch.xml index 679dc709ec35..629a343f1280 100644 --- a/core/res/res/values-watch-v36/config.xml +++ b/core/res/res/values/config_watch.xml @@ -15,6 +15,8 @@ --> <resources> + <!-- TODO(b/382103556): use predefined Material3 token --> + <!-- For Wear Material3 --> <dimen name="config_wearMaterial3_buttonCornerRadius">26dp</dimen> <dimen name="config_wearMaterial3_bottomDialogCornerRadius">18dp</dimen> </resources> diff --git a/core/res/res/values-watch-v36/dimens_material.xml b/core/res/res/values/dimens_watch.xml index 7232786d92c9..6612c218be41 100644 --- a/core/res/res/values-watch-v36/dimens_material.xml +++ b/core/res/res/values/dimens_watch.xml @@ -13,8 +13,9 @@ ~ See the License for the specific language governing permissions and ~ limitations under the License. --> + <resources> - <!-- values for material3 button --> + <!-- values for wear material3 button --> <dimen name="btn_material_width">172dp</dimen> <dimen name="btn_material_height">52dp</dimen> <dimen name="btn_horizontal_edge_padding">14dp</dimen> @@ -22,18 +23,27 @@ <dimen name="btn_lineHeight">18sp</dimen> <dimen name="btn_textSize">15sp</dimen> - <!-- values for material3 AlertDialog --> + <!-- values for wear material3 AlertDialog --> <dimen name="dialog_btn_negative_width">60dp</dimen> <dimen name="dialog_btn_negative_height">60dp</dimen> <dimen name="dialog_btn_confirm_width">62dp</dimen> <dimen name="dialog_btn_confirm_height">60dp</dimen> - <!-- Opacity factor for disabled material3 widget --> + <!-- Opacity factor for disabled wear material3 widget --> + <!-- Alpha transparency for widgets that set enablement/disablement programmatically + transparency is applied in the disabled state --> <dimen name="disabled_alpha_device_default">0.12</dimen> + <!-- Alpha transparency applied to elements which are considered primary (e.g. primary text) --> <dimen name="primary_content_alpha_device_default">0.38</dimen> - <!-- values for material3 progress bar(progress indicator) --> + <!-- values for wear material3 progress bar(progress indicator) --> <item name="progressbar_inner_radius_ratio" format="float" type="dimen">2.12</item> <dimen name="progressbar_thickness">8dp</dimen> <dimen name="progressbar_elevation">0.1dp</dimen> + + <!-- Alpha transparency for wigets that set enablement/disablement programmatically + transparency is applied in the disabled state --> + <dimen name="disabled_alpha_wear_material3">0.12</dimen> + <!-- Alpha transparency applied to elements which are considered primary (e.g. primary text) --> + <dimen name="primary_content_alpha_wear_material3">0.38</dimen> </resources> diff --git a/core/res/res/values/styles_device_defaults.xml b/core/res/res/values/styles_device_defaults.xml index acc1ff8fb9db..326afba51fb2 100644 --- a/core/res/res/values/styles_device_defaults.xml +++ b/core/res/res/values/styles_device_defaults.xml @@ -44,6 +44,10 @@ easier. <item name="textColor">@color/btn_colored_text_material</item> </style> <style name="Widget.DeviceDefault.Button.WearMaterial3"/> + <style name="Widget.DeviceDefault.Button.WearMaterial3.Filled"/> + <style name="Widget.DeviceDefault.Button.WearMaterial3.FilledTonal"/> + <style name="Widget.DeviceDefault.Button.WearMaterial3.Outlined"/> + <style name="Widget.DeviceDefault.Button.WearMaterial3.Text"/> <style name="Widget.DeviceDefault.TextView" parent="Widget.Material.TextView" /> <style name="Widget.DeviceDefault.CheckedTextView" parent="Widget.Material.CheckedTextView"/> <style name="Widget.DeviceDefault.AutoCompleteTextView" parent="Widget.Material.AutoCompleteTextView"/> @@ -60,6 +64,7 @@ easier. <style name="Widget.DeviceDefault.ProgressBar.Small" parent="Widget.Material.ProgressBar.Small"/> <style name="Widget.DeviceDefault.ProgressBar.Small.Title" parent="Widget.Material.ProgressBar.Small.Title"/> <style name="Widget.DeviceDefault.ProgressBar.Large" parent="Widget.Material.ProgressBar.Large"/> + <style name="Widget.DeviceDefault.ProgressBar.WearMaterial3"/> <style name="Widget.DeviceDefault.SeekBar" parent="Widget.Material.SeekBar"/> <style name="Widget.DeviceDefault.RatingBar" parent="Widget.Material.RatingBar"/> <style name="Widget.DeviceDefault.RatingBar.Indicator" parent="Widget.Material.RatingBar.Indicator"/> @@ -430,6 +435,7 @@ easier. <!-- AlertDialog Styles --> <style name="AlertDialog.DeviceDefault" parent="AlertDialog.Material"/> <style name="AlertDialog.DeviceDefault.Light" parent="AlertDialog.Material.Light"/> + <style name="AlertDialog.DeviceDefault.WearMaterial3"/> <!-- Animation Styles --> <style name="Animation.DeviceDefault.Activity" parent="Animation.Material.Activity"/> diff --git a/core/res/res/values/styles_watch.xml b/core/res/res/values/styles_watch.xml new file mode 100644 index 000000000000..713ea98907ca --- /dev/null +++ b/core/res/res/values/styles_watch.xml @@ -0,0 +1,52 @@ +<!-- + ~ Copyright (C) 2024 The Android Open Source Project + ~ + ~ Licensed under the Apache License, Version 2.0 (the "License"); + ~ you may not use this file except in compliance with the License. + ~ You may obtain a copy of the License at + ~ + ~ http://www.apache.org/licenses/LICENSE-2.0 + ~ + ~ Unless required by applicable law or agreed to in writing, software + ~ distributed under the License is distributed on an "AS IS" BASIS, + ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + ~ See the License for the specific language governing permissions and + ~ limitations under the License. + --> + +<resources> + <!-- TextAppearance for Wear Material3 Button - Filled --> + <style name="TextAppearance.Widget.Button.Material.Filled"> + <item name="textColor">@color/btn_material_filled_content_color_watch</item> + </style> + + <!-- TextAppearance for Wear Material3 Button - Filled Tonal --> + <style name="TextAppearance.Widget.Button.Material" parent="TextAppearance.DeviceDefault"> + <item name="android:fontFamily">font-family-flex-device-default</item> + <item name="android:fontVariationSettings">"'wdth' 90, 'wght' 500, 'ROND' 100, 'opsz' 15, 'GRAD' 0"</item> + <item name="textSize">@dimen/btn_textSize</item> + <item name="textColor">@color/btn_material_filled_tonal_content_color_watch</item> + <item name="lineHeight">@dimen/btn_lineHeight</item> + </style> + + <style name="Widget.DeviceDefault.Button.ButtonBar.AlertDialog.WearMaterial3" parent="Widget.DeviceDefault.Button"> + <item name="android:textSize">0sp</item> + <item name="android:gravity">center</item> + <item name="android:paddingStart">0dp</item> + <item name="android:paddingEnd">0dp</item> + <item name="android:drawablePadding">0dp</item> + </style> + <style name="Widget.DeviceDefault.Button.ButtonBar.AlertDialog.WearMaterial3.Confirm"> + <!-- Use a ImageView as background --> + <item name="background">@android:color/transparent</item> + <item name="minWidth">@dimen/dialog_btn_confirm_width</item> + <item name="minHeight">@dimen/dialog_btn_confirm_height</item> + </style> + <style name="Widget.DeviceDefault.Button.ButtonBar.AlertDialog.WearMaterial3.Negative"> + <item name="background">@drawable/dialog_alert_button_negative_watch</item> + <item name="minWidth">@dimen/dialog_btn_negative_width</item> + <item name="minHeight">@dimen/dialog_btn_negative_height</item> + <item name="maxWidth">@dimen/dialog_btn_negative_width</item> + <item name="maxHeight">@dimen/dialog_btn_negative_height</item> + </style> +</resources>
\ No newline at end of file |