diff --git a/res/drawable-night/accessibility_shortcut_type_hardware.xml b/res/drawable-night/accessibility_shortcut_type_hardware.xml
new file mode 100644
index 00000000000..9ef3664e745
--- /dev/null
+++ b/res/drawable-night/accessibility_shortcut_type_hardware.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable-night/accessibility_shortcut_type_software.xml b/res/drawable-night/accessibility_shortcut_type_software.xml
new file mode 100644
index 00000000000..8d55ae91dc7
--- /dev/null
+++ b/res/drawable-night/accessibility_shortcut_type_software.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable-night/accessibility_shortcut_type_software_floating.xml b/res/drawable-night/accessibility_shortcut_type_software_floating.xml
new file mode 100644
index 00000000000..25d53cac89e
--- /dev/null
+++ b/res/drawable-night/accessibility_shortcut_type_software_floating.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable-night/accessibility_shortcut_type_software_gesture.xml b/res/drawable-night/accessibility_shortcut_type_software_gesture.xml
new file mode 100644
index 00000000000..905586599fe
--- /dev/null
+++ b/res/drawable-night/accessibility_shortcut_type_software_gesture.xml
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable-night/accessibility_shortcut_type_software_gesture_talkback.xml b/res/drawable-night/accessibility_shortcut_type_software_gesture_talkback.xml
new file mode 100644
index 00000000000..0b6f1e6142e
--- /dev/null
+++ b/res/drawable-night/accessibility_shortcut_type_software_gesture_talkback.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable/accessibility_shortcut_type_hardware.png b/res/drawable/accessibility_shortcut_type_hardware.png
deleted file mode 100644
index 664ceb368b7..00000000000
Binary files a/res/drawable/accessibility_shortcut_type_hardware.png and /dev/null differ
diff --git a/res/drawable/accessibility_shortcut_type_hardware.xml b/res/drawable/accessibility_shortcut_type_hardware.xml
new file mode 100644
index 00000000000..b6b227bd3ad
--- /dev/null
+++ b/res/drawable/accessibility_shortcut_type_hardware.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable/accessibility_shortcut_type_software.png b/res/drawable/accessibility_shortcut_type_software.png
deleted file mode 100644
index 0212548c8e9..00000000000
Binary files a/res/drawable/accessibility_shortcut_type_software.png and /dev/null differ
diff --git a/res/drawable/accessibility_shortcut_type_software.xml b/res/drawable/accessibility_shortcut_type_software.xml
new file mode 100644
index 00000000000..d0573aa4bbe
--- /dev/null
+++ b/res/drawable/accessibility_shortcut_type_software.xml
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable/accessibility_shortcut_type_software_floating.xml b/res/drawable/accessibility_shortcut_type_software_floating.xml
index 958201515f1..88ce42d43bb 100644
--- a/res/drawable/accessibility_shortcut_type_software_floating.xml
+++ b/res/drawable/accessibility_shortcut_type_software_floating.xml
@@ -15,54 +15,25 @@
-->
+ android:width="412dp"
+ android:height="300dp"
+ android:viewportWidth="412"
+ android:viewportHeight="300">
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ android:strokeColor="#dadce0"/>
+
+
diff --git a/res/drawable/accessibility_shortcut_type_software_gesture.png b/res/drawable/accessibility_shortcut_type_software_gesture.png
deleted file mode 100644
index 0a2921a29c4..00000000000
Binary files a/res/drawable/accessibility_shortcut_type_software_gesture.png and /dev/null differ
diff --git a/res/drawable/accessibility_shortcut_type_software_gesture.xml b/res/drawable/accessibility_shortcut_type_software_gesture.xml
new file mode 100644
index 00000000000..514dd517898
--- /dev/null
+++ b/res/drawable/accessibility_shortcut_type_software_gesture.xml
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable/accessibility_shortcut_type_software_gesture_talkback.png b/res/drawable/accessibility_shortcut_type_software_gesture_talkback.png
deleted file mode 100644
index 85fec85cc94..00000000000
Binary files a/res/drawable/accessibility_shortcut_type_software_gesture_talkback.png and /dev/null differ
diff --git a/res/drawable/accessibility_shortcut_type_software_gesture_talkback.xml b/res/drawable/accessibility_shortcut_type_software_gesture_talkback.xml
new file mode 100644
index 00000000000..9388e66e8d5
--- /dev/null
+++ b/res/drawable/accessibility_shortcut_type_software_gesture_talkback.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/res/drawable/accessibility_shortcut_type_triple_tap.png b/res/drawable/accessibility_shortcut_type_triple_tap.png
deleted file mode 100644
index 6a08d29b2ee..00000000000
Binary files a/res/drawable/accessibility_shortcut_type_triple_tap.png and /dev/null differ
diff --git a/res/layout/accessibility_edit_shortcut_component.xml b/res/layout/accessibility_edit_shortcut_component.xml
index 0d3324f9b54..d54fff63ab3 100644
--- a/res/layout/accessibility_edit_shortcut_component.xml
+++ b/res/layout/accessibility_edit_shortcut_component.xml
@@ -53,11 +53,9 @@
-
+
diff --git a/res/layout/accessibility_lottie_animation_view.xml b/res/layout/accessibility_lottie_animation_view.xml
new file mode 100644
index 00000000000..f4638bec729
--- /dev/null
+++ b/res/layout/accessibility_lottie_animation_view.xml
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/res/raw/accessibility_shortcut_type_triple_tap.json b/res/raw/accessibility_shortcut_type_triple_tap.json
new file mode 100644
index 00000000000..870e671a51f
--- /dev/null
+++ b/res/raw/accessibility_shortcut_type_triple_tap.json
@@ -0,0 +1,1959 @@
+{
+ "v": "5.6.5",
+ "fr": 60,
+ "ip": 0,
+ "op": 180,
+ "w": 412,
+ "h": 300,
+ "nm": "Triple_Tap_Screen",
+ "ddd": 0,
+ "assets": [
+ {
+ "id": "comp_0",
+ "layers": [
+ {
+ "ddd": 0,
+ "ind": 1,
+ "ty": 4,
+ "nm": ".white",
+ "cl": "white",
+ "hd": true,
+ "sr": 1,
+ "ks": {
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 206,
+ 150,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100,
+ 100
+ ],
+ "ix": 6
+ }
+ },
+ "ao": 0,
+ "shapes": [
+ {
+ "ty": "gr",
+ "it": [
+ {
+ "ind": 0,
+ "ty": "sh",
+ "ix": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "i": [
+ [
+ 15.4,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 15.4
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -15.4,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ -15.4
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -15.4,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ -15.4
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 15.4,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 15.4
+ ]
+ ],
+ "v": [
+ [
+ 178,
+ 150
+ ],
+ [
+ -178,
+ 150
+ ],
+ [
+ -206,
+ 122
+ ],
+ [
+ -206,
+ -122
+ ],
+ [
+ -178,
+ -150
+ ],
+ [
+ 178,
+ -150
+ ],
+ [
+ 206,
+ -122
+ ],
+ [
+ 206,
+ 122
+ ]
+ ],
+ "c": true
+ },
+ "ix": 2
+ },
+ "nm": "Path 1",
+ "mn": "ADBE Vector Shape - Group",
+ "hd": false
+ },
+ {
+ "ty": "fl",
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 1,
+ 1,
+ 1
+ ],
+ "ix": 4
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 5
+ },
+ "r": 1,
+ "bm": 0,
+ "nm": "Fill 1",
+ "mn": "ADBE Vector Graphic - Fill",
+ "hd": false
+ },
+ {
+ "ty": "tr",
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "nm": "Transform"
+ }
+ ],
+ "nm": "Group 1",
+ "np": 2,
+ "cix": 2,
+ "bm": 0,
+ "ix": 1,
+ "mn": "ADBE Vector Group",
+ "hd": false
+ }
+ ],
+ "ip": 0,
+ "op": 1800,
+ "st": 0,
+ "bm": 0
+ }
+ ]
+ }
+ ],
+ "layers": [
+ {
+ "ddd": 0,
+ "ind": 1,
+ "ty": 4,
+ "nm": ".grey200",
+ "cl": "grey200",
+ "sr": 1,
+ "ks": {
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 206,
+ 150,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 1.35,
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100,
+ 100
+ ],
+ "ix": 6
+ }
+ },
+ "ao": 0,
+ "shapes": [
+ {
+ "ty": "gr",
+ "it": [
+ {
+ "ind": 0,
+ "ty": "sh",
+ "ix": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "i": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ -73.4
+ ],
+ [
+ -73.4,
+ 0
+ ],
+ [
+ 0,
+ 73.4
+ ],
+ [
+ 73.4,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ -73.4,
+ 0
+ ],
+ [
+ 0,
+ 73.4
+ ],
+ [
+ 73.4,
+ 0
+ ],
+ [
+ 0,
+ -73.4
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ 1.4,
+ -132.9
+ ],
+ [
+ -131.6,
+ 0
+ ],
+ [
+ 1.3,
+ 132.9
+ ],
+ [
+ 134.3,
+ 0
+ ],
+ [
+ 1.4,
+ -132.9
+ ]
+ ],
+ "c": true
+ },
+ "ix": 2
+ },
+ "nm": "Path 1",
+ "mn": "ADBE Vector Shape - Group",
+ "hd": false
+ },
+ {
+ "ind": 1,
+ "ty": "sh",
+ "ix": 2,
+ "ks": {
+ "a": 0,
+ "k": {
+ "i": [
+ [
+ 0,
+ 0
+ ],
+ [
+ -24.7,
+ -24.8
+ ],
+ [
+ 0,
+ -35
+ ],
+ [
+ 24.8,
+ -24.7
+ ],
+ [
+ 35,
+ 0
+ ],
+ [
+ 24.7,
+ 24.8
+ ],
+ [
+ 0,
+ 35
+ ],
+ [
+ -24.8,
+ 24.7
+ ],
+ [
+ -35,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ 35,
+ 0
+ ],
+ [
+ 24.7,
+ 24.7
+ ],
+ [
+ 0,
+ 35
+ ],
+ [
+ -24.7,
+ 24.7
+ ],
+ [
+ -35,
+ 0
+ ],
+ [
+ -24.7,
+ -24.8
+ ],
+ [
+ 0,
+ -35
+ ],
+ [
+ 24.7,
+ -24.7
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "v": [
+ [
+ 1.4,
+ -130.9
+ ],
+ [
+ 94,
+ -92.5
+ ],
+ [
+ 132.4,
+ 0.1
+ ],
+ [
+ 94,
+ 92.7
+ ],
+ [
+ 1.4,
+ 131.1
+ ],
+ [
+ -91.2,
+ 92.7
+ ],
+ [
+ -129.6,
+ 0
+ ],
+ [
+ -91.2,
+ -92.6
+ ],
+ [
+ 1.4,
+ -130.9
+ ]
+ ],
+ "c": false
+ },
+ "ix": 2
+ },
+ "nm": "Path 2",
+ "mn": "ADBE Vector Shape - Group",
+ "hd": false
+ },
+ {
+ "ty": "fl",
+ "c": {
+ "a": 0,
+ "k": [
+ 0.909803926945,
+ 0.917647063732,
+ 0.929411768913,
+ 1
+ ],
+ "ix": 4
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 5
+ },
+ "r": 1,
+ "bm": 0,
+ "nm": "Fill 1",
+ "mn": "ADBE Vector Graphic - Fill",
+ "hd": false
+ },
+ {
+ "ty": "tr",
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "nm": "Transform"
+ }
+ ],
+ "nm": "Group 1",
+ "np": 3,
+ "cix": 2,
+ "bm": 0,
+ "ix": 1,
+ "mn": "ADBE Vector Group",
+ "hd": false
+ }
+ ],
+ "ip": 0,
+ "op": 300,
+ "st": 0,
+ "bm": 0
+ },
+ {
+ "ddd": 0,
+ "ind": 2,
+ "ty": 4,
+ "nm": ".grey300",
+ "cl": "grey300",
+ "sr": 1,
+ "ks": {
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 205,
+ 150,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100,
+ 100
+ ],
+ "ix": 6
+ }
+ },
+ "ao": 0,
+ "shapes": [
+ {
+ "ty": "gr",
+ "it": [
+ {
+ "ty": "gr",
+ "it": [
+ {
+ "ind": 0,
+ "ty": "sh",
+ "ix": 1,
+ "ks": {
+ "a": 0,
+ "k": {
+ "i": [
+ [
+ -7.9,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 8
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 1.6
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 2,
+ 1.5
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 6.4,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 6.4
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 1,
+ -0.7
+ ],
+ [
+ 0,
+ 0
+ ]
+ ],
+ "o": [
+ [
+ 0,
+ 0
+ ],
+ [
+ 8,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 1.6,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -1.9,
+ -1.6
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0,
+ 6.4
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -6.4,
+ 0
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ -1,
+ 0.7
+ ],
+ [
+ 0,
+ 0
+ ],
+ [
+ 0.1,
+ 7.9
+ ]
+ ],
+ "v": [
+ [
+ -64,
+ 75.3
+ ],
+ [
+ 69.1,
+ 75.3
+ ],
+ [
+ 83.6,
+ 60.8
+ ],
+ [
+ 83.6,
+ -81
+ ],
+ [
+ 86.5,
+ -83.9
+ ],
+ [
+ 86.5,
+ -100.9
+ ],
+ [
+ 80.7,
+ -105.6
+ ],
+ [
+ 80.7,
+ 60.8
+ ],
+ [
+ 69.1,
+ 72.4
+ ],
+ [
+ -64,
+ 72.4
+ ],
+ [
+ -75.6,
+ 60.8
+ ],
+ [
+ -75.6,
+ -107.3
+ ],
+ [
+ -78.5,
+ -105.2
+ ],
+ [
+ -78.5,
+ 60.9
+ ]
+ ],
+ "c": true
+ },
+ "ix": 2
+ },
+ "nm": "Path 1",
+ "mn": "ADBE Vector Shape - Group",
+ "hd": false
+ },
+ {
+ "ty": "fl",
+ "c": {
+ "a": 0,
+ "k": [
+ 0.854901969433,
+ 0.86274510622,
+ 0.878431379795,
+ 1
+ ],
+ "ix": 4
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 5
+ },
+ "r": 1,
+ "bm": 0,
+ "nm": "Fill 1",
+ "mn": "ADBE Vector Graphic - Fill",
+ "hd": false
+ },
+ {
+ "ty": "tr",
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "nm": "Transform"
+ }
+ ],
+ "nm": "Group 1",
+ "np": 2,
+ "cix": 2,
+ "bm": 0,
+ "ix": 1,
+ "mn": "ADBE Vector Group",
+ "hd": false
+ },
+ {
+ "ty": "tr",
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "nm": "Transform"
+ }
+ ],
+ "nm": "Group 1",
+ "np": 1,
+ "cix": 2,
+ "bm": 0,
+ "ix": 1,
+ "mn": "ADBE Vector Group",
+ "hd": false
+ }
+ ],
+ "ip": 0,
+ "op": 300,
+ "st": 0,
+ "bm": 0
+ },
+ {
+ "ddd": 0,
+ "ind": 3,
+ "ty": 4,
+ "nm": "cursor 5",
+ "sr": 1,
+ "ks": {
+ "o": {
+ "a": 1,
+ "k": [
+ {
+ "i": {
+ "x": [
+ 0.833
+ ],
+ "y": [
+ 0.833
+ ]
+ },
+ "o": {
+ "x": [
+ 0.167
+ ],
+ "y": [
+ 0.167
+ ]
+ },
+ "t": 36,
+ "s": [
+ 0
+ ]
+ },
+ {
+ "i": {
+ "x": [
+ 0.833
+ ],
+ "y": [
+ 0.833
+ ]
+ },
+ "o": {
+ "x": [
+ 0.167
+ ],
+ "y": [
+ 0.167
+ ]
+ },
+ "t": 39.582,
+ "s": [
+ 100
+ ]
+ },
+ {
+ "i": {
+ "x": [
+ 0.833
+ ],
+ "y": [
+ 0.833
+ ]
+ },
+ "o": {
+ "x": [
+ 0.167
+ ],
+ "y": [
+ 0.167
+ ]
+ },
+ "t": 44.953,
+ "s": [
+ 100
+ ]
+ },
+ {
+ "t": 55.697265625,
+ "s": [
+ 0
+ ]
+ }
+ ],
+ "ix": 11
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 207.641,
+ 154.48,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ -180.5,
+ -165.5,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "i": {
+ "x": [
+ 0,
+ 0,
+ 0
+ ],
+ "y": [
+ 1,
+ 1,
+ 1
+ ]
+ },
+ "o": {
+ "x": [
+ 0.45,
+ 0.45,
+ 0.45
+ ],
+ "y": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "t": 37.791,
+ "s": [
+ 27.252,
+ 27.252,
+ 100
+ ]
+ },
+ {
+ "t": 59,
+ "s": [
+ 56.661,
+ 56.661,
+ 100
+ ]
+ }
+ ],
+ "ix": 6
+ }
+ },
+ "ao": 0,
+ "shapes": [
+ {
+ "ty": "gr",
+ "it": [
+ {
+ "d": 1,
+ "ty": "el",
+ "s": {
+ "a": 0,
+ "k": [
+ 63.109,
+ 63.109
+ ],
+ "ix": 2
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 3
+ },
+ "nm": "Ellipse Path 1",
+ "mn": "ADBE Vector Shape - Ellipse",
+ "hd": false
+ },
+ {
+ "ty": "st",
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 0.182245725744,
+ 0.894323072246,
+ 1
+ ],
+ "ix": 3
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 4
+ },
+ "w": {
+ "a": 0,
+ "k": 3,
+ "ix": 5
+ },
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "bm": 0,
+ "nm": "Stroke 1",
+ "mn": "ADBE Vector Graphic - Stroke",
+ "hd": false
+ },
+ {
+ "ty": "fl",
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 0.522196631338,
+ 0.9762855081,
+ 1
+ ],
+ "ix": 4
+ },
+ "o": {
+ "a": 0,
+ "k": 50,
+ "ix": 5
+ },
+ "r": 1,
+ "bm": 0,
+ "nm": "Fill 1",
+ "mn": "ADBE Vector Graphic - Fill",
+ "hd": false
+ },
+ {
+ "ty": "tr",
+ "p": {
+ "a": 0,
+ "k": [
+ -180.5,
+ -165.5
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "nm": "Transform"
+ }
+ ],
+ "nm": "Ellipse 1",
+ "np": 3,
+ "cix": 2,
+ "bm": 0,
+ "ix": 1,
+ "mn": "ADBE Vector Group",
+ "hd": false
+ }
+ ],
+ "ip": 36,
+ "op": 59,
+ "st": -1,
+ "bm": 0
+ },
+ {
+ "ddd": 0,
+ "ind": 4,
+ "ty": 4,
+ "nm": "cursor 4",
+ "sr": 1,
+ "ks": {
+ "o": {
+ "a": 1,
+ "k": [
+ {
+ "i": {
+ "x": [
+ 0.833
+ ],
+ "y": [
+ 0.833
+ ]
+ },
+ "o": {
+ "x": [
+ 0.167
+ ],
+ "y": [
+ 0.167
+ ]
+ },
+ "t": 22,
+ "s": [
+ 0
+ ]
+ },
+ {
+ "i": {
+ "x": [
+ 0.833
+ ],
+ "y": [
+ 0.833
+ ]
+ },
+ "o": {
+ "x": [
+ 0.167
+ ],
+ "y": [
+ 0.167
+ ]
+ },
+ "t": 25.58,
+ "s": [
+ 100
+ ]
+ },
+ {
+ "i": {
+ "x": [
+ 0.833
+ ],
+ "y": [
+ 0.833
+ ]
+ },
+ "o": {
+ "x": [
+ 0.167
+ ],
+ "y": [
+ 0.167
+ ]
+ },
+ "t": 30.953,
+ "s": [
+ 100
+ ]
+ },
+ {
+ "t": 41.697265625,
+ "s": [
+ 0
+ ]
+ }
+ ],
+ "ix": 11
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 207.641,
+ 154.48,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ -180.5,
+ -165.5,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "i": {
+ "x": [
+ 0,
+ 0,
+ 0
+ ],
+ "y": [
+ 1,
+ 1,
+ 1
+ ]
+ },
+ "o": {
+ "x": [
+ 0.45,
+ 0.45,
+ 0.45
+ ],
+ "y": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "t": 23.789,
+ "s": [
+ 27.252,
+ 27.252,
+ 100
+ ]
+ },
+ {
+ "t": 45,
+ "s": [
+ 56.661,
+ 56.661,
+ 100
+ ]
+ }
+ ],
+ "ix": 6
+ }
+ },
+ "ao": 0,
+ "shapes": [
+ {
+ "ty": "gr",
+ "it": [
+ {
+ "d": 1,
+ "ty": "el",
+ "s": {
+ "a": 0,
+ "k": [
+ 63.109,
+ 63.109
+ ],
+ "ix": 2
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 3
+ },
+ "nm": "Ellipse Path 1",
+ "mn": "ADBE Vector Shape - Ellipse",
+ "hd": false
+ },
+ {
+ "ty": "st",
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 0.182245725744,
+ 0.894323072246,
+ 1
+ ],
+ "ix": 3
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 4
+ },
+ "w": {
+ "a": 0,
+ "k": 3,
+ "ix": 5
+ },
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "bm": 0,
+ "nm": "Stroke 1",
+ "mn": "ADBE Vector Graphic - Stroke",
+ "hd": false
+ },
+ {
+ "ty": "fl",
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 0.522196631338,
+ 0.9762855081,
+ 1
+ ],
+ "ix": 4
+ },
+ "o": {
+ "a": 0,
+ "k": 50,
+ "ix": 5
+ },
+ "r": 1,
+ "bm": 0,
+ "nm": "Fill 1",
+ "mn": "ADBE Vector Graphic - Fill",
+ "hd": false
+ },
+ {
+ "ty": "tr",
+ "p": {
+ "a": 0,
+ "k": [
+ -180.5,
+ -165.5
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "nm": "Transform"
+ }
+ ],
+ "nm": "Ellipse 1",
+ "np": 3,
+ "cix": 2,
+ "bm": 0,
+ "ix": 1,
+ "mn": "ADBE Vector Group",
+ "hd": false
+ }
+ ],
+ "ip": 22,
+ "op": 45,
+ "st": -3,
+ "bm": 0
+ },
+ {
+ "ddd": 0,
+ "ind": 5,
+ "ty": 4,
+ "nm": "cursor",
+ "sr": 1,
+ "ks": {
+ "o": {
+ "a": 1,
+ "k": [
+ {
+ "i": {
+ "x": [
+ 0.833
+ ],
+ "y": [
+ 0.833
+ ]
+ },
+ "o": {
+ "x": [
+ 0.167
+ ],
+ "y": [
+ 0.167
+ ]
+ },
+ "t": 8,
+ "s": [
+ 0
+ ]
+ },
+ {
+ "i": {
+ "x": [
+ 0.833
+ ],
+ "y": [
+ 0.833
+ ]
+ },
+ "o": {
+ "x": [
+ 0.167
+ ],
+ "y": [
+ 0.167
+ ]
+ },
+ "t": 11.582,
+ "s": [
+ 100
+ ]
+ },
+ {
+ "i": {
+ "x": [
+ 0.833
+ ],
+ "y": [
+ 0.833
+ ]
+ },
+ "o": {
+ "x": [
+ 0.167
+ ],
+ "y": [
+ 0.167
+ ]
+ },
+ "t": 16.953,
+ "s": [
+ 100
+ ]
+ },
+ {
+ "t": 27.697265625,
+ "s": [
+ 0
+ ]
+ }
+ ],
+ "ix": 11
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 207.641,
+ 154.48,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ -180.5,
+ -165.5,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 1,
+ "k": [
+ {
+ "i": {
+ "x": [
+ 0,
+ 0,
+ 0
+ ],
+ "y": [
+ 1,
+ 1,
+ 1
+ ]
+ },
+ "o": {
+ "x": [
+ 0.45,
+ 0.45,
+ 0.45
+ ],
+ "y": [
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "t": 9.791,
+ "s": [
+ 27.252,
+ 27.252,
+ 100
+ ]
+ },
+ {
+ "t": 31,
+ "s": [
+ 56.661,
+ 56.661,
+ 100
+ ]
+ }
+ ],
+ "ix": 6
+ }
+ },
+ "ao": 0,
+ "shapes": [
+ {
+ "ty": "gr",
+ "it": [
+ {
+ "d": 1,
+ "ty": "el",
+ "s": {
+ "a": 0,
+ "k": [
+ 63.109,
+ 63.109
+ ],
+ "ix": 2
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 3
+ },
+ "nm": "Ellipse Path 1",
+ "mn": "ADBE Vector Shape - Ellipse",
+ "hd": false
+ },
+ {
+ "ty": "st",
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 0.182245725744,
+ 0.894323072246,
+ 1
+ ],
+ "ix": 3
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 4
+ },
+ "w": {
+ "a": 0,
+ "k": 3,
+ "ix": 5
+ },
+ "lc": 1,
+ "lj": 1,
+ "ml": 4,
+ "bm": 0,
+ "nm": "Stroke 1",
+ "mn": "ADBE Vector Graphic - Stroke",
+ "hd": false
+ },
+ {
+ "ty": "fl",
+ "c": {
+ "a": 0,
+ "k": [
+ 1,
+ 0.522196631338,
+ 0.9762855081,
+ 1
+ ],
+ "ix": 4
+ },
+ "o": {
+ "a": 0,
+ "k": 50,
+ "ix": 5
+ },
+ "r": 1,
+ "bm": 0,
+ "nm": "Fill 1",
+ "mn": "ADBE Vector Graphic - Fill",
+ "hd": false
+ },
+ {
+ "ty": "tr",
+ "p": {
+ "a": 0,
+ "k": [
+ -180.5,
+ -165.5
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 0,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100
+ ],
+ "ix": 3
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 6
+ },
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 7
+ },
+ "sk": {
+ "a": 0,
+ "k": 0,
+ "ix": 4
+ },
+ "sa": {
+ "a": 0,
+ "k": 0,
+ "ix": 5
+ },
+ "nm": "Transform"
+ }
+ ],
+ "nm": "Ellipse 1",
+ "np": 3,
+ "cix": 2,
+ "bm": 0,
+ "ix": 1,
+ "mn": "ADBE Vector Group",
+ "hd": false
+ }
+ ],
+ "ip": 8,
+ "op": 31,
+ "st": -5,
+ "bm": 0
+ },
+ {
+ "ddd": 0,
+ "ind": 6,
+ "ty": 0,
+ "nm": "BG_White",
+ "refId": "comp_0",
+ "sr": 1,
+ "ks": {
+ "o": {
+ "a": 0,
+ "k": 100,
+ "ix": 11
+ },
+ "r": {
+ "a": 0,
+ "k": 0,
+ "ix": 10
+ },
+ "p": {
+ "a": 0,
+ "k": [
+ 206,
+ 150,
+ 0
+ ],
+ "ix": 2
+ },
+ "a": {
+ "a": 0,
+ "k": [
+ 206,
+ 150,
+ 0
+ ],
+ "ix": 1
+ },
+ "s": {
+ "a": 0,
+ "k": [
+ 100,
+ 100,
+ 100
+ ],
+ "ix": 6
+ }
+ },
+ "ao": 0,
+ "w": 412,
+ "h": 300,
+ "ip": 0,
+ "op": 1800,
+ "st": 0,
+ "bm": 0
+ }
+ ],
+ "markers": []
+}
\ No newline at end of file
diff --git a/src/com/android/settings/accessibility/AccessibilityDialogUtils.java b/src/com/android/settings/accessibility/AccessibilityDialogUtils.java
index a9ba14a7646..b353805bdba 100644
--- a/src/com/android/settings/accessibility/AccessibilityDialogUtils.java
+++ b/src/com/android/settings/accessibility/AccessibilityDialogUtils.java
@@ -31,6 +31,7 @@ import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.method.LinkMovementMethod;
import android.text.style.ImageSpan;
+import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AbsListView;
@@ -44,9 +45,11 @@ import android.widget.ScrollView;
import android.widget.TextView;
import androidx.annotation.ColorInt;
+import androidx.annotation.DrawableRes;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
+import androidx.annotation.RawRes;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
@@ -54,6 +57,9 @@ import com.android.settings.R;
import com.android.settings.core.SubSettingLauncher;
import com.android.settings.utils.AnnotationSpan;
+import com.airbnb.lottie.LottieAnimationView;
+import com.airbnb.lottie.LottieDrawable;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.List;
@@ -63,6 +69,7 @@ import java.util.List;
* Utility class for creating the edit dialog.
*/
public class AccessibilityDialogUtils {
+ private static final String TAG = "AccessibilityDialogUtils";
/** Denotes the dialog emuns for show dialog. */
@Retention(RetentionPolicy.SOURCE)
@@ -315,9 +322,22 @@ public class AccessibilityDialogUtils {
}
private static void setupShortcutWidget(View view, CharSequence titleText,
- CharSequence summaryText, int imageResId) {
+ CharSequence summaryText, @DrawableRes int imageResId) {
+ setupShortcutWidgetWithTitleAndSummary(view, titleText, summaryText);
+ setupShortcutWidgetWithImageResource(view, imageResId);
+ }
+
+ private static void setupShortcutWidgetWithImageRawResource(View view, CharSequence titleText,
+ CharSequence summaryText, @RawRes int imageRawResId) {
+ setupShortcutWidgetWithTitleAndSummary(view, titleText, summaryText);
+ setupShortcutWidgetWithImageRawResource(view, imageRawResId);
+ }
+
+ private static void setupShortcutWidgetWithTitleAndSummary(View view, CharSequence titleText,
+ CharSequence summaryText) {
final CheckBox checkBox = view.findViewById(R.id.checkbox);
checkBox.setText(titleText);
+
final TextView summary = view.findViewById(R.id.summary);
if (TextUtils.isEmpty(summaryText)) {
summary.setVisibility(View.GONE);
@@ -326,8 +346,23 @@ public class AccessibilityDialogUtils {
summary.setMovementMethod(LinkMovementMethod.getInstance());
summary.setFocusable(false);
}
- final ImageView image = view.findViewById(R.id.image);
- image.setImageResource(imageResId);
+ }
+
+ private static void setupShortcutWidgetWithImageResource(View view,
+ @DrawableRes int imageResId) {
+ final ImageView imageView = view.findViewById(R.id.image);
+ imageView.setImageResource(imageResId);
+ }
+
+ private static void setupShortcutWidgetWithImageRawResource(View view,
+ @RawRes int imageRawResId) {
+ final LottieAnimationView lottieView = view.findViewById(R.id.image);
+ lottieView.setFailureListener(
+ result -> Log.w(TAG, "Invalid image raw resource id: " + imageRawResId,
+ result));
+ lottieView.setAnimation(imageRawResId);
+ lottieView.setRepeatCount(LottieDrawable.INFINITE);
+ lottieView.playAnimation();
}
private static void initSoftwareShortcutForSUW(Context context, View view) {
@@ -361,7 +396,6 @@ public class AccessibilityDialogUtils {
R.string.accessibility_shortcut_edit_dialog_summary_hardware);
setupShortcutWidget(dialogView, title, summary,
R.drawable.accessibility_shortcut_type_hardware);
- // TODO(b/142531156): Use vector drawable instead of temporal png file to avoid distorted.
}
private static void initMagnifyShortcut(Context context, View view) {
@@ -374,9 +408,8 @@ public class AccessibilityDialogUtils {
final Object[] arguments = {3};
summary = MessageFormat.format(summary, arguments);
- setupShortcutWidget(dialogView, title, summary,
- R.drawable.accessibility_shortcut_type_triple_tap);
- // TODO(b/142531156): Use vector drawable instead of temporal png file to avoid distorted.
+ setupShortcutWidgetWithImageRawResource(dialogView, title, summary,
+ R.raw.accessibility_shortcut_type_triple_tap);
}
private static void initAdvancedWidget(View view) {
diff --git a/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java b/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java
index bc2e05d3258..09f28d72c9b 100644
--- a/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java
+++ b/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java
@@ -29,12 +29,14 @@ import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.style.ImageSpan;
+import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.TextureView;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
+import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextSwitcher;
@@ -42,8 +44,10 @@ import android.widget.TextView;
import androidx.annotation.AnimRes;
import androidx.annotation.ColorInt;
+import androidx.annotation.DrawableRes;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
+import androidx.annotation.RawRes;
import androidx.annotation.VisibleForTesting;
import androidx.appcompat.app.AlertDialog;
import androidx.core.content.ContextCompat;
@@ -54,6 +58,9 @@ import androidx.viewpager.widget.ViewPager;
import com.android.settings.R;
+import com.airbnb.lottie.LottieAnimationView;
+import com.airbnb.lottie.LottieDrawable;
+
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
@@ -64,6 +71,8 @@ import java.util.List;
* accessibility services.
*/
public final class AccessibilityGestureNavigationTutorial {
+ private static final String TAG = "AccessibilityGestureNavigationTutorial";
+
/** IntDef enum for dialog type. */
@Retention(RetentionPolicy.SOURCE)
@IntDef({
@@ -239,7 +248,7 @@ public final class AccessibilityGestureNavigationTutorial {
@NonNull
@Override
public Object instantiateItem(@NonNull ViewGroup container, int position) {
- final View itemView = mTutorialPages.get(position).getImageView();
+ final View itemView = mTutorialPages.get(position).getIllustrationView();
container.addView(itemView);
return itemView;
}
@@ -257,7 +266,7 @@ public final class AccessibilityGestureNavigationTutorial {
@Override
public void destroyItem(@NonNull ViewGroup container, int position,
@NonNull Object object) {
- final View itemView = mTutorialPages.get(position).getImageView();
+ final View itemView = mTutorialPages.get(position).getIllustrationView();
container.removeView(itemView);
}
}
@@ -270,6 +279,34 @@ public final class AccessibilityGestureNavigationTutorial {
return imageView;
}
+ private static View createIllustrationView(Context context, @DrawableRes int imageRes) {
+ final View illustrationFrame = inflateAndInitIllustrationFrame(context);
+ final LottieAnimationView lottieView = illustrationFrame.findViewById(R.id.image);
+ lottieView.setImageResource(imageRes);
+
+ return illustrationFrame;
+ }
+
+ private static View createIllustrationViewWithImageRawResource(Context context,
+ @RawRes int imageRawRes) {
+ final View illustrationFrame = inflateAndInitIllustrationFrame(context);
+ final LottieAnimationView lottieView = illustrationFrame.findViewById(R.id.image);
+ lottieView.setFailureListener(
+ result -> Log.w(TAG, "Invalid image raw resource id: " + imageRawRes,
+ result));
+ lottieView.setAnimation(imageRawRes);
+ lottieView.setRepeatCount(LottieDrawable.INFINITE);
+ lottieView.playAnimation();
+
+ return illustrationFrame;
+ }
+
+ private static View inflateAndInitIllustrationFrame(Context context) {
+ final LayoutInflater inflater = context.getSystemService(LayoutInflater.class);
+
+ return inflater.inflate(R.layout.accessibility_lottie_animation_view, /* root= */ null);
+ }
+
private static View createShortcutNavigationContentView(Context context, int shortcutTypes) {
final LayoutInflater inflater = context.getSystemService(LayoutInflater.class);
final View contentView = inflater.inflate(
@@ -325,7 +362,7 @@ public final class AccessibilityGestureNavigationTutorial {
private static TutorialPage createSoftwareTutorialPage(@NonNull Context context) {
final CharSequence title = getSoftwareTitle(context);
- final ImageView image = createSoftwareImage(context);
+ final View image = createSoftwareImage(context);
final CharSequence instruction = getSoftwareInstruction(context);
final ImageView indicatorIcon =
createImageView(context, R.drawable.ic_accessibility_page_indicator);
@@ -337,8 +374,8 @@ public final class AccessibilityGestureNavigationTutorial {
private static TutorialPage createHardwareTutorialPage(@NonNull Context context) {
final CharSequence title =
context.getText(R.string.accessibility_tutorial_dialog_title_volume);
- final ImageView image =
- createImageView(context, R.drawable.accessibility_shortcut_type_hardware);
+ final View image =
+ createIllustrationView(context, R.drawable.accessibility_shortcut_type_hardware);
final ImageView indicatorIcon =
createImageView(context, R.drawable.ic_accessibility_page_indicator);
final CharSequence instruction =
@@ -351,8 +388,9 @@ public final class AccessibilityGestureNavigationTutorial {
private static TutorialPage createTripleTapTutorialPage(@NonNull Context context) {
final CharSequence title =
context.getText(R.string.accessibility_tutorial_dialog_title_triple);
- final ImageView image =
- createImageView(context, R.drawable.accessibility_shortcut_type_triple_tap);
+ final View image =
+ createIllustrationViewWithImageRawResource(context,
+ R.raw.accessibility_shortcut_type_triple_tap);
final CharSequence instruction =
context.getText(R.string.accessibility_tutorial_dialog_message_triple);
final ImageView indicatorIcon =
@@ -381,7 +419,7 @@ public final class AccessibilityGestureNavigationTutorial {
return tutorialPages;
}
- private static ImageView createSoftwareImage(Context context) {
+ private static View createSoftwareImage(Context context) {
int resId;
if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
resId = R.drawable.accessibility_shortcut_type_software_floating;
@@ -392,7 +430,7 @@ public final class AccessibilityGestureNavigationTutorial {
} else {
resId = R.drawable.accessibility_shortcut_type_software;
}
- return createImageView(context, resId);
+ return createIllustrationView(context, resId);
}
private static CharSequence getSoftwareTitle(Context context) {
@@ -444,24 +482,26 @@ public final class AccessibilityGestureNavigationTutorial {
private static class TutorialPage {
private final CharSequence mTitle;
- private final ImageView mImageView;
+ private final View mIllustrationView;
private final ImageView mIndicatorIcon;
private final CharSequence mInstruction;
- TutorialPage(CharSequence title, ImageView imageView, ImageView indicatorIcon,
+ TutorialPage(CharSequence title, View illustrationView, ImageView indicatorIcon,
CharSequence instruction) {
this.mTitle = title;
- this.mImageView = imageView;
+ this.mIllustrationView = illustrationView;
this.mIndicatorIcon = indicatorIcon;
this.mInstruction = instruction;
+
+ setupIllustrationChildViewsGravity();
}
public CharSequence getTitle() {
return mTitle;
}
- public ImageView getImageView() {
- return mImageView;
+ public View getIllustrationView() {
+ return mIllustrationView;
}
public ImageView getIndicatorIcon() {
@@ -471,6 +511,23 @@ public final class AccessibilityGestureNavigationTutorial {
public CharSequence getInstruction() {
return mInstruction;
}
+
+ private void setupIllustrationChildViewsGravity() {
+ final View backgroundView = mIllustrationView.findViewById(R.id.image_background);
+ initViewGravity(backgroundView);
+
+ final View lottieView = mIllustrationView.findViewById(R.id.image);
+ initViewGravity(lottieView);
+ }
+
+ private void initViewGravity(@NonNull View view) {
+ final FrameLayout.LayoutParams layoutParams =
+ new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT,
+ FrameLayout.LayoutParams.WRAP_CONTENT);
+ layoutParams.gravity = Gravity.CENTER;
+
+ view.setLayoutParams(layoutParams);
+ }
}
private static class TutorialPageChangeListener implements ViewPager.OnPageChangeListener {