summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/res/res/color-watch-v36/btn_material_filled_background_color.xml3
-rw-r--r--core/res/res/color-watch-v36/btn_material_filled_content_color.xml (renamed from core/res/res/color-watch-v36/btn_material_filled_text_color.xml)3
-rw-r--r--core/res/res/color-watch-v36/btn_material_filled_tonal_background_color.xml3
-rw-r--r--core/res/res/color-watch-v36/btn_material_filled_tonal_content_color.xml (renamed from core/res/res/color-watch-v36/btn_material_filled_tonal_text_color.xml)3
-rw-r--r--core/res/res/drawable-watch-v36/dialog_alert_button_background_negative.xml25
-rw-r--r--core/res/res/drawable-watch-v36/dialog_alert_button_background_positive.xml30
-rw-r--r--core/res/res/drawable-watch-v36/dialog_alert_button_negative.xml22
-rw-r--r--core/res/res/drawable-watch-v36/dialog_alert_button_positive.xml22
-rw-r--r--core/res/res/drawable-watch-v36/ic_check.xml25
-rw-r--r--core/res/res/drawable-watch-v36/ic_close.xml25
-rw-r--r--core/res/res/layout-watch-v36/alert_dialog_material.xml123
-rw-r--r--core/res/res/values-watch-v36/config.xml1
-rw-r--r--core/res/res/values-watch-v36/dimens_material.xml6
-rw-r--r--core/res/res/values-watch-v36/styles_material.xml28
14 files changed, 309 insertions, 10 deletions
diff --git a/core/res/res/color-watch-v36/btn_material_filled_background_color.xml b/core/res/res/color-watch-v36/btn_material_filled_background_color.xml
index 8b2afa86986c..70aace4e7d76 100644
--- a/core/res/res/color-watch-v36/btn_material_filled_background_color.xml
+++ b/core/res/res/color-watch-v36/btn_material_filled_background_color.xml
@@ -18,6 +18,5 @@
<item android:state_enabled="false"
android:alpha="?attr/disabledAlpha"
android:color="?attr/materialColorOnSurface" />
- <item android:state_enabled="true"
- android:color="?attr/materialColorPrimary" />
+ <item android:color="?attr/materialColorPrimary" />
</selector> \ No newline at end of file
diff --git a/core/res/res/color-watch-v36/btn_material_filled_text_color.xml b/core/res/res/color-watch-v36/btn_material_filled_content_color.xml
index cefc9121b7a4..4cc8fe5ecb91 100644
--- a/core/res/res/color-watch-v36/btn_material_filled_text_color.xml
+++ b/core/res/res/color-watch-v36/btn_material_filled_content_color.xml
@@ -18,6 +18,5 @@
<item android:state_enabled="false"
android:alpha="?attr/primaryContentAlpha"
android:color="?attr/materialColorOnSurface" />
- <item android:state_enabled="true"
- android:color="?attr/materialColorOnPrimary" />
+ <item android:color="?attr/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-watch-v36/btn_material_filled_tonal_background_color.xml
index eaf9e7d50bbd..b2a25af0d670 100644
--- a/core/res/res/color-watch-v36/btn_material_filled_tonal_background_color.xml
+++ b/core/res/res/color-watch-v36/btn_material_filled_tonal_background_color.xml
@@ -18,6 +18,5 @@
<item android:state_enabled="false"
android:alpha="?attr/disabledAlpha"
android:color="?attr/materialColorOnSurface" />
- <item android:state_enabled="true"
- android:color="?attr/materialColorSurfaceContainer" />
+ <item android:color="?attr/materialColorSurfaceContainer" />
</selector> \ No newline at end of file
diff --git a/core/res/res/color-watch-v36/btn_material_filled_tonal_text_color.xml b/core/res/res/color-watch-v36/btn_material_filled_tonal_content_color.xml
index 94e50fbe2533..59810356c3b4 100644
--- a/core/res/res/color-watch-v36/btn_material_filled_tonal_text_color.xml
+++ b/core/res/res/color-watch-v36/btn_material_filled_tonal_content_color.xml
@@ -18,6 +18,5 @@
<item android:state_enabled="false"
android:alpha="?attr/primaryContentAlpha"
android:color="?attr/materialColorOnSurface" />
- <item android:state_enabled="true"
- android:color="?attr/materialColorOnSurface" />
+ <item android:color="?attr/materialColorOnSurface" />
</selector> \ No newline at end of file
diff --git a/core/res/res/drawable-watch-v36/dialog_alert_button_background_negative.xml b/core/res/res/drawable-watch-v36/dialog_alert_button_background_negative.xml
new file mode 100644
index 000000000000..b6b8eac3a547
--- /dev/null
+++ b/core/res/res/drawable-watch-v36/dialog_alert_button_background_negative.xml
@@ -0,0 +1,25 @@
+<?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.
+ -->
+
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+ android:shape="rectangle">
+ <solid android:color="@color/btn_material_filled_tonal_background_color"/>
+ <corners android:radius="@dimen/config_bottomDialogCornerRadius" />
+ <size
+ android:width="@dimen/dialog_btn_negative_width"
+ android:height="@dimen/dialog_btn_negative_height" />
+</shape>
diff --git a/core/res/res/drawable-watch-v36/dialog_alert_button_background_positive.xml b/core/res/res/drawable-watch-v36/dialog_alert_button_background_positive.xml
new file mode 100644
index 000000000000..92262fb6d89d
--- /dev/null
+++ b/core/res/res/drawable-watch-v36/dialog_alert_button_background_positive.xml
@@ -0,0 +1,30 @@
+<?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.
+ -->
+
+<rotate xmlns:android="http://schemas.android.com/apk/res/android"
+ android:fromDegrees="-45"
+ android:toDegrees="-45"
+ android:pivotX="50%"
+ android:pivotY="50%">
+ <shape android:shape="rectangle">
+ <solid android:color="@color/btn_material_filled_background_color"/>
+ <corners android:radius="200dp" />
+ <size
+ android:width="63dp"
+ android:height="54dp" />
+ </shape>
+</rotate> \ No newline at end of file
diff --git a/core/res/res/drawable-watch-v36/dialog_alert_button_negative.xml b/core/res/res/drawable-watch-v36/dialog_alert_button_negative.xml
new file mode 100644
index 000000000000..c155ba1ba077
--- /dev/null
+++ b/core/res/res/drawable-watch-v36/dialog_alert_button_negative.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.
+ -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/dialog_alert_button_background_negative"/>
+ <item
+ android:drawable="@drawable/ic_close"
+ 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-watch-v36/dialog_alert_button_positive.xml
new file mode 100644
index 000000000000..01ab0734d8e8
--- /dev/null
+++ b/core/res/res/drawable-watch-v36/dialog_alert_button_positive.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.
+ -->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:drawable="@drawable/dialog_alert_button_background_positive"/>
+ <item
+ android:drawable="@drawable/ic_check"
+ 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-watch-v36/ic_check.xml
new file mode 100644
index 000000000000..7b01e64ffdd3
--- /dev/null
+++ b/core/res/res/drawable-watch-v36/ic_check.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="28dp"
+ 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: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-watch-v36/ic_close.xml
new file mode 100644
index 000000000000..1f3da367ac3f
--- /dev/null
+++ b/core/res/res/drawable-watch-v36/ic_close.xml
@@ -0,0 +1,25 @@
+<!--
+ ~ 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.
+ -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="28dp"
+ 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: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/layout-watch-v36/alert_dialog_material.xml b/core/res/res/layout-watch-v36/alert_dialog_material.xml
new file mode 100644
index 000000000000..900102f379d9
--- /dev/null
+++ b/core/res/res/layout-watch-v36/alert_dialog_material.xml
@@ -0,0 +1,123 @@
+<!--
+ ~ 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.
+ -->
+
+<!-- This layout is the AlertDialog template. It overrides the system layout with the same name.
+ Make sure to include all the existing id of the overridden alert_dialog_material.-->
+<com.android.internal.widget.WatchListDecorLayout
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ android:id="@+id/parentPanel"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <ScrollView
+ android:id="@+id/scrollView"
+ android:fillViewport="true"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+ <LinearLayout
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content">
+ <!-- Top Panel -->
+ <FrameLayout
+ android:paddingLeft="?dialogPreferredPadding"
+ android:paddingRight="?dialogPreferredPadding"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:id="@+id/topPanel"
+ android:minHeight="@dimen/dialog_list_padding_top_no_title">
+ <include android:id="@+id/title_template"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ layout="@layout/alert_dialog_title_material"/>
+ </FrameLayout>
+
+ <!-- Content Panel -->
+ <FrameLayout android:id="@+id/contentPanel"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:clipToPadding="false">
+ <TextView android:id="@+id/message"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:gravity="center_horizontal|top"
+ android:textAppearance="@style/TextAppearance.DeviceDefault.Body1"
+ android:paddingStart="?dialogPreferredPadding"
+ android:paddingEnd="?dialogPreferredPadding"
+ android:paddingTop="8dip"
+ android:paddingBottom="8dip"/>
+ </FrameLayout>
+
+ <!-- Custom Panel, to replace content panel if needed -->
+ <FrameLayout android:id="@+id/customPanel"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:minHeight="64dp">
+ <FrameLayout android:id="@+android:id/custom"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+ </FrameLayout>
+
+ <!-- Button Panel -->
+ <FrameLayout
+ android:id="@+id/buttonPanel"
+ android:minHeight="@dimen/dialog_list_padding_bottom_no_buttons"
+ android:layout_weight="1"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center">
+ <LinearLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="bottom"
+ android:orientation="horizontal"
+ android:paddingBottom="?dialogPreferredPadding"
+ style="?android:attr/buttonBarStyle"
+ android:measureWithLargestChild="true">
+ <Button android:id="@+id/button2"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:gravity="center"
+ android:layout_weight="1"
+ style="@style/Widget.DeviceDefault.Button.ButtonBar.AlertDialog.Negative" />
+ <Button android:id="@+id/button3"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center"
+ android:gravity="center"
+ android:layout_weight="1"
+ style="?android:attr/buttonBarButtonStyle"/>
+ <FrameLayout
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content">
+ <Button android:id="@+id/button1"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:layout_gravity="center"
+ android:gravity="center"
+ android:layout_weight="1"
+ style="@style/Widget.DeviceDefault.Button.ButtonBar.AlertDialog.Confirm"/>
+ <!-- This works as background. -->
+ <ImageView
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:src="@drawable/dialog_alert_button_positive"/>
+ </FrameLayout>
+ </LinearLayout>
+ </FrameLayout>
+ </LinearLayout>
+ </ScrollView>
+</com.android.internal.widget.WatchListDecorLayout>
diff --git a/core/res/res/values-watch-v36/config.xml b/core/res/res/values-watch-v36/config.xml
index c8f347afb318..bb9da177e4fd 100644
--- a/core/res/res/values-watch-v36/config.xml
+++ b/core/res/res/values-watch-v36/config.xml
@@ -17,4 +17,5 @@
<resources>
<!-- Overrides system value -->
<dimen name="config_buttonCornerRadius">26dp</dimen>
+ <dimen name="config_bottomDialogCornerRadius">18dp</dimen>
</resources>
diff --git a/core/res/res/values-watch-v36/dimens_material.xml b/core/res/res/values-watch-v36/dimens_material.xml
index ad3c1a3ef3a1..ffa3b9c614db 100644
--- a/core/res/res/values-watch-v36/dimens_material.xml
+++ b/core/res/res/values-watch-v36/dimens_material.xml
@@ -22,6 +22,12 @@
<dimen name="btn_lineHeight">18sp</dimen>
<dimen name="btn_textSize">15sp</dimen>
+ <!-- values for 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 -->
<dimen name="disabled_alpha_device_default">0.12</dimen>
<dimen name="primary_content_alpha_device_default">0.38</dimen>
diff --git a/core/res/res/values-watch-v36/styles_material.xml b/core/res/res/values-watch-v36/styles_material.xml
index 32a22bb755cb..b2760e7c10a7 100644
--- a/core/res/res/values-watch-v36/styles_material.xml
+++ b/core/res/res/values-watch-v36/styles_material.xml
@@ -44,7 +44,7 @@
<!-- Text Styles -->
<!-- TextAppearance for Material Button - Filled -->
<style name="TextAppearance.Widget.Button.Material.Filled" parent="TextAppearance.Widget.Button.Material">
- <item name="textColor">@color/btn_material_filled_text_color</item>
+ <item name="textColor">@color/btn_material_filled_content_color</item>
</style>
<!-- TextAppearance for Material Button - Filled Tonal -->
@@ -52,7 +52,31 @@
<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_text_color</item>
+ <item name="textColor">@color/btn_material_filled_tonal_content_color</item>
<item name="lineHeight">@dimen/btn_lineHeight</item>
</style>
+
+ <!-- AlertDialog Styles -->
+ <style name="Widget.DeviceDefault.Button.ButtonBar.AlertDialog" 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.Confirm" parent="Widget.DeviceDefault.Button.ButtonBar.AlertDialog">
+ <!-- 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.Negative" parent="Widget.DeviceDefault.Button.ButtonBar.AlertDialog">
+ <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>
</resources> \ No newline at end of file