Add animations for Switch backport
This change adds animations for the Switch backport view using an
<animated-selector/>.
Test: ./gradlew
glance:glance-appwidget:integration-tests:demos:installDebug
Test: Use CheckBox Widget
Change-Id: I05e774fafceff607e6a67b35e4225ea72e705edb
diff --git a/glance/glance-appwidget/src/androidMain/res/color/switch_off_ambient_shadow.xml b/glance/glance-appwidget/src/androidMain/res/color/switch_off_ambient_shadow.xml
new file mode 100644
index 0000000..e31f49e
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/color/switch_off_ambient_shadow.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<gradient xmlns:android="http://schemas.android.com/apk/res/android"
+ android:centerX="13"
+ android:centerY="12"
+ android:gradientRadius="10.25"
+ android:type="radial">
+ <item
+ android:color="#6D050505"
+ android:offset="0" />
+ <item
+ android:color="#50050505"
+ android:offset="0.6" />
+ <item
+ android:color="#20000000"
+ android:offset="0.90" />
+ <item
+ android:color="#00000000"
+ android:offset="1" />
+</gradient>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/color/switch_off_key_shadow.xml b/glance/glance-appwidget/src/androidMain/res/color/switch_off_key_shadow.xml
new file mode 100644
index 0000000..2834f7f
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/color/switch_off_key_shadow.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<gradient xmlns:android="http://schemas.android.com/apk/res/android"
+ android:centerX="13"
+ android:centerY="14"
+ android:gradientRadius="10"
+ android:type="radial">
+ <item
+ android:color="#6D050505"
+ android:offset="0" />
+ <item
+ android:color="#50050505"
+ android:offset="0.6" />
+ <item
+ android:color="#20000000"
+ android:offset="0.8" />
+ <item
+ android:color="#00000000"
+ android:offset="1" />
+</gradient>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/color/switch_on_ambient_shadow.xml b/glance/glance-appwidget/src/androidMain/res/color/switch_on_ambient_shadow.xml
new file mode 100644
index 0000000..3f4f9cc
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/color/switch_on_ambient_shadow.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<gradient xmlns:android="http://schemas.android.com/apk/res/android"
+ android:centerX="24"
+ android:centerY="12"
+ android:gradientRadius="10.25"
+ android:type="radial">
+ <item
+ android:color="#6D050505"
+ android:offset="0" />
+ <item
+ android:color="#50050505"
+ android:offset="0.6" />
+ <item
+ android:color="#20000000"
+ android:offset="0.90" />
+ <item
+ android:color="#00000000"
+ android:offset="1" />
+</gradient>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/color/switch_on_key_shadow.xml b/glance/glance-appwidget/src/androidMain/res/color/switch_on_key_shadow.xml
new file mode 100644
index 0000000..d374869
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/color/switch_on_key_shadow.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<gradient xmlns:android="http://schemas.android.com/apk/res/android"
+ android:centerX="24"
+ android:centerY="14"
+ android:gradientRadius="10.25"
+ android:type="radial">
+ <item
+ android:color="#6D050505"
+ android:offset="0" />
+ <item
+ android:color="#50050505"
+ android:offset="0.6" />
+ <item
+ android:color="#40000000"
+ android:offset="0.8" />
+ <item
+ android:color="#00000000"
+ android:offset="1" />
+</gradient>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-hdpi/abc_btn_switch_to_on_mtrl_00001.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-hdpi/abc_btn_switch_to_on_mtrl_00001.9.png
deleted file mode 100644
index 4657a25..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-hdpi/abc_btn_switch_to_on_mtrl_00001.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-hdpi/abc_btn_switch_to_on_mtrl_00012.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-hdpi/abc_btn_switch_to_on_mtrl_00012.9.png
deleted file mode 100644
index 8dc415b..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-hdpi/abc_btn_switch_to_on_mtrl_00012.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-ldrtl/switch_thumb_material_checked.xml b/glance/glance-appwidget/src/androidMain/res/drawable-ldrtl/switch_thumb_material_checked.xml
deleted file mode 100644
index 987c157..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-ldrtl/switch_thumb_material_checked.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- Copyright 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.
- -->
-
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/abc_btn_switch_to_on_mtrl_00012"
- android:insetRight="18dp"/>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-ldrtl/switch_thumb_material_unchecked.xml b/glance/glance-appwidget/src/androidMain/res/drawable-ldrtl/switch_thumb_material_unchecked.xml
deleted file mode 100644
index d2d35b7..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-ldrtl/switch_thumb_material_unchecked.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- Copyright 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.
- -->
-
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/abc_btn_switch_to_on_mtrl_00001"
- android:insetLeft="18dp"/>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-mdpi/abc_btn_switch_to_on_mtrl_00001.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-mdpi/abc_btn_switch_to_on_mtrl_00001.9.png
deleted file mode 100644
index d0a41a5..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-mdpi/abc_btn_switch_to_on_mtrl_00001.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-mdpi/abc_btn_switch_to_on_mtrl_00012.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-mdpi/abc_btn_switch_to_on_mtrl_00012.9.png
deleted file mode 100644
index bebb1e2..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-mdpi/abc_btn_switch_to_on_mtrl_00012.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-xhdpi/abc_btn_switch_to_on_mtrl_00001.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-xhdpi/abc_btn_switch_to_on_mtrl_00001.9.png
deleted file mode 100644
index 1d29f9a..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-xhdpi/abc_btn_switch_to_on_mtrl_00001.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-xhdpi/abc_btn_switch_to_on_mtrl_00012.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-xhdpi/abc_btn_switch_to_on_mtrl_00012.9.png
deleted file mode 100644
index 92b43ba..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-xhdpi/abc_btn_switch_to_on_mtrl_00012.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-xxhdpi/abc_btn_switch_to_on_mtrl_00001.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-xxhdpi/abc_btn_switch_to_on_mtrl_00001.9.png
deleted file mode 100644
index c079867..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-xxhdpi/abc_btn_switch_to_on_mtrl_00001.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-xxhdpi/abc_btn_switch_to_on_mtrl_00012.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-xxhdpi/abc_btn_switch_to_on_mtrl_00012.9.png
deleted file mode 100644
index 3b9dc7c..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-xxhdpi/abc_btn_switch_to_on_mtrl_00012.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-xxxhdpi/abc_btn_switch_to_on_mtrl_00001.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-xxxhdpi/abc_btn_switch_to_on_mtrl_00001.9.png
deleted file mode 100644
index 639e6cb..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-xxxhdpi/abc_btn_switch_to_on_mtrl_00001.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable-xxxhdpi/abc_btn_switch_to_on_mtrl_00012.9.png b/glance/glance-appwidget/src/androidMain/res/drawable-xxxhdpi/abc_btn_switch_to_on_mtrl_00012.9.png
deleted file mode 100644
index 355d5b7..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable-xxxhdpi/abc_btn_switch_to_on_mtrl_00012.9.png
+++ /dev/null
Binary files differ
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_animated.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_animated.xml
new file mode 100644
index 0000000..c3491b6
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_animated.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<animated-selector xmlns:android="http://schemas.android.com/apk/res/android">
+ <item
+ android:id="@+id/on"
+ android:drawable="@drawable/switch_thumb_on"
+ android:state_enabled="true" />
+ <item
+ android:id="@+id/off"
+ android:drawable="@drawable/switch_thumb_off" />
+ <transition
+ android:drawable="@drawable/switch_thumb_off_to_on"
+ android:fromId="@+id/off"
+ android:toId="@+id/on" />
+ <transition
+ android:drawable="@drawable/switch_thumb_on_to_off"
+ android:fromId="@+id/on"
+ android:toId="@+id/off" />
+</animated-selector>
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_material.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_material.xml
deleted file mode 100644
index 939b1c2..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_material.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2014 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="true" android:drawable="@drawable/switch_thumb_material_checked" />
- <item android:drawable="@drawable/switch_thumb_material_unchecked" />
-</selector>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_material_checked.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_material_checked.xml
deleted file mode 100644
index ece7ee7..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_material_checked.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- Copyright 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.
- -->
-
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/abc_btn_switch_to_on_mtrl_00012"
- android:insetLeft="18dp"/>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_material_unchecked.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_material_unchecked.xml
deleted file mode 100644
index a151ef9..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_material_unchecked.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?><!--
- Copyright 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.
- -->
-
-<inset xmlns:android="http://schemas.android.com/apk/res/android"
- android:drawable="@drawable/abc_btn_switch_to_on_mtrl_00001"
- android:insetRight="18dp"/>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_off.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_off.xml
new file mode 100644
index 0000000..721590f
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_off.xml
@@ -0,0 +1,25 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="40dp"
+ android:height="26dp"
+ android:viewportWidth="40"
+ android:viewportHeight="26"
+>
+ <group android:name="thumb" android:translateX="0">
+ <path
+ android:pathData="M13,22.5C18.7989,22.5 23.5,17.7989 23.5,12 23.5,6.201 18.7989,1.5 13,1.5 7.201,1.5 2.5,6.201 2.5,12 2.5,17.7989 7.201,22.5 13,22.5Z"
+ android:strokeWidth="1.05"
+ android:fillColor="@color/switch_off_ambient_shadow"
+ android:fillType="evenOdd"/>
+ <path
+ android:pathData="m12.9681,24.2511c5.7734,0 10.4537,-5.084 10.4537,-11.3552 0,-6.2713 -4.6803,-11.3552 -10.4537,-11.3552 -5.7734,0 -10.4537,5.0839 -10.4537,11.3552 0,6.2713 4.6803,11.3552 10.4537,11.3552z"
+ android:strokeWidth="1.08951"
+ android:fillColor="@color/switch_off_key_shadow"
+ android:fillType="evenOdd"/>
+ <path
+ android:name="thumb_icon"
+ android:pathData="M13,22C18.5228,22 23,17.5228 23,12 23,6.4771 18.5228,2 13,2 7.4771,2 3,6.4771 3,12c0,5.5228 4.4771,10 10,10z"
+ android:strokeWidth="1"
+ android:fillColor="#fff"
+ android:fillType="evenOdd"/>
+ </group>
+</vector>
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_off_to_on.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_off_to_on.xml
new file mode 100644
index 0000000..a162697
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_off_to_on.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:aapt="http://schemas.android.com/aapt"
+ android:drawable="@drawable/switch_thumb_off">
+ <target
+ android:name="thumb" >
+ <aapt:attr name="android:animation">
+ <objectAnimator
+ android:propertyName="translateX"
+ android:valueFrom="0"
+ android:valueTo="14"
+ android:duration="250"
+ android:interpolator="@android:interpolator/linear" />
+ </aapt:attr>
+ </target>
+</animated-vector>
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_on.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_on.xml
new file mode 100644
index 0000000..bf6ea1c
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_on.xml
@@ -0,0 +1,26 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="40dp"
+ android:height="26dp"
+ android:viewportWidth="40"
+ android:viewportHeight="26"
+ >
+ <group
+ android:name="thumb"
+ android:translateX="3">
+ <path
+ android:fillColor="@color/switch_on_key_shadow"
+ android:fillType="evenOdd"
+ android:pathData="m23.9373,24.5329c5.7734,0 10.4537,-5.084 10.4537,-11.3552 0,-6.2713 -4.6803,-11.3552 -10.4537,-11.3552 -5.7734,0 -10.4537,5.0839 -10.4537,11.3552 0,6.2713 4.6803,11.3552 10.4537,11.3552z"
+ android:strokeWidth="1.08951" />
+ <path
+ android:fillColor="@color/switch_on_ambient_shadow"
+ android:fillType="evenOdd"
+ android:pathData="M24,22.5C29.7989,22.5 34.5,17.7989 34.5,12 34.5,6.201 29.7989,1.5 24,1.5 18.201,1.5 13.5,6.201 13.5,12c0,5.7989 4.701,10.5 10.5,10.5z"
+ android:strokeWidth="1.05" />
+ <path
+ android:name="thumb_icon"
+ android:fillColor="#fff"
+ android:fillType="evenOdd"
+ android:pathData="M24,22C29.5228,22 34,17.5228 34,12C34,6.4771 29.5228,2 24,2C18.4772,2 14,6.4771 14,12C14,17.5228 18.4772,22 24,22Z" />
+ </group>
+</vector>
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_on_to_off.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_on_to_off.xml
new file mode 100644
index 0000000..e78f0c2
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/drawable/switch_thumb_on_to_off.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<animated-vector xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:aapt="http://schemas.android.com/aapt"
+ android:drawable="@drawable/switch_thumb_on">
+ <target
+ android:name="thumb" >
+ <aapt:attr name="android:animation">
+ <objectAnimator
+ android:propertyName="translateX"
+ android:valueFrom="0"
+ android:valueTo="-14"
+ android:duration="250"
+ android:interpolator="@android:interpolator/linear" />
+ </aapt:attr>
+ </target>
+</animated-vector>
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_track.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_track.xml
new file mode 100644
index 0000000..3c0f448
--- /dev/null
+++ b/glance/glance-appwidget/src/androidMain/res/drawable/switch_track.xml
@@ -0,0 +1,12 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="40dp"
+ android:height="26dp"
+ android:viewportWidth="40"
+ android:viewportHeight="26"
+>
+ <path
+ android:name="track"
+ android:pathData="M10,5L30,5A7,7 0,0 1,37 12L37,12A7,7 0,0 1,30 19L10,19A7,7 0,0 1,3 12L3,12A7,7 0,0 1,10 5z"
+ android:fillColor="@android:color/white"
+ android:fillAlpha="?android:attr/disabledAlpha"/>
+</vector>
diff --git a/glance/glance-appwidget/src/androidMain/res/drawable/switch_track_material.xml b/glance/glance-appwidget/src/androidMain/res/drawable/switch_track_material.xml
deleted file mode 100644
index 0e93096..0000000
--- a/glance/glance-appwidget/src/androidMain/res/drawable/switch_track_material.xml
+++ /dev/null
@@ -1,27 +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.
--->
-
-<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
- <item android:gravity="center_vertical|fill_horizontal"
- android:start="4dp"
- android:end="4dp">
- <shape android:shape="rectangle">
- <corners android:radius="7dp" />
- <solid android:color="@color/white_disabled_material_anim" />
- <size android:height="14dp" />
- </shape>
- </item>
-</layer-list>
\ No newline at end of file
diff --git a/glance/glance-appwidget/src/androidMain/res/layout/swtch_text.xml b/glance/glance-appwidget/src/androidMain/res/layout/switch_text.xml
similarity index 100%
rename from glance/glance-appwidget/src/androidMain/res/layout/swtch_text.xml
rename to glance/glance-appwidget/src/androidMain/res/layout/switch_text.xml
diff --git a/glance/glance-appwidget/src/androidMain/res/layout/swtch_thumb.xml b/glance/glance-appwidget/src/androidMain/res/layout/switch_thumb.xml
similarity index 94%
rename from glance/glance-appwidget/src/androidMain/res/layout/swtch_thumb.xml
rename to glance/glance-appwidget/src/androidMain/res/layout/switch_thumb.xml
index bb31034..8106726 100644
--- a/glance/glance-appwidget/src/androidMain/res/layout/swtch_thumb.xml
+++ b/glance/glance-appwidget/src/androidMain/res/layout/switch_thumb.xml
@@ -18,5 +18,5 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical|start"
- android:src="@drawable/switch_thumb_material"
+ android:src="@drawable/switch_thumb_animated"
style="@style/Glance.AppWidget.SwitchThumb"/>
diff --git a/glance/glance-appwidget/src/androidMain/res/layout/swtch_track.xml b/glance/glance-appwidget/src/androidMain/res/layout/switch_track.xml
similarity index 94%
rename from glance/glance-appwidget/src/androidMain/res/layout/swtch_track.xml
rename to glance/glance-appwidget/src/androidMain/res/layout/switch_track.xml
index 375967e..e65bc84 100644
--- a/glance/glance-appwidget/src/androidMain/res/layout/swtch_track.xml
+++ b/glance/glance-appwidget/src/androidMain/res/layout/switch_track.xml
@@ -17,5 +17,5 @@
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="42dp"
android:layout_height="28dp"
- android:src="@drawable/switch_track_material"
+ android:src="@drawable/switch_track"
style="@style/Glance.AppWidget.SwitchTrack"/>
diff --git a/glance/glance-appwidget/src/androidMain/res/layout/swtch_backport.xml b/glance/glance-appwidget/src/androidMain/res/layout/swtch_backport.xml
index 0258870..f6caf8a 100644
--- a/glance/glance-appwidget/src/androidMain/res/layout/swtch_backport.xml
+++ b/glance/glance-appwidget/src/androidMain/res/layout/swtch_backport.xml
@@ -25,7 +25,7 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
- android:layout="@layout/swtch_text" />
+ android:layout="@layout/switch_text" />
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -35,12 +35,12 @@
android:id="@id/switchTrack"
android:layout_width="42dp"
android:layout_height="28dp"
- android:layout="@layout/swtch_track" />
+ android:layout="@layout/switch_track" />
<ViewStub
android:id="@id/switchThumb"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout="@layout/swtch_thumb" />
+ android:layout_width="42dp"
+ android:layout_height="28dp"
+ android:layout="@layout/switch_thumb" />
</FrameLayout>
</LinearLayout>
diff --git a/glance/glance-appwidget/src/androidMain/res/values/ids.xml b/glance/glance-appwidget/src/androidMain/res/values/ids.xml
index 6ab0397..5d9dcb7 100644
--- a/glance/glance-appwidget/src/androidMain/res/values/ids.xml
+++ b/glance/glance-appwidget/src/androidMain/res/values/ids.xml
@@ -23,8 +23,8 @@
<id name="sizeView" />
<id name="sizeViewStub" />
<id name="switchText" />
- <id name="switchTrack" />
<id name="switchThumb" />
+ <id name="switchTrack" />
<id name="rootView" />
<id name="rootStubId" />
<id name="deletedViewId" />
diff --git a/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/translators/SwitchTranslatorTest.kt b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/translators/SwitchTranslatorTest.kt
index 9ab5575..2e30f94 100644
--- a/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/translators/SwitchTranslatorTest.kt
+++ b/glance/glance-appwidget/src/test/kotlin/androidx/glance/appwidget/translators/SwitchTranslatorTest.kt
@@ -268,12 +268,12 @@
private val ViewGroup.thumbImageView: ImageView?
get() = findView {
shadowOf(it.drawable).createdFromResId ==
- androidx.glance.appwidget.R.drawable.switch_thumb_material
+ androidx.glance.appwidget.R.drawable.switch_thumb_animated
}
private val ViewGroup.trackImageView: ImageView?
get() = findView {
shadowOf(it.drawable).createdFromResId ==
- androidx.glance.appwidget.R.drawable.switch_track_material
+ androidx.glance.appwidget.R.drawable.switch_track
}
}
\ No newline at end of file