summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-11-28 16:14:28 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-11-28 16:14:28 +0000
commit25bc686459d2afddaff0eb4502ba69e44ffa9c31 (patch)
tree5b1100ac938ca78c40dcd4b6c9151db8c8be6e14
parent479453ffacf4272c87b8f0eb49912b84e721c96f (diff)
parentba15cd8b8c7b2d3accc79a4321b0af80e27b806c (diff)
Merge "m3: impl baseline button styling Outline & Text" into main
-rw-r--r--core/res/res/color-watch-v36/btn_material_outlined_background_color.xml22
-rw-r--r--core/res/res/drawable-watch-v36/btn_background_material_outlined.xml39
-rw-r--r--core/res/res/drawable-watch-v36/btn_background_material_text.xml28
-rw-r--r--core/res/res/values-watch-v36/styles_material.xml18
4 files changed, 103 insertions, 4 deletions
diff --git a/core/res/res/color-watch-v36/btn_material_outlined_background_color.xml b/core/res/res/color-watch-v36/btn_material_outlined_background_color.xml
new file mode 100644
index 000000000000..665f47faca0d
--- /dev/null
+++ b/core/res/res/color-watch-v36/btn_material_outlined_background_color.xml
@@ -0,0 +1,22 @@
+<!--
+ ~ 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.
+ -->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:state_enabled="false"
+ android:alpha="?attr/disabledAlpha"
+ android:color="?attr/materialColorOnSurface" />
+ <item android:color="?attr/materialColorOutline" />
+</selector>
diff --git a/core/res/res/drawable-watch-v36/btn_background_material_outlined.xml b/core/res/res/drawable-watch-v36/btn_background_material_outlined.xml
new file mode 100644
index 000000000000..7bc40604dc25
--- /dev/null
+++ b/core/res/res/drawable-watch-v36/btn_background_material_outlined.xml
@@ -0,0 +1,39 @@
+<!--
+ ~ 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.
+ -->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?attr/colorControlHighlight">
+ <item android:id="@android:id/mask">
+ <shape android:shape="rectangle">
+ <corners android:radius="@dimen/config_wearMaterial3_buttonCornerRadius"/>
+ <solid android:color="#fff"/>
+ <size
+ android:width="@dimen/btn_material_width"
+ android:height="@dimen/btn_material_height" />
+ </shape>
+ </item>
+ <item>
+ <shape android:shape="rectangle">
+ <corners android:radius="@dimen/config_wearMaterial3_buttonCornerRadius"/>
+ <stroke
+ android:width="1dp"
+ android:color="@color/btn_material_outlined_background_color" />
+ <size
+ android:width="@dimen/btn_material_width"
+ android:height="@dimen/btn_material_height" />
+ </shape>
+ </item>
+</ripple>
diff --git a/core/res/res/drawable-watch-v36/btn_background_material_text.xml b/core/res/res/drawable-watch-v36/btn_background_material_text.xml
new file mode 100644
index 000000000000..145685c8095c
--- /dev/null
+++ b/core/res/res/drawable-watch-v36/btn_background_material_text.xml
@@ -0,0 +1,28 @@
+<!--
+ ~ 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.
+ -->
+
+<ripple xmlns:android="http://schemas.android.com/apk/res/android"
+ android:color="?attr/colorControlHighlight">
+ <item android:id="@android:id/mask">
+ <shape android:shape="rectangle">
+ <corners android:radius="@dimen/config_wearMaterial3_buttonCornerRadius"/>
+ <solid android:color="#fff"/>
+ <size
+ android:width="@dimen/btn_material_width"
+ android:height="@dimen/btn_material_height" />
+ </shape>
+ </item>
+</ripple>
diff --git a/core/res/res/values-watch-v36/styles_material.xml b/core/res/res/values-watch-v36/styles_material.xml
index fc9f669becc7..6e5ef68a70c3 100644
--- a/core/res/res/values-watch-v36/styles_material.xml
+++ b/core/res/res/values-watch-v36/styles_material.xml
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (C) 2024 The Android Open Source Project
~
@@ -17,13 +17,13 @@
<resources>
<!-- Button Styles -->
- <!-- Material Button - Filled -->
+ <!-- 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) -->
+ <!-- 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>
@@ -41,9 +41,19 @@
<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" parent="TextAppearance.Widget.Button.Material">
+ <style name="TextAppearance.Widget.Button.Material.Filled">
<item name="textColor">@color/btn_material_filled_content_color</item>
</style>