Merge "Fix memory leak in TopLevelBatteryPreferenceController" am: 060bf953e3 am: f5876a1df9 am: 9cfd6a6164
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1606501
Change-Id: I9d3f933e3fa5c68e34e97f9b4191022c5d0aee8b
diff --git a/res/drawable-night/accessibility_captions_banner.xml b/res/drawable-night/accessibility_captions_banner.xml
new file mode 100644
index 0000000..7ee30f2
--- /dev/null
+++ b/res/drawable-night/accessibility_captions_banner.xml
@@ -0,0 +1,52 @@
+<?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.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="412dp"
+ android:height="300dp"
+ android:viewportWidth="412"
+ android:viewportHeight="300">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M383.9,300H28.1C12.6,300 0,287.4 0,271.9V28.1C0,12.6 12.6,0 28.1,0h355.8C399.4,0 412,12.6 412,28.1v243.8C412,287.4 399.4,300 383.9,300z"/>
+ <path
+ android:pathData="M79.2,179.6h53.6v8.5h-53.6z"
+ android:fillColor="#669DF6"/>
+ <path
+ android:pathData="M142.5,179.6h30.4v8.5h-30.4z"
+ android:fillColor="#669DF6"/>
+ <path
+ android:pathData="M79.2,195.5h79.2v8.5h-79.2z"
+ android:fillColor="#669DF6"/>
+ <path
+ android:pathData="M168.1,195.5h34.1v8.5h-34.1z"
+ android:fillColor="#669DF6"/>
+ <path
+ android:pathData="M211.9,195.5h34.1v8.5h-34.1z"
+ android:fillColor="#669DF6"/>
+ <path
+ android:pathData="M182.7,179.6h73.1v8.5h-73.1z"
+ android:fillColor="#669DF6"/>
+ <path
+ android:pathData="M265.5,179.6h26.8v8.5h-26.8z"
+ android:fillColor="#669DF6"/>
+ <path
+ android:pathData="M302.1,179.6h26.8v8.5h-26.8z"
+ android:fillColor="#669DF6"/>
+ <path
+ android:pathData="M142.7,67.9h-11.5c-1.6,0 -2.9,1.3 -2.9,2.9H67.8c-7.9,0 -14.4,6.5 -14.4,14.4v132.4c0,7.9 6.5,14.4 14.4,14.4h276.4c7.9,0 14.4,-6.5 14.4,-14.4V85.2c0,-7.9 -6.5,-14.4 -14.4,-14.4H203.1c0,-1.6 -1.3,-2.9 -2.9,-2.9h-28.8c-1.6,0 -2.9,1.3 -2.9,2.9h-23C145.5,69.2 144.3,67.9 142.7,67.9zM344.2,73.7c6.4,0 11.5,5.2 11.5,11.5v132.4c0,6.3 -5.2,11.5 -11.5,11.5H67.8c-6.4,0 -11.5,-5.2 -11.5,-11.5V85.2c0,-6.3 5.2,-11.5 11.5,-11.5H344.2z"
+ android:fillColor="#80868B"/>
+</vector>
diff --git a/res/drawable-night/ic_illustration_fullscreen.xml b/res/drawable-night/ic_illustration_fullscreen.xml
new file mode 100644
index 0000000..c5f1f92
--- /dev/null
+++ b/res/drawable-night/ic_illustration_fullscreen.xml
@@ -0,0 +1,211 @@
+<?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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="412dp"
+ android:height="300dp"
+ android:viewportWidth="412"
+ android:viewportHeight="300">
+ <path
+ android:pathData="M-83.4,-43h-356.4c-15.3,0 -27.8,-12.8 -27.8,-28.5v-243c0,-15.7 12.5,-28.5 27.8,-28.5h356.5c15.2,0 27.7,12.8 27.7,28.5v243.2C-55.6,-55.8 -68.1,-43 -83.4,-43z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M-260.2,-323.9c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6s-13.6,67.9 -38.4,92.6c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4c-24.7,-24.8 -38.4,-57.7 -38.4,-92.7s13.6,-67.9 38.4,-92.6C-328.1,-310.3 -295.2,-323.9 -260.2,-323.9M-260.2,-325.9c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S-186.8,-325.9 -260.2,-325.9L-260.2,-325.9z"
+ android:fillColor="#E8EAED"/>
+ <path
+ android:pathData="M-205.5,-235.3v-7.7c0,-1.1 -0.9,-1.9 -1.9,-1.9v-40.4c0,-5.3 -4.3,-9.6 -9.6,-9.6h-88.5c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C-206.4,-233.4 -205.5,-234.3 -205.5,-235.3zM-209.4,-100.6c0,4.2 -3.5,7.7 -7.7,7.7h-88.5c-4.2,0 -7.7,-3.5 -7.7,-7.7v-184.8c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V-100.6z"
+ android:fillColor="#DADCE0"/>
+ <path
+ android:pathData="M-217.1,-224.1c2,0 3.7,1.7 3.7,3.7v54.8c0,2 -1.7,3.7 -3.7,3.7h-88.5c-2,0 -3.7,-1.7 -3.7,-3.7v-54.8c0,-2 1.7,-3.7 3.7,-3.7H-217.1M-217.1,-228.1h-88.5c-4.2,0 -7.7,3.5 -7.7,7.7v54.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7v-54.8C-209.4,-224.6 -212.8,-228.1 -217.1,-228.1L-217.1,-228.1z"
+ android:fillColor="#F9AB00"/>
+ <path
+ android:pathData="M-230.7,-217.4l11,0l0,11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M-219.7,-217.4L-235.3,-201.8"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M-292.4,-167.9l-10.9,0l0,-11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M-303.3,-167.9L-287.7,-183.5"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M384.2,-43H27.8C12.5,-43 0,-55.8 0,-71.5v-243C0,-330.2 12.5,-343 27.8,-343h356.5c15.2,0 27.7,12.8 27.7,28.5v243.2C412,-55.8 399.5,-43 384.2,-43z"/>
+ <path
+ android:pathData="M207.4,-323.9c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6S324.8,-125 300,-100.3c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4C90.1,-125.1 76.4,-158 76.4,-193s13.6,-67.9 38.4,-92.6C139.5,-310.3 172.4,-323.9 207.4,-323.9M207.4,-325.9c-73.4,0 -133,59.5 -133,132.9S133.9,-60.1 207.3,-60.1s133,-59.5 133,-132.9S280.8,-325.9 207.4,-325.9L207.4,-325.9z"
+ android:fillColor="#3C4043"/>
+ <path
+ android:pathData="M262.1,-235.3v-7.7c0,-1.1 -0.9,-1.9 -1.9,-1.9v-40.4c0,-5.3 -4.3,-9.6 -9.6,-9.6H162c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C261.2,-233.4 262.1,-234.3 262.1,-235.3zM258.2,-100.6c0,4.2 -3.5,7.7 -7.7,7.7H162c-4.2,0 -7.7,-3.5 -7.7,-7.7v-184.8c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V-100.6z"
+ android:fillColor="#80868B"/>
+ <path
+ android:pathData="M250.5,-224.1c2,0 3.7,1.7 3.7,3.7v54.8c0,2 -1.7,3.7 -3.7,3.7H162c-2,0 -3.7,-1.7 -3.7,-3.7v-54.8c0,-2 1.7,-3.7 3.7,-3.7H250.5M250.5,-228.1H162c-4.2,0 -7.7,3.5 -7.7,7.7v54.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7v-54.8C258.2,-224.6 254.8,-228.1 250.5,-228.1L250.5,-228.1z"
+ android:fillColor="#FCC934"/>
+ <path
+ android:pathData="M236.9,-217.4l11,0l0,11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M247.9,-217.4L232.3,-201.8"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M175.2,-167.9l-10.9,0l0,-11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M164.3,-167.9L179.9,-183.5"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M384.2,650.3H27.8C12.5,650.3 0,637.5 0,621.8v-243c0,-15.7 12.5,-28.5 27.8,-28.5h356.5c15.2,0 27.7,12.8 27.7,28.5V622C412,637.5 399.5,650.3 384.2,650.3z"/>
+ <path
+ android:pathData="M207.4,369.4c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6c0,35 -13.6,67.9 -38.4,92.6c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4c-24.7,-24.8 -38.4,-57.7 -38.4,-92.7s13.6,-67.9 38.4,-92.6C139.5,383 172.4,369.4 207.4,369.4M207.4,367.4c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S280.8,367.4 207.4,367.4L207.4,367.4z"
+ android:fillColor="#3C4043"/>
+ <path
+ android:pathData="M262.1,458v-7.7c0,-1.1 -0.9,-1.9 -1.9,-1.9V408c0,-5.3 -4.3,-9.6 -9.6,-9.6H162c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C261.2,459.9 262.1,459.1 262.1,458zM258.2,592.7c0,4.2 -3.5,7.7 -7.7,7.7H162c-4.2,0 -7.7,-3.5 -7.7,-7.7V408c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V592.7z"
+ android:fillColor="#80868B"/>
+ <path
+ android:pathData="M250.5,404.3c2,0 3.7,1.7 3.7,3.7v184.8c0,2 -1.7,3.7 -3.7,3.7H162c-2,0 -3.7,-1.7 -3.7,-3.7V408c0,-2 1.7,-3.7 3.7,-3.7H250.5M250.5,400.3H162c-4.2,0 -7.7,3.5 -7.7,7.7v184.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7V408C258.2,403.7 254.8,400.3 250.5,400.3L250.5,400.3z"
+ android:fillColor="#FCC934"/>
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M384.2,300H27.8C12.5,300 0,287.2 0,271.5v-243C0,12.8 12.5,0 27.8,0h356.5C399.5,0 412,12.8 412,28.5v243.2C412,287.2 399.5,300 384.2,300z"/>
+ <path
+ android:pathData="M207.4,19.1c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6S324.8,218 300,242.7c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4C90.1,217.9 76.4,185 76.4,150S90,82.1 114.8,57.4C139.5,32.7 172.4,19.1 207.4,19.1M207.4,17.1c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S280.8,17.1 207.4,17.1L207.4,17.1z"
+ android:fillColor="#3C4043"/>
+ <path
+ android:pathData="M262.1,107.7V100c0,-1.1 -0.9,-1.9 -1.9,-1.9V57.6c0,-5.3 -4.3,-9.6 -9.6,-9.6H162c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C261.2,109.6 262.1,108.7 262.1,107.7zM258.2,242.4c0,4.2 -3.5,7.7 -7.7,7.7H162c-4.2,0 -7.7,-3.5 -7.7,-7.7V57.6c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V242.4z"
+ android:fillColor="#80868B"/>
+ <path
+ android:pathData="M250.5,53.9c2,0 3.7,1.7 3.7,3.7v184.8c0,2 -1.7,3.7 -3.7,3.7H162c-2,0 -3.7,-1.7 -3.7,-3.7V57.6c0,-2 1.7,-3.7 3.7,-3.7H250.5M250.5,49.9H162c-4.2,0 -7.7,3.5 -7.7,7.7v184.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7V57.6C258.2,53.4 254.8,49.9 250.5,49.9L250.5,49.9z"
+ android:fillColor="#FCC934"/>
+ <path
+ android:pathData="M236.9,60.6l11,0l0,11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M247.9,60.6L232.3,76.2"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M175.2,240.1l-10.9,0l0,-11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M164.3,240.1L179.9,224.5"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M-83.4,300h-356.4c-15.3,0 -27.8,-12.8 -27.8,-28.5v-243c0,-15.7 12.5,-28.5 27.8,-28.5h356.5c15.2,0 27.7,12.8 27.7,28.5v243.2C-55.6,287.2 -68.1,300 -83.4,300z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M-260.2,19.1c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6s-13.6,67.9 -38.4,92.6c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4c-24.7,-24.8 -38.4,-57.7 -38.4,-92.7s13.6,-67.9 38.4,-92.6C-328.1,32.7 -295.2,19.1 -260.2,19.1M-260.2,17.1c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S-186.8,17.1 -260.2,17.1L-260.2,17.1z"
+ android:fillColor="#E8EAED"/>
+ <path
+ android:pathData="M-205.5,107.7V100c0,-1.1 -0.9,-1.9 -1.9,-1.9V57.6c0,-5.3 -4.3,-9.6 -9.6,-9.6h-88.5c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C-206.4,109.6 -205.5,108.7 -205.5,107.7zM-209.4,242.4c0,4.2 -3.5,7.7 -7.7,7.7h-88.5c-4.2,0 -7.7,-3.5 -7.7,-7.7V57.6c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V242.4z"
+ android:fillColor="#DADCE0"/>
+ <path
+ android:pathData="M-217.1,53.9c2,0 3.7,1.7 3.7,3.7v184.8c0,2 -1.7,3.7 -3.7,3.7h-88.5c-2,0 -3.7,-1.7 -3.7,-3.7V57.6c0,-2 1.7,-3.7 3.7,-3.7H-217.1M-217.1,49.9h-88.5c-4.2,0 -7.7,3.5 -7.7,7.7v184.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7V57.6C-209.4,53.4 -212.8,49.9 -217.1,49.9L-217.1,49.9z"
+ android:fillColor="#F9AB00"/>
+ <path
+ android:pathData="M-230.7,60.6l11,0l0,11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M-219.7,60.6L-235.3,76.2"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M-292.4,240.1l-10.9,0l0,-11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M-303.3,240.1L-287.7,224.5"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M242.2,574.2h-13.9v10.4h13.9V574.2zM245.7,560.3h-31.3c-1.9,0 -3.5,1.5 -3.5,3.4v24.4c0,1.9 1.6,3.5 3.5,3.5h31.3c1.9,0 3.5,-1.6 3.5,-3.5v-24.4C249.1,561.8 247.6,560.3 245.7,560.3zM245.7,588.2h-31.3v-24.5h31.3V588.2z"
+ android:fillColor="#DADCE0"/>
+ <path
+ android:pathData="M-83.4,650.3h-356.4c-15.3,0 -27.8,-12.8 -27.8,-28.5v-243c0,-15.7 12.5,-28.5 27.8,-28.5h356.5c15.2,0 27.7,12.8 27.7,28.5V622C-55.6,637.5 -68.1,650.3 -83.4,650.3z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M-260.2,369.4c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6c0,35 -13.6,67.9 -38.4,92.6c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4c-24.7,-24.8 -38.4,-57.7 -38.4,-92.7s13.6,-67.9 38.4,-92.6C-328.1,383 -295.2,369.4 -260.2,369.4M-260.2,367.4c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S-186.8,367.4 -260.2,367.4L-260.2,367.4z"
+ android:fillColor="#E8EAED"/>
+ <path
+ android:pathData="M-205.5,458v-7.7c0,-1.1 -0.9,-1.9 -1.9,-1.9V408c0,-5.3 -4.3,-9.6 -9.6,-9.6h-88.5c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C-206.4,459.9 -205.5,459.1 -205.5,458zM-209.4,592.7c0,4.2 -3.5,7.7 -7.7,7.7h-88.5c-4.2,0 -7.7,-3.5 -7.7,-7.7V408c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V592.7z"
+ android:fillColor="#DADCE0"/>
+ <path
+ android:pathData="M-217.1,404.3c2,0 3.7,1.7 3.7,3.7v184.8c0,2 -1.7,3.7 -3.7,3.7h-88.5c-2,0 -3.7,-1.7 -3.7,-3.7V408c0,-2 1.7,-3.7 3.7,-3.7H-217.1M-217.1,400.3h-88.5c-4.2,0 -7.7,3.5 -7.7,7.7v184.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7V408C-209.4,403.7 -212.8,400.3 -217.1,400.3L-217.1,400.3z"
+ android:fillColor="#F9AB00"/>
+ <path
+ android:pathData="M-225.4,574.2h-13.9v10.4h13.9V574.2zM-221.9,560.3h-31.3c-1.9,0 -3.5,1.5 -3.5,3.4v24.4c0,1.9 1.6,3.5 3.5,3.5h31.3c1.9,0 3.5,-1.6 3.5,-3.5v-24.4C-218.4,561.8 -220,560.3 -221.9,560.3zM-221.9,588.2h-31.3v-24.5h31.3V588.2z"
+ android:fillColor="#5F6368"/>
+</vector>
diff --git a/res/drawable-night/ic_illustration_switch.xml b/res/drawable-night/ic_illustration_switch.xml
new file mode 100644
index 0000000..9cabced
--- /dev/null
+++ b/res/drawable-night/ic_illustration_switch.xml
@@ -0,0 +1,42 @@
+<?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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="412dp"
+ android:height="300dp"
+ android:viewportWidth="412"
+ android:viewportHeight="300">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M384.2,300H27.8C12.5,300 0,287.2 0,271.5v-243C0,12.8 12.5,0 27.8,0h356.5C399.5,0 412,12.8 412,28.5v243.2C412,287.2 399.5,300 384.2,300z"/>
+ <path
+ android:pathData="M207.4,19.1c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6S324.8,218 300,242.7c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4C90.1,217.9 76.4,185 76.4,150S90,82.1 114.8,57.4C139.5,32.7 172.4,19.1 207.4,19.1M207.4,17.1c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S280.8,17.1 207.4,17.1L207.4,17.1z"
+ android:fillColor="#3C4043"/>
+ <path
+ android:pathData="M262.1,107.7V100c0,-1.1 -0.9,-1.9 -1.9,-1.9V57.6c0,-5.3 -4.3,-9.6 -9.6,-9.6H162c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C261.2,109.6 262.1,108.7 262.1,107.7zM258.2,242.4c0,4.2 -3.5,7.7 -7.7,7.7H162c-4.2,0 -7.7,-3.5 -7.7,-7.7V57.6c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V242.4z"
+ android:fillColor="#80868B"/>
+ <path
+ android:pathData="M250.5,53.9c2,0 3.7,1.7 3.7,3.7v184.8c0,2 -1.7,3.7 -3.7,3.7H162c-2,0 -3.7,-1.7 -3.7,-3.7V57.6c0,-2 1.7,-3.7 3.7,-3.7H250.5M250.5,49.9H162c-4.2,0 -7.7,3.5 -7.7,7.7v184.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7V57.6C258.2,53.4 254.8,49.9 250.5,49.9L250.5,49.9z"
+ android:fillColor="#FCC934"/>
+ <path
+ android:pathData="M214.2,223.8v17.5h34.9v-34.9h-17.5v3.5h14v27.9h-27.9v-14H214.2z"
+ android:fillColor="#DADCE0"/>
+ <path
+ android:pathData="M228.2,206.3h-14v14h14V206.3z"
+ android:fillColor="#DADCE0"/>
+ <path
+ android:pathData="M242.2,222.1v3.5h-6.3l7.9,7.9l-2.5,2.5l-7.9,-7.9v6.3h-3.5v-12.2H242.2z"
+ android:fillColor="#DADCE0"/>
+</vector>
diff --git a/res/drawable-night/ic_illustration_window.xml b/res/drawable-night/ic_illustration_window.xml
new file mode 100644
index 0000000..7984df5
--- /dev/null
+++ b/res/drawable-night/ic_illustration_window.xml
@@ -0,0 +1,61 @@
+<?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.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="412dp"
+ android:height="300dp"
+ android:viewportWidth="412"
+ android:viewportHeight="300">
+ <path
+ android:fillColor="#FF000000"
+ android:pathData="M384.2,300H27.8C12.5,300 0,287.2 0,271.5v-243C0,12.8 12.5,0 27.8,0h356.5C399.5,0 412,12.8 412,28.5v243.2C412,287.2 399.5,300 384.2,300z"/>
+ <path
+ android:pathData="M207.4,19.1c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6S324.8,218 300,242.7c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4C90.1,217.9 76.4,185 76.4,150S90,82.1 114.8,57.4C139.5,32.7 172.4,19.1 207.4,19.1M207.4,17.1c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S280.8,17.1 207.4,17.1L207.4,17.1z"
+ android:fillColor="#3C4043"/>
+ <path
+ android:pathData="M262.1,107.7V100c0,-1.1 -0.9,-1.9 -1.9,-1.9V57.6c0,-5.3 -4.3,-9.6 -9.6,-9.6H162c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C261.2,109.6 262.1,108.7 262.1,107.7zM258.2,242.4c0,4.2 -3.5,7.7 -7.7,7.7H162c-4.2,0 -7.7,-3.5 -7.7,-7.7V57.6c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V242.4z"
+ android:fillColor="#80868B"/>
+ <path
+ android:pathData="M250.5,118.9c2,0 3.7,1.7 3.7,3.7v54.8c0,2 -1.7,3.7 -3.7,3.7H162c-2,0 -3.7,-1.7 -3.7,-3.7v-54.8c0,-2 1.7,-3.7 3.7,-3.7H250.5M250.5,114.9H162c-4.2,0 -7.7,3.5 -7.7,7.7v54.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7v-54.8C258.2,118.4 254.8,114.9 250.5,114.9L250.5,114.9z"
+ android:fillColor="#FCC934"/>
+ <path
+ android:pathData="M236.9,125.6l11,0l0,11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M247.9,125.6L232.3,141.2"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M175.2,175.1l-10.9,0l0,-11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M164.3,175.1L179.9,159.5"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#FCC934"
+ android:strokeLineCap="round"/>
+</vector>
diff --git a/res/drawable/accessibility_button_preview_three_finger.xml b/res/drawable/accessibility_button_preview_three_finger.xml
new file mode 100644
index 0000000..0fe6710
--- /dev/null
+++ b/res/drawable/accessibility_button_preview_three_finger.xml
@@ -0,0 +1,40 @@
+<?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.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="125dp"
+ android:height="153dp"
+ android:viewportWidth="125"
+ android:viewportHeight="153">
+ <path
+ android:pathData="M0,0h125v153h-125z"
+ android:fillColor="#ffffff"/>
+ <path
+ android:pathData="M41.266,134.754L84.047,134.754A1.735,1.735 0,0 1,85.781 136.489L85.781,136.489A1.735,1.735 0,0 1,84.047 138.223L41.266,138.223A1.735,1.735 0,0 1,39.531 136.489L39.531,136.489A1.735,1.735 0,0 1,41.266 134.754z"
+ android:fillColor="#DADCE0"/>
+ <path
+ android:pathData="M48.359,107L54.719,119.721H50.672V131.87C52.385,132.722 53.563,134.49 53.563,136.533C53.563,139.407 51.233,141.737 48.359,141.737C45.486,141.737 43.156,139.407 43.156,136.533C43.156,134.49 44.333,132.722 46.047,131.87V119.721H42L48.359,107Z"
+ android:fillColor="#1A73E8"
+ android:fillType="evenOdd"/>
+ <path
+ android:pathData="M62.703,107L69.063,119.721H65.016V131.87C66.729,132.722 67.906,134.49 67.906,136.533C67.906,139.407 65.577,141.737 62.703,141.737C59.829,141.737 57.5,139.407 57.5,136.533C57.5,134.49 58.677,132.722 60.39,131.87V119.721H56.344L62.703,107Z"
+ android:fillColor="#1A73E8"
+ android:fillType="evenOdd"/>
+ <path
+ android:pathData="M76.891,107L83.25,119.721H79.203V131.87C80.916,132.722 82.094,134.49 82.094,136.533C82.094,139.407 79.764,141.737 76.891,141.737C74.017,141.737 71.688,139.407 71.688,136.533C71.688,134.49 72.865,132.722 74.578,131.87V119.721H70.531L76.891,107Z"
+ android:fillColor="#1A73E8"
+ android:fillType="evenOdd"/>
+</vector>
diff --git a/res/drawable/accessibility_button_preview_two_finger.xml b/res/drawable/accessibility_button_preview_two_finger.xml
new file mode 100644
index 0000000..e61e3e8
--- /dev/null
+++ b/res/drawable/accessibility_button_preview_two_finger.xml
@@ -0,0 +1,36 @@
+<?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.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="125dp"
+ android:height="153dp"
+ android:viewportWidth="125"
+ android:viewportHeight="153">
+ <path
+ android:pathData="M0,0h125v153h-125z"
+ android:fillColor="#ffffff"/>
+ <path
+ android:pathData="M41.266,134.754L84.047,134.754A1.735,1.735 0,0 1,85.781 136.489L85.781,136.489A1.735,1.735 0,0 1,84.047 138.223L41.266,138.223A1.735,1.735 0,0 1,39.531 136.489L39.531,136.489A1.735,1.735 0,0 1,41.266 134.754z"
+ android:fillColor="#DADCE0"/>
+ <path
+ android:pathData="M52.828,107L59.188,119.721H55.141V131.87C56.854,132.722 58.031,134.49 58.031,136.533C58.031,139.407 55.702,141.737 52.828,141.737C49.954,141.737 47.625,139.407 47.625,136.533C47.625,134.49 48.802,132.722 50.515,131.87V119.721H46.469L52.828,107Z"
+ android:fillColor="#1A73E8"
+ android:fillType="evenOdd"/>
+ <path
+ android:pathData="M70.172,107L76.531,119.721H72.485V131.87C74.198,132.722 75.375,134.49 75.375,136.533C75.375,139.407 73.046,141.737 70.172,141.737C67.298,141.737 64.969,139.407 64.969,136.533C64.969,134.49 66.146,132.722 67.859,131.87V119.721H63.813L70.172,107Z"
+ android:fillColor="#1A73E8"
+ android:fillType="evenOdd"/>
+</vector>
diff --git a/res/drawable/accessibility_captions.png b/res/drawable/accessibility_captions.png
deleted file mode 100644
index 718f4ef..0000000
--- a/res/drawable/accessibility_captions.png
+++ /dev/null
Binary files differ
diff --git a/res/drawable/accessibility_captions_banner.xml b/res/drawable/accessibility_captions_banner.xml
new file mode 100644
index 0000000..6597ffb
--- /dev/null
+++ b/res/drawable/accessibility_captions_banner.xml
@@ -0,0 +1,52 @@
+<?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.
+-->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="412dp"
+ android:height="300dp"
+ android:viewportWidth="412"
+ android:viewportHeight="300">
+ <path
+ android:pathData="M383.9,300H28.1C12.6,300 0,287.4 0,271.9V28.1C0,12.6 12.6,0 28.1,0h355.8C399.4,0 412,12.6 412,28.1v243.8C412,287.4 399.4,300 383.9,300z"
+ android:fillColor="#FFFFFF"/>
+ <path
+ android:pathData="M79.2,179.6h53.6v8.5h-53.6z"
+ android:fillColor="#1A73E8"/>
+ <path
+ android:pathData="M142.5,179.6h30.4v8.5h-30.4z"
+ android:fillColor="#1A73E8"/>
+ <path
+ android:pathData="M79.2,195.5h79.2v8.5h-79.2z"
+ android:fillColor="#1A73E8"/>
+ <path
+ android:pathData="M168.1,195.5h34.1v8.5h-34.1z"
+ android:fillColor="#1A73E8"/>
+ <path
+ android:pathData="M211.9,195.5h34.1v8.5h-34.1z"
+ android:fillColor="#1A73E8"/>
+ <path
+ android:pathData="M182.7,179.6h73.1v8.5h-73.1z"
+ android:fillColor="#1A73E8"/>
+ <path
+ android:pathData="M265.5,179.6h26.8v8.5h-26.8z"
+ android:fillColor="#1A73E8"/>
+ <path
+ android:pathData="M302.1,179.6h26.8v8.5h-26.8z"
+ android:fillColor="#1A73E8"/>
+ <path
+ android:pathData="M142.7,67.9h-11.5c-1.6,0 -2.9,1.3 -2.9,2.9H67.8c-7.9,0 -14.4,6.5 -14.4,14.4v132.4c0,7.9 6.5,14.4 14.4,14.4h276.4c7.9,0 14.4,-6.5 14.4,-14.4V85.2c0,-7.9 -6.5,-14.4 -14.4,-14.4H203.1c0,-1.6 -1.3,-2.9 -2.9,-2.9h-28.8c-1.6,0 -2.9,1.3 -2.9,2.9h-23C145.5,69.2 144.3,67.9 142.7,67.9zM344.2,73.7c6.4,0 11.5,5.2 11.5,11.5v132.4c0,6.3 -5.2,11.5 -11.5,11.5H67.8c-6.4,0 -11.5,-5.2 -11.5,-11.5V85.2c0,-6.3 5.2,-11.5 11.5,-11.5H344.2z"
+ android:fillColor="#DADCE0"/>
+</vector>
diff --git a/res/drawable/ic_illustration_fullscreen.xml b/res/drawable/ic_illustration_fullscreen.xml
index fbb62bf..2aca693 100644
--- a/res/drawable/ic_illustration_fullscreen.xml
+++ b/res/drawable/ic_illustration_fullscreen.xml
@@ -14,26 +14,48 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="77dp"
- android:height="134dp"
- android:viewportWidth="77"
- android:viewportHeight="134">
+ android:width="412dp"
+ android:height="300dp"
+ android:viewportWidth="412"
+ android:viewportHeight="300">
<path
- android:pathData="M69.6,1.1H7.4C3.921,1.1 1.1,3.921 1.1,7.4V126.6C1.1,130.079 3.921,132.9 7.4,132.9H69.6C73.079,132.9 75.9,130.079 75.9,126.6V7.4C75.9,3.921 73.079,1.1 69.6,1.1Z"
- android:strokeWidth="1.8"
- android:fillColor="#F2F3F4"
- android:strokeColor="#DADCE0"/>
+ android:pathData="M384.2,300H27.8C12.5,300 0,287.2 0,271.5v-243C0,12.8 12.5,0 27.8,0h356.5C399.5,0 412,12.8 412,28.5v243.2C412,287.2 399.5,300 384.2,300z"
+ android:fillColor="#FFFFFF"/>
<path
- android:pathData="M66.642,5H10.358C7.399,5 5,7.418 5,10.4V123.6C5,126.582 7.399,129 10.358,129H66.642C69.601,129 72,126.582 72,123.6V10.4C72,7.418 69.601,5 66.642,5Z"
- android:fillColor="#ffffff"/>
+ android:pathData="M207.4,19.1c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6S324.8,218 300,242.7c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4C90.1,217.9 76.4,185 76.4,150S90,82.1 114.8,57.4C139.5,32.7 172.4,19.1 207.4,19.1M207.4,17.1c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S280.8,17.1 207.4,17.1L207.4,17.1z"
+ android:fillColor="#E8EAED"/>
<path
- android:pathData="M66,10H11C10.448,10 10,10.448 10,11V123C10,123.552 10.448,124 11,124H66C66.552,124 67,123.552 67,123V11C67,10.448 66.552,10 66,10ZM11,5C7.686,5 5,7.686 5,11V123C5,126.314 7.686,129 11,129H66C69.314,129 72,126.314 72,123V11C72,7.686 69.314,5 66,5H11Z"
- android:fillColor="#F29900"
- android:fillType="evenOdd"/>
+ android:pathData="M262.1,107.7V100c0,-1.1 -0.9,-1.9 -1.9,-1.9V57.6c0,-5.3 -4.3,-9.6 -9.6,-9.6H162c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C261.2,109.6 262.1,108.7 262.1,107.7zM258.2,242.4c0,4.2 -3.5,7.7 -7.7,7.7H162c-4.2,0 -7.7,-3.5 -7.7,-7.7V57.6c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V242.4z"
+ android:fillColor="#DADCE0"/>
<path
- android:pathData="M49.077,15V19.314H54.612L48,25.958L51.037,29L57.692,22.334V27.921H62V15H49.077Z"
- android:fillColor="#F29900"/>
+ android:pathData="M250.5,53.9c2,0 3.7,1.7 3.7,3.7v184.8c0,2 -1.7,3.7 -3.7,3.7H162c-2,0 -3.7,-1.7 -3.7,-3.7V57.6c0,-2 1.7,-3.7 3.7,-3.7H250.5M250.5,49.9H162c-4.2,0 -7.7,3.5 -7.7,7.7v184.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7V57.6C258.2,53.4 254.8,49.9 250.5,49.9L250.5,49.9z"
+ android:fillColor="#F9AB00"/>
<path
- android:pathData="M25.963,105L19.308,111.655V106.077H15V119H27.923V114.692H22.366L29,108.037L25.963,105Z"
- android:fillColor="#F29900"/>
+ android:pathData="M236.9,60.6l11,0l0,11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M247.9,60.6L232.3,76.2"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M175.2,240.1l-10.9,0l0,-11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M164.3,240.1L179.9,224.5"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
</vector>
diff --git a/res/drawable/ic_illustration_switch.xml b/res/drawable/ic_illustration_switch.xml
index 9d3990b..bfe533c 100644
--- a/res/drawable/ic_illustration_switch.xml
+++ b/res/drawable/ic_illustration_switch.xml
@@ -14,33 +14,29 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="77dp"
- android:height="134dp"
- android:viewportWidth="77"
- android:viewportHeight="134">
+ android:width="412dp"
+ android:height="300dp"
+ android:viewportWidth="412"
+ android:viewportHeight="300">
<path
- android:pathData="M69.6,1.1H7.4C3.921,1.1 1.1,3.921 1.1,7.4V126.6C1.1,130.079 3.921,132.9 7.4,132.9H69.6C73.079,132.9 75.9,130.079 75.9,126.6V7.4C75.9,3.921 73.079,1.1 69.6,1.1Z"
- android:strokeWidth="1.8"
- android:fillColor="#F2F3F4"
- android:strokeColor="#DADCE0"/>
+ android:pathData="M384.2,300H27.8C12.5,300 0,287.2 0,271.5v-243C0,12.8 12.5,0 27.8,0h356.5C399.5,0 412,12.8 412,28.5v243.2C412,287.2 399.5,300 384.2,300z"
+ android:fillColor="#FFFFFF"/>
<path
- android:pathData="M66.642,5H10.358C7.399,5 5,7.418 5,10.4V123.6C5,126.582 7.399,129 10.358,129H66.642C69.601,129 72,126.582 72,123.6V10.4C72,7.418 69.601,5 66.642,5Z"
- android:fillColor="#ffffff"/>
+ android:pathData="M207.4,19.1c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6S324.8,218 300,242.7c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4C90.1,217.9 76.4,185 76.4,150S90,82.1 114.8,57.4C139.5,32.7 172.4,19.1 207.4,19.1M207.4,17.1c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S280.8,17.1 207.4,17.1L207.4,17.1z"
+ android:fillColor="#E8EAED"/>
<path
- android:pathData="M63,94H39V118H63V94Z"
- android:fillColor="#000000"
- android:fillAlpha="0.7"/>
+ android:pathData="M262.1,107.7V100c0,-1.1 -0.9,-1.9 -1.9,-1.9V57.6c0,-5.3 -4.3,-9.6 -9.6,-9.6H162c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9V127c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C261.2,109.6 262.1,108.7 262.1,107.7zM258.2,242.4c0,4.2 -3.5,7.7 -7.7,7.7H162c-4.2,0 -7.7,-3.5 -7.7,-7.7V57.6c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V242.4z"
+ android:fillColor="#DADCE0"/>
<path
- android:pathData="M43,106V114H59V98H51V99.6H57.4V112.4H44.6V106H43Z"
- android:fillColor="#ffffff"/>
+ android:pathData="M250.5,53.9c2,0 3.7,1.7 3.7,3.7v184.8c0,2 -1.7,3.7 -3.7,3.7H162c-2,0 -3.7,-1.7 -3.7,-3.7V57.6c0,-2 1.7,-3.7 3.7,-3.7L250.5,53.9M250.5,49.9H162c-4.2,0 -7.7,3.5 -7.7,7.7v184.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7V57.6C258.2,53.4 254.8,49.9 250.5,49.9L250.5,49.9z"
+ android:fillColor="#F9AB00"/>
<path
- android:pathData="M49.4,98H43V104.4H49.4V98Z"
- android:fillColor="#ffffff"/>
+ android:pathData="M214.2,223.8v17.5h34.9v-34.9h-17.5v3.5h14v27.9h-27.9v-14H214.2z"
+ android:fillColor="#5F6368"/>
<path
- android:pathData="M55.8,105.2V106.8H52.928L56.56,110.432L55.432,111.56L51.8,107.928V110.8H50.2V105.2H55.8Z"
- android:fillColor="#ffffff"/>
+ android:pathData="M228.2,206.3h-14v14h14V206.3z"
+ android:fillColor="#5F6368"/>
<path
- android:pathData="M66,10H11C10.448,10 10,10.448 10,11V123C10,123.552 10.448,124 11,124H66C66.552,124 67,123.552 67,123V11C67,10.448 66.552,10 66,10ZM11,5C7.686,5 5,7.686 5,11V123C5,126.314 7.686,129 11,129H66C69.314,129 72,126.314 72,123V11C72,7.686 69.314,5 66,5H11Z"
- android:fillColor="#F29900"
- android:fillType="evenOdd"/>
+ android:pathData="M242.2,222.1v3.5h-6.3l7.9,7.9l-2.5,2.5l-7.9,-7.9v6.3h-3.5v-12.2H242.2z"
+ android:fillColor="#5F6368"/>
</vector>
diff --git a/res/drawable/ic_illustration_window.xml b/res/drawable/ic_illustration_window.xml
index 1b87d7d..22513f4 100644
--- a/res/drawable/ic_illustration_window.xml
+++ b/res/drawable/ic_illustration_window.xml
@@ -14,28 +14,48 @@
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
- android:width="77dp"
- android:height="134dp"
- android:viewportWidth="77"
- android:viewportHeight="134">
+ android:width="412dp"
+ android:height="300dp"
+ android:viewportWidth="412"
+ android:viewportHeight="300">
<path
- android:pathData="M69.6,1.1H7.4C3.921,1.1 1.1,3.921 1.1,7.4V126.6C1.1,130.079 3.921,132.9 7.4,132.9H69.6C73.079,132.9 75.9,130.079 75.9,126.6V7.4C75.9,3.921 73.079,1.1 69.6,1.1Z"
- android:strokeWidth="1.8"
- android:fillColor="#F2F3F4"
- android:strokeColor="#DADCE0"/>
+ android:pathData="M384.2,300H27.8C12.5,300 0,287.2 0,271.5v-243C0,12.8 12.5,0 27.8,0h356.5C399.5,0 412,12.8 412,28.5v243.2C412,287.2 399.5,300 384.2,300z"
+ android:fillColor="#FFFFFF"/>
<path
- android:pathData="M66.642,5H10.358C7.399,5 5,7.418 5,10.4V123.6C5,126.582 7.399,129 10.358,129H66.642C69.601,129 72,126.582 72,123.6V10.4C72,7.418 69.601,5 66.642,5Z"
- android:fillColor="#ffffff"/>
+ android:pathData="M207.4,19.1c35,0 67.9,13.6 92.6,38.4c24.7,24.7 38.4,57.6 38.4,92.6S324.8,218 300,242.7c-24.7,24.7 -57.6,38.4 -92.6,38.4s-67.9,-13.6 -92.6,-38.4C90.1,217.9 76.4,185 76.4,150S90,82.1 114.8,57.4C139.5,32.7 172.4,19.1 207.4,19.1M207.4,17.1c-73.4,0 -133,59.5 -133,132.9s59.5,132.9 132.9,132.9s133,-59.5 133,-132.9S280.8,17.1 207.4,17.1L207.4,17.1z"
+ android:fillColor="#E8EAED"/>
<path
- android:pathData="M63,48H14C12.895,48 12,48.895 12,50V85C12,86.105 12.895,87 14,87H63C64.105,87 65,86.105 65,85V50C65,48.895 64.105,48 63,48Z"
- android:strokeLineJoin="bevel"
- android:strokeWidth="5"
+ android:pathData="M262.1,107.7V100c0,-1.1 -0.9,-1.9 -1.9,-1.9V57.6c0,-5.3 -4.3,-9.6 -9.6,-9.6H162c-5.3,0 -9.6,4.3 -9.6,9.6v184.8c0,5.3 4.3,9.6 9.6,9.6h88.5c5.3,0 9.6,-4.3 9.6,-9.6v-94.3c1.1,0 1.9,-0.9 1.9,-1.9v-19.2c0,-1.1 -0.9,-1.9 -1.9,-1.9v-15.4C261.2,109.6 262.1,108.7 262.1,107.7zM258.2,242.4c0,4.2 -3.5,7.7 -7.7,7.7H162c-4.2,0 -7.7,-3.5 -7.7,-7.7V57.6c0,-4.2 3.5,-7.7 7.7,-7.7h88.5c4.2,0 7.7,3.5 7.7,7.7V242.4z"
+ android:fillColor="#DADCE0"/>
+ <path
+ android:pathData="M250.5,118.9c2,0 3.7,1.7 3.7,3.7v54.8c0,2 -1.7,3.7 -3.7,3.7H162c-2,0 -3.7,-1.7 -3.7,-3.7v-54.8c0,-2 1.7,-3.7 3.7,-3.7H250.5M250.5,114.9H162c-4.2,0 -7.7,3.5 -7.7,7.7v54.8c0,4.2 3.5,7.7 7.7,7.7h88.5c4.2,0 7.7,-3.5 7.7,-7.7v-54.8C258.2,118.4 254.8,114.9 250.5,114.9L250.5,114.9z"
+ android:fillColor="#F9AB00"/>
+ <path
+ android:pathData="M236.9,125.6l11,0l0,11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
android:fillColor="#00000000"
- android:strokeColor="#F29900"/>
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
<path
- android:pathData="M46.077,54V58.314H51.612L45,64.958L48.037,68L54.692,61.334V66.921H59V54H46.077Z"
- android:fillColor="#F29900"/>
+ android:pathData="M247.9,125.6L232.3,141.2"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
<path
- android:pathData="M28.963,67L22.308,73.655V68.077H18V81H30.923V76.692H25.366L32,70.037L28.963,67Z"
- android:fillColor="#F29900"/>
+ android:pathData="M175.2,175.1l-10.9,0l0,-11"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
+ <path
+ android:pathData="M164.3,175.1L179.9,159.5"
+ android:strokeLineJoin="round"
+ android:strokeWidth="4"
+ android:fillColor="#00000000"
+ android:strokeColor="#F9AB00"
+ android:strokeLineCap="round"/>
</vector>
diff --git a/res/layout/accessibility_captions_preview.xml b/res/layout/accessibility_captions_preview.xml
deleted file mode 100644
index 1818e64..0000000
--- a/res/layout/accessibility_captions_preview.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
- Copyright (C) 2020 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.
--->
-
-<FrameLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="match_parent"
- android:layout_height="wrap_content">
-
- <ImageView
- android:layout_width="match_parent"
- android:layout_height="@dimen/captioning_preview_height"
- android:contentDescription="@null"
- android:scaleType="fitCenter"
- android:src="@drawable/accessibility_captions" />
-
-</FrameLayout>
diff --git a/res/layout/dialog_single_radio_choice_list_item.xml b/res/layout/dialog_single_radio_choice_list_item.xml
index 49ef352..106a8a5 100644
--- a/res/layout/dialog_single_radio_choice_list_item.xml
+++ b/res/layout/dialog_single_radio_choice_list_item.xml
@@ -55,7 +55,7 @@
<ImageView
android:id="@+id/image"
- android:layout_width="@dimen/accessibility_imageview_size"
+ android:layout_width="match_parent"
android:layout_height="@dimen/accessibility_imageview_size"
android:layout_marginTop="16dp"
android:scaleType="fitStart"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index aec90e1..7189401 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -5259,8 +5259,18 @@
<string name="select_to_speak_summary">Tap items on your screen to hear them read aloud</string>
<!-- Title for the accessibility preference screen to enable video captioning. [CHAR LIMIT=35] -->
<string name="accessibility_captioning_title">Caption preferences</string>
+ <!-- Title for accessibility captioning footer. [CHAR LIMIT=60] -->
+ <string name="accessibility_captioning_about_title">About caption preferences</string>
+ <!-- Accessibility captioning footer link content description [CHAR LIMIT=NONE] -->
+ <string name="accessibility_captioning_footer_learn_more_content_description">Learn more about caption preferences</string>
<!-- Title for the accessibility preference screen to enable screen magnification. [CHAR LIMIT=35] -->
<string name="accessibility_screen_magnification_title">Magnification</string>
+ <!-- Title for accessibility shortcut preference for magnification. [CHAR LIMIT=60] -->
+ <string name="accessibility_screen_magnification_shortcut_title">Magnification shortcut</string>
+ <!-- Title for screen magnification footer. [CHAR LIMIT=60] -->
+ <string name="accessibility_screen_magnification_about_title">About magnification</string>
+ <!-- Screen magnification footer link content description [CHAR LIMIT=NONE] -->
+ <string name="accessibility_screen_magnification_footer_learn_more_content_description">Learn more about magnification</string>
<!-- Title for the accessibility preference screen to edit magnification area. [CHAR LIMIT=35] -->
<string name="accessibility_magnification_mode_title">Magnification type</string>
<!-- Message for the accessibility preference screen to edit magnification area dialog. [CHAR LIMIT=none] -->
@@ -5411,14 +5421,20 @@
<string name="accessibility_button_title">Accessibility button</string>
<!-- Title for the accessibility button & gesture page. [CHAR LIMIT=35] -->
<string name="accessibility_button_gesture_title">Accessibility button & gesture</string>
+ <!-- Title for the accessibility button footer. [CHAR LIMIT=35] -->
+ <string name="accessibility_button_about_title">About accessibility button</string>
+ <!-- Title for the accessibility button & gesture footer. [CHAR LIMIT=55] -->
+ <string name="accessibility_button_gesture_about_title">About accessibility button & gesture</string>
+ <!-- Accessibility button & gestures footer link content description [CHAR LIMIT=NONE] -->
+ <string name="accessibility_button_gesture_footer_learn_more_content_description">Learn more about accessibility button & gesture</string>
<!-- Intro for the accessibility button page. [CHAR LIMIT=100] -->
<string name="accessibility_button_intro">Using the accessibility button. The gesture isn\u2019t available with 3-button navigation.</string>
<!-- Summary text for the accessibility button preference. [CHAR LIMIT=50] -->
<string name="accessibility_button_summary">Quickly access accessibility features</string>
<!-- Description for the accessibility button in gesture navigation. Explain how this page works. [CHAR LIMIT=NONE] -->
- <string name="accessibility_button_gesture_description">Quickly access accessibility features from any screen.\n\nTo get started, go to accessibility settings and select a feature. Tap on the shortcut and select the accessibility button.\n\nTo use the accessibility button in the navigation bar instead, switch to 2-button navigation or 3-button navigation.</string>
+ <string name="accessibility_button_gesture_description">Quickly access accessibility features from any screen.\n\nTo get started, go to accessibility settings and select a feature. Tap on the shortcut and select the accessibility button or gesture.</string>
<!-- Description for the accessibility button page. Explain how this page works. [CHAR LIMIT=NONE] -->
- <string name="accessibility_button_description">Quickly access accessibility features from any screen. \n\nTo get started, go to accessibility settings and select a feature. Tap on the shortcut and select the accessibility button.</string>
+ <string name="accessibility_button_description">Quickly access accessibility features from any screen.\n\nTo get started, go to accessibility settings and select a feature. Tap on the shortcut and select the accessibility button.</string>
<!-- Title for the button or gesture of the accessibility button. [CHAR LIMIT=35] -->
<string name="accessibility_button_or_gesture_title">Use button or gesture</string>
<!-- Title for the location of the accessibility button. [CHAR LIMIT=35] -->
@@ -5472,6 +5488,10 @@
<string name="accessibility_timeout_2mins">2 minutes</string>
<!-- Title for accessibility settings timeout item. [CHAR LIMIT=43] -->
<string name="accessibility_setting_item_control_timeout_title">Time to take action (Accessibility timeout)</string>
+ <!-- Title for accessibility timeout footer. [CHAR LIMIT=65] -->
+ <string name="accessibility_control_timeout_about_title">About time to take action (Accessibility timeout)</string>
+ <!-- Accessibility timeout footer link content description [CHAR LIMIT=NONE] -->
+ <string name="accessibility_control_timeout_footer_learn_more_content_description">Learn more about time to take action (Accessibility timeout)</string>
<!-- Title for accessibility preference to accessibility timeout. [CHAR LIMIT=35] -->
<string name="accessibility_control_timeout_preference_title">Time to take action</string>
<!-- Descriptive text for accessibility preference to accessibility control timeout. [CHAR LIMIT=NONE] -->
@@ -5483,6 +5503,8 @@
<string name="accessibility_display_inversion_preference_title">Color inversion</string>
<!-- Used in the accessibility service settings to control turning display color inversion on/off entirely. [CHAR LIMIT=NONE] -->
<string name="accessibility_display_inversion_switch_title">Use color inversion</string>
+ <!-- Title for accessibility shortcut preference for color inversion. [CHAR LIMIT=60] -->
+ <string name="accessibility_display_inversion_shortcut_title">Color inversion shortcut</string>
<!-- Subtitle for the accessibility preference to configure display color inversion. [CHAR LIMIT=NONE] -->
<string name="accessibility_display_inversion_preference_subtitle">
<![CDATA[Color inversion turns light screens dark.<br/><br/>
@@ -5496,6 +5518,10 @@
</string>
<!-- Title for accessibility preference for configuring feature that performs click action soon after mouse/trackpad pointer stops moving. [CHAR LIMIT=NONE] -->
<string name="accessibility_autoclick_preference_title">Autoclick (dwell timing)</string>
+ <!-- Title for accessibility dwell timing footer. [CHAR LIMIT=NONE] -->
+ <string name="accessibility_autoclick_about_title">About autoclick (dwell timing)</string>
+ <!-- Accessibility dwell timing footer link content description [CHAR LIMIT=NONE] -->
+ <string name="accessibility_autoclick_footer_learn_more_content_description">Learn more about autoclick (dwell timing)</string>
<!-- Footer text to explain what autoclick does -->
<string name="accessibility_autoclick_description">Autoclick works with a connected mouse. You can set the mouse cursor to click automatically when the cursor stops moving for a certain amount of time.</string>
<!-- Option heading to leave the auto click requirement for accessibility users at its default level. [CHAR LIMIT=50] -->
@@ -5534,6 +5560,16 @@
<string name="accessibility_service_primary_open_title">Open <xliff:g id="accessibility_app_name" example="TalkBack">%1$s</xliff:g></string>
<!-- Used in the Color correction settings screen to control turning on/off the feature entirely [CHAR LIMIT=60] -->
<string name="accessibility_daltonizer_primary_switch_title">Use color correction</string>
+ <!-- Title for accessibility shortcut preference for color correction. [CHAR LIMIT=60] -->
+ <string name="accessibility_daltonizer_shortcut_title">Color correction shortcut</string>
+ <!-- Title for Color correction footer. [CHAR LIMIT=35] -->
+ <string name="accessibility_daltonizer_about_title">About color correction</string>
+ <!-- Color inversion footer link content description [CHAR LIMIT=NONE] -->
+ <string name="accessibility_daltonizer_footer_learn_more_content_description">Learn more about color correction</string>
+ <!-- Title for Color inversion footer. [CHAR LIMIT=35] -->
+ <string name="accessibility_color_inversion_about_title">About color inversion</string>
+ <!-- Color correction footer link content description [CHAR LIMIT=NONE] -->
+ <string name="accessibility_color_inversion_footer_learn_more_content_description">Learn more about color inversion</string>
<!-- Title for Captions settings screen to control turning on/off the feature entirely [CHAR LIMIT=60] -->
<string name="accessibility_caption_primary_switch_title">Show captions</string>
<!-- Summary for Captions settings screen to control turning on/off the feature entirely [CHAR LIMIT=NONE] -->
@@ -5613,6 +5649,10 @@
<string name="reduce_bright_colors_preference_title">Extra dim</string>
<!-- Title for the activation switch of the Reduce Brightness feature. [CHAR LIMIT=NONE] -->
<string name="reduce_bright_colors_switch_title">Make screen extra dim</string>
+ <!-- Title for accessibility shortcut preference for Reduce Brightness. [CHAR LIMIT=60] -->
+ <string name="reduce_bright_colors_shortcut_title">Extra dim shortcut</string>
+ <!-- Title for Reduce Brightness feature footer. [CHAR LIMIT=35] -->
+ <string name="reduce_bright_colors_about_title">About extra dim</string>
<!-- Summary for the accessibility preference to configure Reduce Brightness feature. [CHAR LIMIT=NONE] -->
<string name="reduce_bright_colors_preference_summary" product="default">Dim screen beyond your phone\u2019s minimum brightness</string>
<!-- Summary for the accessibility preference to configure Reduce Brightness feature. [CHAR LIMIT=NONE] -->
@@ -11759,6 +11799,8 @@
<string name="one_handed_title">One-handed mode</string>
<!-- Preference Switch for enabling one handed [CHAR LIMIT=60] -->
<string name="one_handed_mode_enabled">Use one-handed mode</string>
+ <!-- Title for accessibility shortcut preference for enabling one handed. [CHAR LIMIT=60] -->
+ <string name="one_handed_mode_shortcut_title">One-handed mode shortcut</string>
<!-- Search keywords for "One-Handed" settings [CHAR_LIMIT=NONE] -->
<string name="keywords_one_handed">reachability</string>
<!-- Category title for one handed swipe down [CHAR_LIMIT=60] -->
diff --git a/res/xml/accessibility_button_settings.xml b/res/xml/accessibility_button_settings.xml
index 02b1c7d..9f32714 100644
--- a/res/xml/accessibility_button_settings.xml
+++ b/res/xml/accessibility_button_settings.xml
@@ -16,8 +16,7 @@
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:settings="http://schemas.android.com/apk/res-auto"
- android:title="@string/accessibility_button_title">
+ xmlns:settings="http://schemas.android.com/apk/res-auto">
<com.android.settingslib.widget.LayoutPreference
android:key="caption_preview"
@@ -38,6 +37,15 @@
settings:controller="com.android.settings.accessibility.AccessibilityButtonLocationPreferenceController"/>
<ListPreference
+ android:entries="@array/accessibility_button_gesture_selector_titles"
+ android:entryValues="@array/accessibility_button_gesture_selector_values"
+ android:key="accessibility_button_or_gesture"
+ android:title="@string/accessibility_button_or_gesture_title"
+ android:summary="%s"
+ android:persistent="false"
+ settings:controller="com.android.settings.accessibility.AccessibilityButtonGesturePreferenceController"/>
+
+ <ListPreference
android:entries="@array/accessibility_button_size_selector_titles"
android:entryValues="@array/accessibility_button_size_selector_values"
android:key="accessibility_button_size"
@@ -61,7 +69,6 @@
<com.android.settings.accessibility.AccessibilityFooterPreference
android:key="accessibility_button_footer"
- android:title="@string/accessibility_button_description"
android:persistent="false"
android:selectable="false"
settings:searchable="false"
diff --git a/res/xml/accessibility_shortcuts_settings.xml b/res/xml/accessibility_shortcuts_settings.xml
index 465f96d..2863335 100644
--- a/res/xml/accessibility_shortcuts_settings.xml
+++ b/res/xml/accessibility_shortcuts_settings.xml
@@ -25,8 +25,8 @@
android:fragment="com.android.settings.accessibility.AccessibilityButtonFragment"
android:key="accessibility_button_preference"
android:persistent="false"
- android:title="@string/accessibility_button_title"
- android:summary="@string/accessibility_button_summary"/>
+ android:summary="@string/accessibility_button_summary"
+ settings:controller="com.android.settings.accessibility.AccessibilityButtonPreferenceController"/>
<SwitchPreference
android:key="accessibility_shortcut_preference"
diff --git a/res/xml/captioning_settings.xml b/res/xml/captioning_settings.xml
index b397146..f5059e5 100644
--- a/res/xml/captioning_settings.xml
+++ b/res/xml/captioning_settings.xml
@@ -21,12 +21,11 @@
android:persistent="false"
android:title="@string/accessibility_captioning_title">
- <com.android.settingslib.widget.LayoutPreference
+ <com.android.settingslib.widget.IllustrationPreference
android:key="captions_preview"
- android:layout="@layout/accessibility_captions_preview"
android:persistent="false"
android:selectable="false"
- android:title="@string/summary_placeholder"
+ settings:lottie_rawRes="@drawable/accessibility_captions_banner"
settings:searchable="false" />
<com.android.settings.widget.SettingsMainSwitchPreference
diff --git a/src/com/android/settings/accessibility/AccessibilityButtonFooterPreferenceController.java b/src/com/android/settings/accessibility/AccessibilityButtonFooterPreferenceController.java
index de90374..55b8019 100644
--- a/src/com/android/settings/accessibility/AccessibilityButtonFooterPreferenceController.java
+++ b/src/com/android/settings/accessibility/AccessibilityButtonFooterPreferenceController.java
@@ -33,21 +33,26 @@
}
@Override
- protected String getLabelName() {
- return mContext.getString(R.string.accessibility_button_title);
+ protected String getLearnMoreContentDescription() {
+ return mContext.getString(
+ R.string.accessibility_button_gesture_footer_learn_more_content_description);
+ }
+
+ @Override
+ protected String getIntroductionTitle() {
+ return mContext.getString(R.string.accessibility_button_about_title);
}
@Override
public void displayPreference(PreferenceScreen screen) {
// Need to update footerPreference's data before super.displayPreference(), then it will use
// data to update related property of footerPreference.
- if (AccessibilityUtil.isGestureNavigateEnabled(mContext)) {
- final AccessibilityFooterPreference footerPreference =
- screen.findPreference(getPreferenceKey());
- footerPreference.setTitle(
- mContext.getString(R.string.accessibility_button_gesture_description));
- }
-
+ final int titleResource = AccessibilityUtil.isGestureNavigateEnabled(mContext)
+ ? R.string.accessibility_button_gesture_description
+ : R.string.accessibility_button_description;
+ final AccessibilityFooterPreference footerPreference =
+ screen.findPreference(getPreferenceKey());
+ footerPreference.setTitle(titleResource);
super.displayPreference(screen);
}
}
diff --git a/src/com/android/settings/accessibility/AccessibilityButtonFragment.java b/src/com/android/settings/accessibility/AccessibilityButtonFragment.java
index 4e067d8..2df11a9 100644
--- a/src/com/android/settings/accessibility/AccessibilityButtonFragment.java
+++ b/src/com/android/settings/accessibility/AccessibilityButtonFragment.java
@@ -17,6 +17,7 @@
package com.android.settings.accessibility;
import android.app.settings.SettingsEnums;
+import android.os.Bundle;
import com.android.settings.R;
import com.android.settings.dashboard.DashboardFragment;
@@ -30,6 +31,14 @@
private static final String TAG = "AccessibilityButtonFragment";
@Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ final int titleResource = AccessibilityUtil.isGestureNavigateEnabled(getPrefContext())
+ ? R.string.accessibility_button_gesture_title : R.string.accessibility_button_title;
+ getActivity().setTitle(titleResource);
+ }
+
+ @Override
protected int getPreferenceScreenResId() {
return R.xml.accessibility_button_settings;
}
diff --git a/src/com/android/settings/accessibility/AccessibilityButtonGesturePreferenceController.java b/src/com/android/settings/accessibility/AccessibilityButtonGesturePreferenceController.java
new file mode 100644
index 0000000..e6b49d0
--- /dev/null
+++ b/src/com/android/settings/accessibility/AccessibilityButtonGesturePreferenceController.java
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.accessibility;
+
+import android.content.Context;
+import android.provider.Settings;
+
+import androidx.preference.ListPreference;
+import androidx.preference.Preference;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+
+import com.google.common.primitives.Ints;
+
+import java.util.Optional;
+
+/** Preference controller that controls the button or gesture in accessibility button page. */
+public class AccessibilityButtonGesturePreferenceController extends BasePreferenceController
+ implements Preference.OnPreferenceChangeListener {
+
+ private Optional<Integer> mDefaultGesture = Optional.empty();
+
+ public AccessibilityButtonGesturePreferenceController(Context context, String preferenceKey) {
+ super(context, preferenceKey);
+ }
+
+ @Override
+ public int getAvailabilityStatus() {
+ return AccessibilityUtil.isGestureNavigateEnabled(mContext)
+ ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ final ListPreference listPreference = (ListPreference) preference;
+ final Integer value = Ints.tryParse((String) newValue);
+ if (value != null) {
+ Settings.Secure.putInt(mContext.getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE, value);
+ updateState(listPreference);
+ }
+ return true;
+ }
+
+ @Override
+ public void updateState(Preference preference) {
+ super.updateState(preference);
+ final ListPreference listPreference = (ListPreference) preference;
+
+ listPreference.setValue(getCurrentAccessibilityButtonMode());
+ }
+
+ private String getCurrentAccessibilityButtonMode() {
+ final int mode = Settings.Secure.getInt(mContext.getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE, getDefaultGestureValue());
+ return String.valueOf(mode);
+ }
+
+ private int getDefaultGestureValue() {
+ if (!mDefaultGesture.isPresent()) {
+ final String[] valuesList = mContext.getResources().getStringArray(
+ R.array.accessibility_button_gesture_selector_values);
+ mDefaultGesture = Optional.of(Integer.parseInt(valuesList[0]));
+ }
+ return mDefaultGesture.get();
+ }
+}
diff --git a/src/com/android/settings/accessibility/AccessibilityButtonLocationPreferenceController.java b/src/com/android/settings/accessibility/AccessibilityButtonLocationPreferenceController.java
index ed7cb27..167e08f 100644
--- a/src/com/android/settings/accessibility/AccessibilityButtonLocationPreferenceController.java
+++ b/src/com/android/settings/accessibility/AccessibilityButtonLocationPreferenceController.java
@@ -18,7 +18,6 @@
import android.content.Context;
import android.provider.Settings;
-import android.util.ArrayMap;
import androidx.preference.ListPreference;
import androidx.preference.Preference;
@@ -28,16 +27,16 @@
import com.google.common.primitives.Ints;
+import java.util.Optional;
+
/** Preference controller that controls the preferred location in accessibility button page. */
public class AccessibilityButtonLocationPreferenceController extends BasePreferenceController
implements Preference.OnPreferenceChangeListener {
- private final ArrayMap<String, String> mValueTitleMap = new ArrayMap<>();
- private int mDefaultLocation;
+ private Optional<Integer> mDefaultLocation = Optional.empty();
public AccessibilityButtonLocationPreferenceController(Context context, String preferenceKey) {
super(context, preferenceKey);
- initValueTitleMap();
}
@Override
@@ -68,22 +67,16 @@
private String getCurrentAccessibilityButtonMode() {
final int mode = Settings.Secure.getInt(mContext.getContentResolver(),
- Settings.Secure.ACCESSIBILITY_BUTTON_MODE, mDefaultLocation);
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE, getDefaultLocationValue());
return String.valueOf(mode);
}
- private void initValueTitleMap() {
- if (mValueTitleMap.size() == 0) {
- final String[] values = mContext.getResources().getStringArray(
+ private int getDefaultLocationValue() {
+ if (!mDefaultLocation.isPresent()) {
+ final String[] valuesList = mContext.getResources().getStringArray(
R.array.accessibility_button_location_selector_values);
- final String[] titles = mContext.getResources().getStringArray(
- R.array.accessibility_button_location_selector_titles);
- final int mapSize = values.length;
-
- mDefaultLocation = Integer.parseInt(values[0]);
- for (int i = 0; i < mapSize; i++) {
- mValueTitleMap.put(values[i], titles[i]);
- }
+ mDefaultLocation = Optional.of(Integer.parseInt(valuesList[0]));
}
+ return mDefaultLocation.get();
}
}
diff --git a/src/com/android/settings/accessibility/AccessibilityButtonPreferenceController.java b/src/com/android/settings/accessibility/AccessibilityButtonPreferenceController.java
new file mode 100644
index 0000000..f076472
--- /dev/null
+++ b/src/com/android/settings/accessibility/AccessibilityButtonPreferenceController.java
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.accessibility;
+
+import android.content.Context;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+
+/**
+ * Preference controller for accessibility button preference.
+ */
+public class AccessibilityButtonPreferenceController extends BasePreferenceController {
+
+ public AccessibilityButtonPreferenceController(Context context, String key) {
+ super(context, key);
+ }
+
+ @Override
+ public int getAvailabilityStatus() {
+ return AVAILABLE;
+ }
+
+ @Override
+ public void displayPreference(PreferenceScreen screen) {
+ super.displayPreference(screen);
+ final int titleResource = AccessibilityUtil.isGestureNavigateEnabled(mContext)
+ ? R.string.accessibility_button_gesture_title : R.string.accessibility_button_title;
+ final Preference preference = screen.findPreference(getPreferenceKey());
+ preference.setTitle(titleResource);
+
+ }
+}
diff --git a/src/com/android/settings/accessibility/AccessibilityButtonPreviewPreferenceController.java b/src/com/android/settings/accessibility/AccessibilityButtonPreviewPreferenceController.java
index 69a7a46..8a840a1 100644
--- a/src/com/android/settings/accessibility/AccessibilityButtonPreviewPreferenceController.java
+++ b/src/com/android/settings/accessibility/AccessibilityButtonPreviewPreferenceController.java
@@ -23,6 +23,7 @@
import android.os.Handler;
import android.os.Looper;
import android.provider.Settings;
+import android.view.accessibility.AccessibilityManager;
import android.widget.ImageView;
import androidx.annotation.VisibleForTesting;
@@ -46,11 +47,14 @@
private final ContentResolver mContentResolver;
@VisibleForTesting
final ContentObserver mContentObserver;
- private FloatingMenuLayerDrawable mFloatingMenuPreviewDrawable;
+ private AccessibilityLayerDrawable mAccessibilityPreviewDrawable;
@VisibleForTesting
ImageView mPreview;
+ private AccessibilityManager.TouchExplorationStateChangeListener
+ mTouchExplorationStateChangeListener;
+
public AccessibilityButtonPreviewPreferenceController(Context context, String preferenceKey) {
super(context, preferenceKey);
mContentResolver = context.getContentResolver();
@@ -60,6 +64,9 @@
updatePreviewPreference();
}
};
+ mTouchExplorationStateChangeListener = isTouchExplorationEnabled -> {
+ updatePreviewPreference();
+ };
}
@Override
@@ -78,6 +85,9 @@
@Override
public void onResume() {
+ final AccessibilityManager am = mContext.getSystemService(AccessibilityManager.class);
+ am.addTouchExplorationStateChangeListener(mTouchExplorationStateChangeListener);
+
mContentResolver.registerContentObserver(
Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_BUTTON_MODE),
/* notifyForDescendants= */ false, mContentObserver);
@@ -91,6 +101,9 @@
@Override
public void onPause() {
+ final AccessibilityManager am = mContext.getSystemService(AccessibilityManager.class);
+ am.removeTouchExplorationStateChangeListener(mTouchExplorationStateChangeListener);
+
mContentResolver.unregisterContentObserver(mContentObserver);
}
@@ -103,9 +116,14 @@
final int floatingMenuIconId = (size == SMALL_SIZE)
? R.drawable.accessibility_button_preview_small_floating_menu
: R.drawable.accessibility_button_preview_large_floating_menu;
-
- mPreview.setImageDrawable(getFloatingMenuPreviewDrawable(floatingMenuIconId, opacity));
- // Only change opacity(alpha) would not invoke redraw view, need to invalidate manually.
+ mPreview.setImageDrawable(getAccessibilityPreviewDrawable(floatingMenuIconId, opacity));
+ mPreview.invalidate();
+ } else if (AccessibilityUtil.isGestureNavigateEnabled(mContext)) {
+ // TODO(b/193081959): Use static illustartion instead.
+ final int resId = AccessibilityUtil.isTouchExploreEnabled(mContext)
+ ? R.drawable.accessibility_button_preview_three_finger
+ : R.drawable.accessibility_button_preview_two_finger;
+ mPreview.setImageDrawable(getAccessibilityPreviewDrawable(resId, /* opacity= */ 100));
mPreview.invalidate();
} else {
mPreview.setImageDrawable(
@@ -113,14 +131,14 @@
}
}
- private Drawable getFloatingMenuPreviewDrawable(int resId, int opacity) {
- if (mFloatingMenuPreviewDrawable == null) {
- mFloatingMenuPreviewDrawable = FloatingMenuLayerDrawable.createLayerDrawable(
+ private Drawable getAccessibilityPreviewDrawable(int resId, int opacity) {
+ if (mAccessibilityPreviewDrawable == null) {
+ mAccessibilityPreviewDrawable = AccessibilityLayerDrawable.createLayerDrawable(
mContext, resId, opacity);
} else {
- mFloatingMenuPreviewDrawable.updateLayerDrawable(mContext, resId, opacity);
+ mAccessibilityPreviewDrawable.updateLayerDrawable(mContext, resId, opacity);
}
- return mFloatingMenuPreviewDrawable;
+ return mAccessibilityPreviewDrawable;
}
}
diff --git a/src/com/android/settings/accessibility/AccessibilityControlTimeoutFooterPreferenceController.java b/src/com/android/settings/accessibility/AccessibilityControlTimeoutFooterPreferenceController.java
index 0e65ac5..498b767 100644
--- a/src/com/android/settings/accessibility/AccessibilityControlTimeoutFooterPreferenceController.java
+++ b/src/com/android/settings/accessibility/AccessibilityControlTimeoutFooterPreferenceController.java
@@ -31,8 +31,14 @@
}
@Override
- protected String getLabelName() {
- return mContext.getString(R.string.accessibility_setting_item_control_timeout_title);
+ protected String getLearnMoreContentDescription() {
+ return mContext.getString(
+ R.string.accessibility_control_timeout_footer_learn_more_content_description);
+ }
+
+ @Override
+ protected String getIntroductionTitle() {
+ return mContext.getString(R.string.accessibility_control_timeout_about_title);
}
@Override
diff --git a/src/com/android/settings/accessibility/AccessibilityDialogUtils.java b/src/com/android/settings/accessibility/AccessibilityDialogUtils.java
index ffe5d6d..a9ba14a 100644
--- a/src/com/android/settings/accessibility/AccessibilityDialogUtils.java
+++ b/src/com/android/settings/accessibility/AccessibilityDialogUtils.java
@@ -344,12 +344,11 @@
private static void initSoftwareShortcut(Context context, View view) {
final View dialogView = view.findViewById(R.id.software_shortcut);
- final CharSequence title = context.getText(
- R.string.accessibility_shortcut_edit_dialog_title_software);
final TextView summary = dialogView.findViewById(R.id.summary);
final int lineHeight = summary.getLineHeight();
- setupShortcutWidget(dialogView, title,
+ setupShortcutWidget(dialogView,
+ retrieveTitle(context),
retrieveSoftwareShortcutSummary(context, lineHeight),
retrieveSoftwareShortcutImageResId(context));
}
@@ -398,20 +397,49 @@
return sb;
}
+ private static CharSequence retrieveTitle(Context context) {
+ int resId;
+ if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
+ resId = R.string.accessibility_shortcut_edit_dialog_title_software;
+ } else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
+ resId = R.string.accessibility_shortcut_edit_dialog_title_software_by_gesture;
+ } else {
+ resId = R.string.accessibility_shortcut_edit_dialog_title_software;
+ }
+ return context.getText(resId);
+ }
+
private static CharSequence retrieveSoftwareShortcutSummary(Context context, int lineHeight) {
final SpannableStringBuilder sb = new SpannableStringBuilder();
- if (!AccessibilityUtil.isFloatingMenuEnabled(context)) {
+ if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
+ sb.append(getCustomizeAccessibilityButtonLink(context));
+ } else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
+ final int resId = AccessibilityUtil.isTouchExploreEnabled(context)
+ ? R.string.accessibility_shortcut_edit_dialog_summary_software_gesture_talkback
+ : R.string.accessibility_shortcut_edit_dialog_summary_software_gesture;
+ sb.append(context.getText(resId));
+ sb.append("\n\n");
+ sb.append(getCustomizeAccessibilityButtonLink(context));
+ } else {
sb.append(getSummaryStringWithIcon(context, lineHeight));
sb.append("\n\n");
+ sb.append(getCustomizeAccessibilityButtonLink(context));
}
- sb.append(getCustomizeAccessibilityButtonLink(context));
return sb;
}
private static int retrieveSoftwareShortcutImageResId(Context context) {
- return AccessibilityUtil.isFloatingMenuEnabled(context)
- ? R.drawable.accessibility_shortcut_type_software_floating
- : R.drawable.accessibility_shortcut_type_software;
+ int resId;
+ if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
+ resId = R.drawable.accessibility_shortcut_type_software_floating;
+ } else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
+ resId = AccessibilityUtil.isTouchExploreEnabled(context)
+ ? R.drawable.accessibility_shortcut_type_software_gesture_talkback
+ : R.drawable.accessibility_shortcut_type_software_gesture;
+ } else {
+ resId = R.drawable.accessibility_shortcut_type_software;
+ }
+ return resId;
}
private static CharSequence getCustomizeAccessibilityButtonLink(Context context) {
@@ -422,7 +450,6 @@
.launch();
final AnnotationSpan.LinkInfo linkInfo = new AnnotationSpan.LinkInfo(
AnnotationSpan.LinkInfo.DEFAULT_ANNOTATION, linkListener);
-
return AnnotationSpan.linkify(context.getText(
R.string.accessibility_shortcut_edit_dialog_summary_software_floating), linkInfo);
}
diff --git a/src/com/android/settings/accessibility/AccessibilityFooterPreferenceController.java b/src/com/android/settings/accessibility/AccessibilityFooterPreferenceController.java
index e3422e4..08e5906 100644
--- a/src/com/android/settings/accessibility/AccessibilityFooterPreferenceController.java
+++ b/src/com/android/settings/accessibility/AccessibilityFooterPreferenceController.java
@@ -21,14 +21,18 @@
import androidx.preference.PreferenceScreen;
-import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
import com.android.settingslib.HelpUtils;
/**
- * Base class for accessibility preference footer.
+ * Preference controller that controls the help link and customizes the preference title in {@link
+ * AccessibilityFooterPreference}.
*/
-public abstract class AccessibilityFooterPreferenceController extends BasePreferenceController {
+public class AccessibilityFooterPreferenceController extends BasePreferenceController {
+
+ private int mHelpResource;
+ private String mLearnMoreContentDescription;
+ private String mIntroductionTitle;
public AccessibilityFooterPreferenceController(Context context, String key) {
super(context, key);
@@ -49,23 +53,55 @@
}
/**
- * Override this if showing a help item in the footer bar, by returning the resource id.
+ * Setups a help item in the {@link AccessibilityFooterPreference} with specific content
+ * description.
+ */
+ public void setupHelpLink(int helpResource, String learnMoreContentDescription) {
+ mHelpResource = helpResource;
+ mLearnMoreContentDescription = learnMoreContentDescription;
+ }
+
+ /**
+ * Overrides this if showing a help item in the {@link AccessibilityFooterPreference}, by
+ * returning the resource id.
*
* @return the resource id for the help url
*/
protected int getHelpResource() {
- return 0;
+ return mHelpResource;
}
- /** Returns the accessibility feature name. */
- protected abstract String getLabelName();
+ /**
+ * Overrides this if showing a help item in the {@link AccessibilityFooterPreference} with
+ * specific content description.
+ *
+ * @return the content description for the help url
+ */
+ protected String getLearnMoreContentDescription() {
+ return mLearnMoreContentDescription;
+ }
+
+ /**
+ * Sets the announcement the specific features introduction in the {@link
+ * AccessibilityFooterPreference}.
+ */
+ public void setIntroductionTitle(String introductionTitle) {
+ mIntroductionTitle = introductionTitle;
+ }
+
+ /**
+ * Overrides this if announcement the specific features introduction in the {@link
+ * AccessibilityFooterPreference}.
+ *
+ * @return the extended content description for specific features introduction
+ */
+ protected String getIntroductionTitle() {
+ return mIntroductionTitle;
+ }
private void updateFooterPreferences(AccessibilityFooterPreference footerPreference) {
final StringBuffer sb = new StringBuffer();
- sb.append(mContext.getString(
- R.string.accessibility_introduction_title, getLabelName()))
- .append("\n\n")
- .append(footerPreference.getTitle());
+ sb.append(getIntroductionTitle()).append("\n\n").append(footerPreference.getTitle());
footerPreference.setContentDescription(sb);
if (getHelpResource() != 0) {
@@ -75,10 +111,10 @@
mContext.getClass().getName());
view.startActivityForResult(helpIntent, 0);
});
-
- final String learnMoreContentDescription = mContext.getString(
- R.string.footer_learn_more_content_description, getLabelName());
- footerPreference.setLearnMoreContentDescription(learnMoreContentDescription);
+ footerPreference.setLearnMoreContentDescription(getLearnMoreContentDescription());
+ footerPreference.setLinkEnabled(true);
+ } else {
+ footerPreference.setLinkEnabled(false);
}
}
}
diff --git a/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java b/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java
index f8cdcb3..bc2e05d 100644
--- a/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java
+++ b/src/com/android/settings/accessibility/AccessibilityGestureNavigationTutorial.java
@@ -27,6 +27,7 @@
import android.graphics.drawable.Drawable;
import android.text.Spannable;
import android.text.SpannableString;
+import android.text.SpannableStringBuilder;
import android.text.style.ImageSpan;
import android.view.Gravity;
import android.view.LayoutInflater;
@@ -323,8 +324,7 @@
}
private static TutorialPage createSoftwareTutorialPage(@NonNull Context context) {
- final CharSequence title = context.getText(
- R.string.accessibility_tutorial_dialog_title_button);
+ final CharSequence title = getSoftwareTitle(context);
final ImageView image = createSoftwareImage(context);
final CharSequence instruction = getSoftwareInstruction(context);
final ImageView indicatorIcon =
@@ -382,18 +382,46 @@
}
private static ImageView createSoftwareImage(Context context) {
- final int resId = AccessibilityUtil.isFloatingMenuEnabled(context)
- ? R.drawable.accessibility_shortcut_type_software_floating
- : R.drawable.accessibility_shortcut_type_software;
-
+ int resId;
+ if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
+ resId = R.drawable.accessibility_shortcut_type_software_floating;
+ } else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
+ resId = AccessibilityUtil.isTouchExploreEnabled(context)
+ ? R.drawable.accessibility_shortcut_type_software_gesture_talkback
+ : R.drawable.accessibility_shortcut_type_software_gesture;
+ } else {
+ resId = R.drawable.accessibility_shortcut_type_software;
+ }
return createImageView(context, resId);
}
+ private static CharSequence getSoftwareTitle(Context context) {
+ int resId;
+ if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
+ resId = R.string.accessibility_tutorial_dialog_title_button;
+ } else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
+ resId = R.string.accessibility_tutorial_dialog_title_gesture;
+ } else {
+ resId = R.string.accessibility_tutorial_dialog_title_button;
+ }
+ return context.getText(resId);
+ }
+
private static CharSequence getSoftwareInstruction(Context context) {
- return AccessibilityUtil.isFloatingMenuEnabled(context)
- ? context.getText(R.string.accessibility_tutorial_dialog_message_floating_button)
- : getSoftwareInstructionWithIcon(context,
- context.getText(R.string.accessibility_tutorial_dialog_message_button));
+ final SpannableStringBuilder sb = new SpannableStringBuilder();
+ if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
+ final int resId = R.string.accessibility_tutorial_dialog_message_floating_button;
+ sb.append(context.getText(resId));
+ } else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
+ final int resId = AccessibilityUtil.isTouchExploreEnabled(context)
+ ? R.string.accessibility_tutorial_dialog_message_gesture_talkback
+ : R.string.accessibility_tutorial_dialog_message_gesture;
+ sb.append(context.getText(resId));
+ } else {
+ final int resId = R.string.accessibility_tutorial_dialog_message_button;
+ sb.append(getSoftwareInstructionWithIcon(context, context.getText(resId)));
+ }
+ return sb;
}
private static CharSequence getSoftwareInstructionWithIcon(Context context, CharSequence text) {
diff --git a/src/com/android/settings/accessibility/FloatingMenuLayerDrawable.java b/src/com/android/settings/accessibility/AccessibilityLayerDrawable.java
similarity index 76%
rename from src/com/android/settings/accessibility/FloatingMenuLayerDrawable.java
rename to src/com/android/settings/accessibility/AccessibilityLayerDrawable.java
index bfce114..b04a969 100644
--- a/src/com/android/settings/accessibility/FloatingMenuLayerDrawable.java
+++ b/src/com/android/settings/accessibility/AccessibilityLayerDrawable.java
@@ -27,10 +27,10 @@
import java.util.Objects;
-/** LayerDrawable that contains device icon as background and floating menu icon as foreground. */
-public class FloatingMenuLayerDrawable extends LayerDrawable {
+/** LayerDrawable that contains device icon as background and given icon as foreground. */
+public class AccessibilityLayerDrawable extends LayerDrawable {
- private FloatingMenuLayerDrawableState mState;
+ private AccessibilityLayerDrawableState mState;
/**
* Creates a new layer drawable with the list of specified layers.
@@ -38,23 +38,23 @@
* @param layers a list of drawables to use as layers in this new drawable,
* must be non-null
*/
- private FloatingMenuLayerDrawable(@NonNull Drawable[] layers) {
+ private AccessibilityLayerDrawable(@NonNull Drawable[] layers) {
super(layers);
}
/**
- * Create the {@link LayerDrawable} that contains device icon as background and floating menu
- * icon with given {@code opacity} value as foreground.
+ * Create the {@link LayerDrawable} that contains device icon as background and given menu icon
+ * with given {@code opacity} value as foreground.
*
* @param context the valid context used to get the icon
- * @param resId the resource ID of the floating menu icon
+ * @param resId the resource ID of the given icon
* @param opacity the opacity to apply to the given icon
- * @return the drawable that combines the device icon and the floating menu icon
+ * @return the drawable that combines the device icon and the given icon
*/
- public static FloatingMenuLayerDrawable createLayerDrawable(Context context, int resId,
+ public static AccessibilityLayerDrawable createLayerDrawable(Context context, int resId,
int opacity) {
final Drawable bg = context.getDrawable(R.drawable.accessibility_button_preview_base);
- final FloatingMenuLayerDrawable basicDrawable = new FloatingMenuLayerDrawable(
+ final AccessibilityLayerDrawable basicDrawable = new AccessibilityLayerDrawable(
new Drawable[]{bg, null});
basicDrawable.updateLayerDrawable(context, resId, opacity);
@@ -66,7 +66,7 @@
* value at index 1 layer.
*
* @param context the valid context used to get the icon
- * @param resId the resource ID of the floating menu icon
+ * @param resId the resource ID of the given icon
* @param opacity the opacity to apply to the given icon
*/
public void updateLayerDrawable(Context context, int resId, int opacity) {
@@ -83,18 +83,18 @@
/** Stores the constant state and data to the given drawable. */
private void setConstantState(Context context, int resId, int opacity) {
- mState = new FloatingMenuLayerDrawableState(context, resId, opacity);
+ mState = new AccessibilityLayerDrawableState(context, resId, opacity);
}
- /** {@link ConstantState} to store the data of {@link FloatingMenuLayerDrawable}. */
+ /** {@link ConstantState} to store the data of {@link AccessibilityLayerDrawable}. */
@VisibleForTesting
- static class FloatingMenuLayerDrawableState extends ConstantState {
+ static class AccessibilityLayerDrawableState extends ConstantState {
private final Context mContext;
private final int mResId;
private final int mOpacity;
- FloatingMenuLayerDrawableState(Context context, int resId, int opacity) {
+ AccessibilityLayerDrawableState(Context context, int resId, int opacity) {
mContext = context;
mResId = resId;
mOpacity = opacity;
@@ -119,7 +119,7 @@
if (o == null || getClass() != o.getClass()) {
return false;
}
- final FloatingMenuLayerDrawableState that = (FloatingMenuLayerDrawableState) o;
+ final AccessibilityLayerDrawableState that = (AccessibilityLayerDrawableState) o;
return mResId == that.mResId
&& mOpacity == that.mOpacity
&& Objects.equals(mContext, that.mContext);
diff --git a/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java b/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
index 127c7c6..22f037b 100644
--- a/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/AccessibilityShortcutPreferenceFragment.java
@@ -115,8 +115,7 @@
mShortcutPreference.setKey(getShortcutPreferenceKey());
mShortcutPreference.setOnClickCallback(this);
- final CharSequence title = getString(R.string.accessibility_shortcut_title, getLabelName());
- mShortcutPreference.setTitle(title);
+ updateShortcutTitle(mShortcutPreference);
getPreferenceScreen().addPreference(mShortcutPreference);
mTouchExplorationStateChangeListener = isTouchExplorationEnabled -> {
@@ -182,6 +181,11 @@
}
}
+ protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
+ final CharSequence title = getString(R.string.accessibility_shortcut_title, getLabelName());
+ shortcutPreference.setTitle(title);
+ }
+
@Override
public int getDialogMetricsCategory(int dialogId) {
switch (dialogId) {
diff --git a/src/com/android/settings/accessibility/CaptionFooterPreferenceController.java b/src/com/android/settings/accessibility/CaptionFooterPreferenceController.java
index 4e50b89..495d395 100644
--- a/src/com/android/settings/accessibility/CaptionFooterPreferenceController.java
+++ b/src/com/android/settings/accessibility/CaptionFooterPreferenceController.java
@@ -30,12 +30,18 @@
}
@Override
- protected String getLabelName() {
- return mContext.getString(R.string.accessibility_captioning_title);
+ protected String getLearnMoreContentDescription() {
+ return mContext.getString(
+ R.string.accessibility_captioning_footer_learn_more_content_description);
}
@Override
- protected int getHelpResource() {
+ protected String getIntroductionTitle() {
+ return mContext.getString(R.string.accessibility_captioning_about_title);
+ }
+
+ @Override
+ protected int getHelpResource() {
return R.string.help_url_caption;
}
}
diff --git a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
index 9349071..0e209aa 100644
--- a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
@@ -55,7 +55,6 @@
import com.android.settings.R;
import com.android.settings.accessibility.AccessibilityUtil.UserShortcutType;
import com.android.settings.password.ConfirmDeviceCredentialActivity;
-import com.android.settings.widget.SettingsMainSwitchPreference;
import com.android.settingslib.accessibility.AccessibilityUtils;
import java.util.List;
@@ -222,15 +221,6 @@
}
@Override
- protected void updateToggleServiceTitle(SettingsMainSwitchPreference switchPreference) {
- final AccessibilityServiceInfo info = getAccessibilityServiceInfo();
- final String switchBarText = (info == null) ? "" :
- getString(R.string.accessibility_service_primary_switch_title,
- info.getResolveInfo().loadLabel(getPackageManager()));
- switchPreference.setTitle(switchBarText);
- }
-
- @Override
protected void updateSwitchBarToggleSwitch() {
final boolean checked = isAccessibilityServiceEnabled();
if (mToggleServiceSwitchPreference.isChecked() == checked) {
diff --git a/src/com/android/settings/accessibility/ToggleAutoclickFooterPreferenceController.java b/src/com/android/settings/accessibility/ToggleAutoclickFooterPreferenceController.java
index 053fa9d..962ffec 100644
--- a/src/com/android/settings/accessibility/ToggleAutoclickFooterPreferenceController.java
+++ b/src/com/android/settings/accessibility/ToggleAutoclickFooterPreferenceController.java
@@ -31,8 +31,14 @@
}
@Override
- protected String getLabelName() {
- return mContext.getString(R.string.accessibility_autoclick_preference_title);
+ protected String getLearnMoreContentDescription() {
+ return mContext.getString(
+ R.string.accessibility_autoclick_footer_learn_more_content_description);
+ }
+
+ @Override
+ protected String getIntroductionTitle() {
+ return mContext.getString(R.string.accessibility_autoclick_about_title);
}
@Override
diff --git a/src/com/android/settings/accessibility/ToggleColorInversionPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleColorInversionPreferenceFragment.java
index b41bafd..419514f 100644
--- a/src/com/android/settings/accessibility/ToggleColorInversionPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleColorInversionPreferenceFragment.java
@@ -38,8 +38,7 @@
import java.util.List;
/** Settings page for color inversion. */
-public class ToggleColorInversionPreferenceFragment extends
- ToggleFeaturePreferenceFragment {
+public class ToggleColorInversionPreferenceFragment extends ToggleFeaturePreferenceFragment {
private static final String ENABLED = Settings.Secure.ACCESSIBILITY_DISPLAY_INVERSION_ENABLED;
private final Handler mHandler = new Handler();
@@ -73,6 +72,11 @@
}
@Override
+ protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
+ shortcutPreference.setTitle(R.string.accessibility_display_inversion_shortcut_title);
+ }
+
+ @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mComponentName = COLOR_INVERSION_COMPONENT_NAME;
@@ -90,7 +94,20 @@
updateSwitchBarToggleSwitch();
}
};
- return super.onCreateView(inflater, container, savedInstanceState);
+
+ final View view = super.onCreateView(inflater, container, savedInstanceState);
+ updateFooterPreference();
+ return view;
+ }
+
+ private void updateFooterPreference() {
+ final String title = getPrefContext().getString(
+ R.string.accessibility_color_inversion_about_title);
+ final String learnMoreContentDescription = getPrefContext().getString(
+ R.string.accessibility_color_inversion_footer_learn_more_content_description);
+ mFooterPreferenceController.setIntroductionTitle(title);
+ mFooterPreferenceController.setupHelpLink(getHelpResource(), learnMoreContentDescription);
+ mFooterPreferenceController.displayPreference(getPreferenceScreen());
}
@Override
diff --git a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
index 4bcf478..c9449d24 100644
--- a/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleDaltonizerPreferenceFragment.java
@@ -92,12 +92,20 @@
updateSwitchBarToggleSwitch();
}
};
- return super.onCreateView(inflater, container, savedInstanceState);
+
+ final View view = super.onCreateView(inflater, container, savedInstanceState);
+ updateFooterPreference();
+ return view;
}
- @Override
- public void onViewCreated(View view, Bundle savedInstanceState) {
- super.onViewCreated(view, savedInstanceState);
+ private void updateFooterPreference() {
+ final String title = getPrefContext()
+ .getString(R.string.accessibility_daltonizer_about_title);
+ final String learnMoreContentDescription = getPrefContext()
+ .getString(R.string.accessibility_daltonizer_footer_learn_more_content_description);
+ mFooterPreferenceController.setIntroductionTitle(title);
+ mFooterPreferenceController.setupHelpLink(getHelpResource(), learnMoreContentDescription);
+ mFooterPreferenceController.displayPreference(getPreferenceScreen());
}
/** Customizes the order by preference key. */
@@ -168,6 +176,11 @@
}
@Override
+ protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
+ shortcutPreference.setTitle(R.string.accessibility_daltonizer_shortcut_title);
+ }
+
+ @Override
int getUserShortcutTypes() {
return AccessibilityUtil.getUserShortcutTypesFromSettings(getPrefContext(),
mComponentName);
diff --git a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
index 510f8d3..245f362 100644
--- a/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleFeaturePreferenceFragment.java
@@ -57,7 +57,6 @@
import com.android.settings.utils.LocaleUtils;
import com.android.settings.widget.SettingsMainSwitchBar;
import com.android.settings.widget.SettingsMainSwitchPreference;
-import com.android.settingslib.HelpUtils;
import com.android.settingslib.accessibility.AccessibilityUtils;
import com.android.settingslib.widget.IllustrationPreference;
import com.android.settingslib.widget.OnMainSwitchChangeListener;
@@ -78,6 +77,7 @@
protected SettingsMainSwitchPreference mToggleServiceSwitchPreference;
protected ShortcutPreference mShortcutPreference;
protected Preference mSettingsPreference;
+ protected AccessibilityFooterPreferenceController mFooterPreferenceController;
protected String mPreferenceKey;
protected CharSequence mSettingsTitle;
@@ -284,7 +284,14 @@
abstract int getUserShortcutTypes();
protected void updateToggleServiceTitle(SettingsMainSwitchPreference switchPreference) {
- switchPreference.setTitle(R.string.accessibility_service_primary_switch_title);
+ final CharSequence title =
+ getString(R.string.accessibility_service_primary_switch_title, mPackageName);
+ switchPreference.setTitle(title);
+ }
+
+ protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
+ final CharSequence title = getString(R.string.accessibility_shortcut_title, mPackageName);
+ shortcutPreference.setTitle(title);
}
protected abstract void onPreferenceToggled(String preferenceKey, boolean enabled);
@@ -434,8 +441,7 @@
mShortcutPreference.setKey(getShortcutPreferenceKey());
mShortcutPreference.setOnClickCallback(this);
- final CharSequence title = getString(R.string.accessibility_shortcut_title, mPackageName);
- mShortcutPreference.setTitle(title);
+ updateShortcutTitle(mShortcutPreference);
final PreferenceCategory generalCategory = findPreference(KEY_GENERAL_CATEGORY);
generalCategory.addPreference(mShortcutPreference);
@@ -463,33 +469,19 @@
final PreferenceScreen screen = getPreferenceScreen();
final CharSequence htmlDescription = Html.fromHtml(mHtmlDescription.toString(),
Html.FROM_HTML_MODE_COMPACT, mImageGetter, /* tagHandler= */ null);
- final String iconContentDescription =
- getString(R.string.accessibility_introduction_title, mPackageName);
final AccessibilityFooterPreference htmlFooterPreference =
new AccessibilityFooterPreference(screen.getContext());
htmlFooterPreference.setKey(KEY_HTML_DESCRIPTION_PREFERENCE);
htmlFooterPreference.setSummary(htmlDescription);
- htmlFooterPreference.setContentDescription(
- generateFooterContentDescription(htmlDescription));
-
- // Only framework tools support help link
- if (getHelpResource() != 0) {
- htmlFooterPreference.setLearnMoreAction(view -> {
- final Intent helpIntent = HelpUtils.getHelpIntent(
- getContext(), getContext().getString(getHelpResource()),
- getContext().getClass().getName());
- view.startActivityForResult(helpIntent, 0);
- });
-
- final String learnMoreContentDescription = getPrefContext().getString(
- R.string.footer_learn_more_content_description, mPackageName);
- htmlFooterPreference.setLearnMoreContentDescription(learnMoreContentDescription);
- htmlFooterPreference.setLinkEnabled(true);
- } else {
- htmlFooterPreference.setLinkEnabled(false);
- }
screen.addPreference(htmlFooterPreference);
+
+ // TODO(b/171272809): Migrate to DashboardFragment.
+ final String title = getString(R.string.accessibility_introduction_title, mPackageName);
+ mFooterPreferenceController = new AccessibilityFooterPreferenceController(
+ screen.getContext(), htmlFooterPreference.getKey());
+ mFooterPreferenceController.setIntroductionTitle(title);
+ mFooterPreferenceController.displayPreference(screen);
}
private void initFooterPreference() {
@@ -512,41 +504,22 @@
*
* @param screen The preference screen to add the footer preference
* @param summary The summary of the preference summary.
- * @param iconContentDescription The content description of icon in the footer.
+ * @param introductionTitle The title of introduction in the footer.
*/
@VisibleForTesting
void createFooterPreference(PreferenceScreen screen, CharSequence summary,
- String iconContentDescription) {
+ String introductionTitle) {
final AccessibilityFooterPreference footerPreference =
new AccessibilityFooterPreference(screen.getContext());
footerPreference.setSummary(summary);
- footerPreference.setContentDescription(
- generateFooterContentDescription(summary));
-
- // Only framework tools support help link
- if (getHelpResource() != 0) {
- footerPreference.setLearnMoreAction(view -> {
- final Intent helpIntent = HelpUtils.getHelpIntent(
- getContext(), getContext().getString(getHelpResource()),
- getContext().getClass().getName());
- view.startActivityForResult(helpIntent, 0);
- });
-
- final String learnMoreContentDescription = getPrefContext().getString(
- R.string.footer_learn_more_content_description, mPackageName);
- footerPreference.setLearnMoreContentDescription(learnMoreContentDescription);
- }
screen.addPreference(footerPreference);
+
+ mFooterPreferenceController = new AccessibilityFooterPreferenceController(
+ screen.getContext(), footerPreference.getKey());
+ mFooterPreferenceController.setIntroductionTitle(introductionTitle);
+ mFooterPreferenceController.displayPreference(screen);
}
- private CharSequence generateFooterContentDescription(CharSequence footerContent) {
- final StringBuffer sb = new StringBuffer();
- sb.append(getPrefContext().getString(
- R.string.accessibility_introduction_title, mPackageName))
- .append("\n\n")
- .append(footerContent);
- return sb;
- }
@VisibleForTesting
void setupEditShortcutDialog(Dialog dialog) {
final View dialogSoftwareView = dialog.findViewById(R.id.software_shortcut);
@@ -611,6 +584,18 @@
return value;
}
+ private static CharSequence getSoftwareShortcutTypeSummary(Context context) {
+ int resId;
+ if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
+ resId = R.string.accessibility_shortcut_edit_summary_software;
+ } else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
+ resId = R.string.accessibility_shortcut_edit_summary_software_gesture;
+ } else {
+ resId = R.string.accessibility_shortcut_edit_summary_software;
+ }
+ return context.getText(resId);
+ }
+
protected CharSequence getShortcutTypeSummary(Context context) {
if (!mShortcutPreference.isSettingsEditable()) {
return context.getText(R.string.accessibility_shortcut_edit_dialog_title_hardware);
@@ -624,11 +609,8 @@
mComponentName.flattenToString(), UserShortcutType.SOFTWARE);
final List<CharSequence> list = new ArrayList<>();
- final CharSequence softwareTitle = context.getText(
- R.string.accessibility_shortcut_edit_summary_software);
-
if (hasShortcutType(shortcutTypes, UserShortcutType.SOFTWARE)) {
- list.add(softwareTitle);
+ list.add(getSoftwareShortcutTypeSummary(context));
}
if (hasShortcutType(shortcutTypes, UserShortcutType.HARDWARE)) {
final CharSequence hardwareTitle = context.getText(
@@ -638,7 +620,7 @@
// Show software shortcut if first time to use.
if (list.isEmpty()) {
- list.add(softwareTitle);
+ list.add(getSoftwareShortcutTypeSummary(context));
}
return CaseMap.toTitle().wholeString().noLowercase().apply(Locale.getDefault(), /* iter= */
diff --git a/src/com/android/settings/accessibility/ToggleReduceBrightColorsPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleReduceBrightColorsPreferenceFragment.java
index e60751e..81bd45a 100644
--- a/src/com/android/settings/accessibility/ToggleReduceBrightColorsPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleReduceBrightColorsPreferenceFragment.java
@@ -86,6 +86,7 @@
// Parent sets the title when creating the view, so set it after calling super
mToggleServiceSwitchPreference.setTitle(R.string.reduce_bright_colors_switch_title);
updateGeneralCategoryOrder();
+ updateFooterPreference();
return view;
}
@@ -101,6 +102,12 @@
generalCategory.addPreference(persist);
}
+ private void updateFooterPreference() {
+ final String title = getPrefContext().getString(R.string.reduce_bright_colors_about_title);
+ mFooterPreferenceController.setIntroductionTitle(title);
+ mFooterPreferenceController.displayPreference(getPreferenceScreen());
+ }
+
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
@@ -135,7 +142,6 @@
return R.xml.reduce_bright_colors_settings;
}
-
@Override
protected void onPreferenceToggled(String preferenceKey, boolean enabled) {
AccessibilityStatsLogUtils.logAccessibilityServiceEnabled(mComponentName, enabled);
@@ -155,6 +161,11 @@
}
@Override
+ protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
+ shortcutPreference.setTitle(R.string.reduce_bright_colors_shortcut_title);
+ }
+
+ @Override
int getUserShortcutTypes() {
return AccessibilityUtil.getUserShortcutTypesFromSettings(getPrefContext(),
mComponentName);
diff --git a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
index 9266f72..1c7ce39 100644
--- a/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleScreenMagnificationPreferenceFragment.java
@@ -95,7 +95,20 @@
removeDialog(DialogEnums.EDIT_SHORTCUT);
mShortcutPreference.setSummary(getShortcutTypeSummary(getPrefContext()));
};
- return super.onCreateView(inflater, container, savedInstanceState);
+
+ final View view = super.onCreateView(inflater, container, savedInstanceState);
+ updateFooterPreference();
+ return view;
+ }
+
+ private void updateFooterPreference() {
+ final String title = getPrefContext().getString(
+ R.string.accessibility_screen_magnification_about_title);
+ final String learnMoreContentDescription = getPrefContext().getString(
+ R.string.accessibility_screen_magnification_footer_learn_more_content_description);
+ mFooterPreferenceController.setIntroductionTitle(title);
+ mFooterPreferenceController.setupHelpLink(getHelpResource(), learnMoreContentDescription);
+ mFooterPreferenceController.displayPreference(getPreferenceScreen());
}
@Override
@@ -252,6 +265,18 @@
return (value & type) == type;
}
+ private static CharSequence getSoftwareShortcutTypeSummary(Context context) {
+ int resId;
+ if (AccessibilityUtil.isFloatingMenuEnabled(context)) {
+ resId = R.string.accessibility_shortcut_edit_summary_software;
+ } else if (AccessibilityUtil.isGestureNavigateEnabled(context)) {
+ resId = R.string.accessibility_shortcut_edit_summary_software_gesture;
+ } else {
+ resId = R.string.accessibility_shortcut_edit_summary_software;
+ }
+ return context.getText(resId);
+ }
+
@Override
protected CharSequence getShortcutTypeSummary(Context context) {
if (!mShortcutPreference.isChecked()) {
@@ -262,18 +287,14 @@
MAGNIFICATION_CONTROLLER_NAME, UserShortcutType.SOFTWARE);
final List<CharSequence> list = new ArrayList<>();
- final CharSequence softwareTitle = context.getText(
- R.string.accessibility_shortcut_edit_summary_software);
-
if (hasShortcutType(shortcutTypes, UserShortcutType.SOFTWARE)) {
- list.add(softwareTitle);
+ list.add(getSoftwareShortcutTypeSummary(context));
}
if (hasShortcutType(shortcutTypes, UserShortcutType.HARDWARE)) {
final CharSequence hardwareTitle = context.getText(
R.string.accessibility_shortcut_hardware_keyword);
list.add(hardwareTitle);
}
-
if (hasShortcutType(shortcutTypes, UserShortcutType.TRIPLETAP)) {
final CharSequence tripleTapTitle = context.getText(
R.string.accessibility_shortcut_triple_tap_keyword);
@@ -282,7 +303,7 @@
// Show software shortcut if first time to use.
if (list.isEmpty()) {
- list.add(softwareTitle);
+ list.add(getSoftwareShortcutTypeSummary(context));
}
return CaseMap.toTitle().wholeString().noLowercase().apply(Locale.getDefault(), /* iter= */
@@ -397,6 +418,11 @@
}
@Override
+ protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
+ shortcutPreference.setTitle(R.string.accessibility_screen_magnification_shortcut_title);
+ }
+
+ @Override
protected void updateShortcutPreference() {
final int shortcutTypes = PreferredShortcuts.retrieveUserShortcutType(getPrefContext(),
MAGNIFICATION_CONTROLLER_NAME, UserShortcutType.SOFTWARE);
diff --git a/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java b/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java
index 7c69618..afbb71f 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageAdvanced.java
@@ -19,8 +19,11 @@
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.database.ContentObserver;
+import android.net.Uri;
import android.os.BatteryManager;
import android.os.Bundle;
+import android.os.Handler;
import android.provider.SearchIndexableResource;
import android.util.Log;
@@ -31,6 +34,7 @@
import com.android.settings.R;
import com.android.settings.SettingsActivity;
+import com.android.settings.fuelgauge.BatteryBroadcastReceiver;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.core.AbstractPreferenceController;
@@ -63,6 +67,17 @@
private BatteryChartPreferenceController mBatteryChartPreferenceController;
private BatteryAppListPreferenceController mBatteryAppListPreferenceController;
+ private final ContentObserver mBatteryObserver =
+ new ContentObserver(new Handler()) {
+ @Override
+ public void onChange(boolean selfChange) {
+ Log.d(TAG, "onBatteryContentChange: " + selfChange);
+ mIsChartDataLoaded = false;
+ restartBatteryStatsLoader(
+ BatteryBroadcastReceiver.BatteryUpdateType.MANUAL);
+ }
+ };
+
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
@@ -104,6 +119,20 @@
super.onPause();
// Resets the flag to reload usage data in onResume() callback.
mIsChartDataLoaded = false;
+ final Uri uri = mPowerUsageFeatureProvider.getBatteryHistoryUri();
+ if (uri != null) {
+ getContext().getContentResolver().unregisterContentObserver(mBatteryObserver);
+ }
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ final Uri uri = mPowerUsageFeatureProvider.getBatteryHistoryUri();
+ if (uri != null) {
+ getContext().getContentResolver().registerContentObserver(
+ uri, /*notifyForDescendants*/ true, mBatteryObserver);
+ }
}
@Override
diff --git a/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java b/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
index 61abe6b..d914825 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageFeatureProvider.java
@@ -18,6 +18,7 @@
import android.content.Context;
import android.content.Intent;
+import android.net.Uri;
import android.util.SparseIntArray;
import com.android.internal.os.BatterySipper;
@@ -141,4 +142,9 @@
* Returns battery history data with corresponding timestamp key.
*/
Map<Long, Map<String, BatteryHistEntry>> getBatteryHistory(Context context);
+
+ /**
+ * Returns {@link Uri} to monitor battery history data is update.
+ */
+ Uri getBatteryHistoryUri();
}
diff --git a/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java b/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
index 1dcdab0..895bbb2 100644
--- a/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
+++ b/src/com/android/settings/fuelgauge/PowerUsageFeatureProviderImpl.java
@@ -19,6 +19,7 @@
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
+import android.net.Uri;
import android.os.Process;
import android.util.SparseIntArray;
@@ -167,4 +168,9 @@
public Map<Long, Map<String, BatteryHistEntry>> getBatteryHistory(Context context) {
return null;
}
+
+ @Override
+ public Uri getBatteryHistoryUri() {
+ return null;
+ }
}
diff --git a/src/com/android/settings/gestures/OneHandedActionPullDownPrefController.java b/src/com/android/settings/gestures/OneHandedActionPullDownPrefController.java
index e17165b..26b3763 100644
--- a/src/com/android/settings/gestures/OneHandedActionPullDownPrefController.java
+++ b/src/com/android/settings/gestures/OneHandedActionPullDownPrefController.java
@@ -93,7 +93,8 @@
return;
}
if (uri.equals(OneHandedSettingsUtils.ONE_HANDED_MODE_ENABLED_URI)
- || uri.equals(OneHandedSettingsUtils.SHORTCUT_ENABLED_URI)) {
+ || uri.equals(OneHandedSettingsUtils.SOFTWARE_SHORTCUT_ENABLED_URI)
+ || uri.equals(OneHandedSettingsUtils.HARDWARE_SHORTCUT_ENABLED_URI)) {
mPreference.setEnabled(OneHandedSettingsUtils.canEnableController(mContext));
} else if (uri.equals(OneHandedSettingsUtils.SHOW_NOTIFICATION_ENABLED_URI)) {
updateState(mPreference);
diff --git a/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefController.java b/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefController.java
index 9f56a14..524c135 100644
--- a/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefController.java
+++ b/src/com/android/settings/gestures/OneHandedActionShowNotificationPrefController.java
@@ -93,7 +93,8 @@
return;
}
if (uri.equals(OneHandedSettingsUtils.ONE_HANDED_MODE_ENABLED_URI)
- || uri.equals(OneHandedSettingsUtils.SHORTCUT_ENABLED_URI)) {
+ || uri.equals(OneHandedSettingsUtils.SOFTWARE_SHORTCUT_ENABLED_URI)
+ || uri.equals(OneHandedSettingsUtils.HARDWARE_SHORTCUT_ENABLED_URI)) {
mPreference.setEnabled(OneHandedSettingsUtils.canEnableController(mContext));
} else if (uri.equals(OneHandedSettingsUtils.SHOW_NOTIFICATION_ENABLED_URI)) {
updateState(mPreference);
diff --git a/src/com/android/settings/gestures/OneHandedSettings.java b/src/com/android/settings/gestures/OneHandedSettings.java
index 51c6b66..1310789 100644
--- a/src/com/android/settings/gestures/OneHandedSettings.java
+++ b/src/com/android/settings/gestures/OneHandedSettings.java
@@ -26,6 +26,7 @@
import com.android.internal.accessibility.AccessibilityShortcutController;
import com.android.settings.R;
import com.android.settings.accessibility.AccessibilityShortcutPreferenceFragment;
+import com.android.settings.accessibility.ShortcutPreference;
import com.android.settings.search.BaseSearchIndexProvider;
import com.android.settingslib.widget.IllustrationPreference;
@@ -77,6 +78,11 @@
}
@Override
+ protected void updateShortcutTitle(ShortcutPreference shortcutPreference) {
+ shortcutPreference.setTitle(R.string.one_handed_mode_shortcut_title);
+ }
+
+ @Override
protected boolean showGeneralCategory() {
return true;
}
diff --git a/src/com/android/settings/gestures/OneHandedSettingsUtils.java b/src/com/android/settings/gestures/OneHandedSettingsUtils.java
index f058689..04898dc 100644
--- a/src/com/android/settings/gestures/OneHandedSettingsUtils.java
+++ b/src/com/android/settings/gestures/OneHandedSettingsUtils.java
@@ -27,6 +27,7 @@
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings;
+import android.text.TextUtils;
import androidx.annotation.VisibleForTesting;
@@ -45,8 +46,10 @@
Settings.Secure.getUriFor(Settings.Secure.ONE_HANDED_MODE_ENABLED);
static final Uri SHOW_NOTIFICATION_ENABLED_URI =
Settings.Secure.getUriFor(Settings.Secure.SWIPE_BOTTOM_TO_NOTIFICATION_ENABLED);
- static final Uri SHORTCUT_ENABLED_URI =
+ static final Uri SOFTWARE_SHORTCUT_ENABLED_URI =
Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS);
+ static final Uri HARDWARE_SHORTCUT_ENABLED_URI =
+ Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE);
public enum OneHandedTimeout {
NEVER(0), SHORT(4), MEDIUM(8), LONG(12);
@@ -238,9 +241,20 @@
* @return true if user enabled one-handed shortcut in settings, false otherwise.
*/
public static boolean getShortcutEnabled(Context context) {
- final String targets = Settings.Secure.getStringForUser(context.getContentResolver(),
+ // Checks SOFTWARE_SHORTCUT_KEY
+ final String targetsSW = Settings.Secure.getStringForUser(context.getContentResolver(),
Settings.Secure.ACCESSIBILITY_BUTTON_TARGETS, sCurrentUserId);
- return targets != null ? targets.contains(ONE_HANDED_MODE_TARGET_NAME) : false;
+ if (!TextUtils.isEmpty(targetsSW) && targetsSW.contains(ONE_HANDED_MODE_TARGET_NAME)) {
+ return true;
+ }
+
+ // Checks HARDWARE_SHORTCUT_KEY
+ final String targetsHW = Settings.Secure.getStringForUser(context.getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_SHORTCUT_TARGET_SERVICE, sCurrentUserId);
+ if (!TextUtils.isEmpty(targetsHW) && targetsHW.contains(ONE_HANDED_MODE_TARGET_NAME)) {
+ return true;
+ }
+ return false;
}
/**
@@ -285,7 +299,8 @@
final ContentResolver resolver = mContext.getContentResolver();
resolver.registerContentObserver(ONE_HANDED_MODE_ENABLED_URI, true, this);
resolver.registerContentObserver(SHOW_NOTIFICATION_ENABLED_URI, true, this);
- resolver.registerContentObserver(SHORTCUT_ENABLED_URI, true, this);
+ resolver.registerContentObserver(SOFTWARE_SHORTCUT_ENABLED_URI, true, this);
+ resolver.registerContentObserver(HARDWARE_SHORTCUT_ENABLED_URI, true, this);
}
@Override
diff --git a/src/com/android/settings/gestures/SystemNavigationGestureSettings.java b/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
index 4e783c9..4b9cfa3 100644
--- a/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
+++ b/src/com/android/settings/gestures/SystemNavigationGestureSettings.java
@@ -17,6 +17,7 @@
package com.android.settings.gestures;
import static android.os.UserHandle.USER_CURRENT;
+import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON_OVERLAY;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_3BUTTON_OVERLAY;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL_OVERLAY;
@@ -30,11 +31,14 @@
import android.os.RemoteException;
import android.os.ServiceManager;
import android.provider.Settings;
+import android.text.TextUtils;
+import android.view.accessibility.AccessibilityManager;
import androidx.annotation.VisibleForTesting;
import androidx.preference.PreferenceScreen;
import com.android.settings.R;
+import com.android.settings.SettingsTutorialDialogWrapperActivity;
import com.android.settings.dashboard.suggestions.SuggestionFeatureProvider;
import com.android.settings.overlay.FeatureFactory;
import com.android.settings.search.BaseSearchIndexProvider;
@@ -173,7 +177,14 @@
protected boolean setDefaultKey(String key) {
setCurrentSystemNavigationMode(mOverlayManager, key);
setIllustrationVideo(mVideoPreference, key);
-
+ if (TextUtils.equals(KEY_SYSTEM_NAV_GESTURAL, key)
+ && !isAccessibilityFloatingMenuEnabled()
+ && (isAnyServiceSupportAccessibilityButton() || isNavBarMagnificationEnabled())) {
+ final Intent intent = new Intent(getActivity(),
+ SettingsTutorialDialogWrapperActivity.class);
+ intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+ startActivity(intent);
+ }
return true;
}
@@ -246,6 +257,24 @@
}
}
+ private boolean isAnyServiceSupportAccessibilityButton() {
+ final AccessibilityManager ams = getContext().getSystemService(AccessibilityManager.class);
+ final List<String> targets = ams.getAccessibilityShortcutTargets(
+ AccessibilityManager.ACCESSIBILITY_BUTTON);
+ return !targets.isEmpty();
+ }
+
+ private boolean isNavBarMagnificationEnabled() {
+ return Settings.Secure.getInt(getContext().getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_NAVBAR_ENABLED, 0) == 1;
+ }
+
+ private boolean isAccessibilityFloatingMenuEnabled() {
+ return Settings.Secure.getInt(getContext().getContentResolver(),
+ Settings.Secure.ACCESSIBILITY_BUTTON_MODE, /* def= */ -1)
+ == ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU;
+ }
+
public static final BaseSearchIndexProvider SEARCH_INDEX_DATA_PROVIDER =
new BaseSearchIndexProvider(R.xml.system_navigation_gesture_settings) {
diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonFooterPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonFooterPreferenceControllerTest.java
index 010b444..7354555 100644
--- a/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonFooterPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonFooterPreferenceControllerTest.java
@@ -16,6 +16,7 @@
package com.android.settings.accessibility;
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON;
import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;
import static com.google.common.truth.Truth.assertThat;
@@ -46,7 +47,6 @@
@Rule
public final MockitoRule mockito = MockitoJUnit.rule();
-
@Spy
private final Context mContext = ApplicationProvider.getApplicationContext();
@Spy
@@ -76,4 +76,15 @@
assertThat(mPreference.getTitle()).isEqualTo(
mContext.getText(R.string.accessibility_button_gesture_description));
}
+
+ @Test
+ public void displayPreference_navigationGestureDisabled_setCorrectTitle() {
+ when(mResources.getInteger(com.android.internal.R.integer.config_navBarInteractionMode))
+ .thenReturn(NAV_BAR_MODE_2BUTTON);
+
+ mController.displayPreference(mScreen);
+
+ assertThat(mPreference.getTitle()).isEqualTo(
+ mContext.getText(R.string.accessibility_button_description));
+ }
}
diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonGesturePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonGesturePreferenceControllerTest.java
new file mode 100644
index 0000000..da44228
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonGesturePreferenceControllerTest.java
@@ -0,0 +1,105 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.accessibility;
+
+import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU;
+import static android.provider.Settings.Secure.ACCESSIBILITY_BUTTON_MODE_GESTURE;
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON;
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;
+
+import static com.android.settings.core.BasePreferenceController.AVAILABLE;
+import static com.android.settings.core.BasePreferenceController.CONDITIONALLY_UNAVAILABLE;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.when;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.content.res.Resources;
+import android.provider.Settings;
+
+import androidx.preference.ListPreference;
+import androidx.test.core.app.ApplicationProvider;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+import org.robolectric.RobolectricTestRunner;
+
+/** Tests for {@link AccessibilityButtonGesturePreferenceController}. */
+@RunWith(RobolectricTestRunner.class)
+public class AccessibilityButtonGesturePreferenceControllerTest {
+
+ @Rule
+ public final MockitoRule mockito = MockitoJUnit.rule();
+
+ @Spy
+ private final Context mContext = ApplicationProvider.getApplicationContext();
+ @Spy
+ private final Resources mResources = mContext.getResources();
+ private final ContentResolver mContentResolver = mContext.getContentResolver();
+ private final ListPreference mListPreference = new ListPreference(mContext);
+ private AccessibilityButtonGesturePreferenceController mController;
+
+ @Before
+ public void setUp() {
+ mController = new AccessibilityButtonGesturePreferenceController(mContext,
+ "test_key");
+ when(mContext.getResources()).thenReturn(mResources);
+ }
+
+ @Test
+ public void getAvailabilityStatus_navigationGestureEnabled_returnAvailable() {
+ when(mResources.getInteger(com.android.internal.R.integer.config_navBarInteractionMode))
+ .thenReturn(NAV_BAR_MODE_GESTURAL);
+
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(AVAILABLE);
+ }
+
+ @Test
+ public void getAvailabilityStatus_navigationGestureDisabled_returnConditionallyUnavailable() {
+ when(mResources.getInteger(com.android.internal.R.integer.config_navBarInteractionMode))
+ .thenReturn(NAV_BAR_MODE_2BUTTON);
+
+ assertThat(mController.getAvailabilityStatus()).isEqualTo(CONDITIONALLY_UNAVAILABLE);
+ }
+
+ @Test
+ public void updateState_a11yBtnModeGesture_navigationBarValue() {
+ Settings.Secure.putInt(mContentResolver, Settings.Secure.ACCESSIBILITY_BUTTON_MODE,
+ ACCESSIBILITY_BUTTON_MODE_GESTURE);
+
+ mController.updateState(mListPreference);
+
+ final String gestureValue = String.valueOf(ACCESSIBILITY_BUTTON_MODE_GESTURE);
+ assertThat(mListPreference.getValue()).isEqualTo(gestureValue);
+ }
+
+ @Test
+ public void onPreferenceChange_a11yBtnModeFloatingMenu_floatingMenuValue() {
+ final String floatingMenuValue = String.valueOf(ACCESSIBILITY_BUTTON_MODE_FLOATING_MENU);
+
+ mController.onPreferenceChange(mListPreference, floatingMenuValue);
+
+ assertThat(mListPreference.getValue()).isEqualTo(floatingMenuValue);
+ }
+}
diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonPreferenceControllerTest.java
new file mode 100644
index 0000000..03f7887
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonPreferenceControllerTest.java
@@ -0,0 +1,91 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.accessibility;
+
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_2BUTTON;
+import static android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.content.res.Resources;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceScreen;
+import androidx.test.core.app.ApplicationProvider;
+
+import com.android.settings.R;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+import org.robolectric.RobolectricTestRunner;
+
+/** Tests for {@link AccessibilityButtonPreferenceController}. */
+@RunWith(RobolectricTestRunner.class)
+public class AccessibilityButtonPreferenceControllerTest {
+
+ @Rule
+ public final MockitoRule mockito = MockitoJUnit.rule();
+ @Spy
+ private final Context mContext = ApplicationProvider.getApplicationContext();
+ @Spy
+ private final Resources mResources = mContext.getResources();
+ @Mock
+ private PreferenceScreen mScreen;
+ private Preference mPreference;
+ private AccessibilityButtonPreferenceController mController;
+
+ @Before
+ public void setUp() {
+ mController = new AccessibilityButtonPreferenceController(mContext, "test_key");
+ mPreference = new Preference(mContext);
+ mPreference.setKey("test_key");
+
+ when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
+ when(mContext.getResources()).thenReturn(mResources);
+ }
+
+ @Test
+ public void displayPreference_navigationGestureEnabled_setCorrectTitle() {
+ when(mResources.getInteger(com.android.internal.R.integer.config_navBarInteractionMode))
+ .thenReturn(NAV_BAR_MODE_GESTURAL);
+
+ mController.displayPreference(mScreen);
+
+ assertThat(mPreference.getTitle()).isEqualTo(
+ mContext.getText(R.string.accessibility_button_gesture_title));
+ }
+
+ @Test
+ public void displayPreference_navigationGestureDisabled_setCorrectTitle() {
+ when(mResources.getInteger(com.android.internal.R.integer.config_navBarInteractionMode))
+ .thenReturn(NAV_BAR_MODE_2BUTTON);
+
+ mController.displayPreference(mScreen);
+
+ assertThat(mPreference.getTitle()).isEqualTo(
+ mContext.getText(R.string.accessibility_button_title));
+ }
+}
diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonPreviewPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonPreviewPreferenceControllerTest.java
index 3065030..61808bd 100644
--- a/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonPreviewPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilityButtonPreviewPreferenceControllerTest.java
@@ -90,7 +90,7 @@
mController.mContentObserver.onChange(false);
final Drawable smallFloatingMenuWithTenOpacityDrawable =
- FloatingMenuLayerDrawable.createLayerDrawable(mContext,
+ AccessibilityLayerDrawable.createLayerDrawable(mContext,
R.drawable.accessibility_button_preview_small_floating_menu, 10);
assertThat(mController.mPreview.getDrawable().getConstantState()).isEqualTo(
smallFloatingMenuWithTenOpacityDrawable.getConstantState());
diff --git a/tests/robotests/src/com/android/settings/accessibility/AccessibilityFooterPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilityFooterPreferenceControllerTest.java
new file mode 100644
index 0000000..d6c8d99
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilityFooterPreferenceControllerTest.java
@@ -0,0 +1,124 @@
+/*
+ * 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.
+ */
+
+package com.android.settings.accessibility;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.TextView;
+
+import androidx.preference.PreferenceScreen;
+import androidx.preference.PreferenceViewHolder;
+import androidx.test.core.app.ApplicationProvider;
+
+import com.android.settings.R;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.Spy;
+import org.mockito.junit.MockitoJUnit;
+import org.mockito.junit.MockitoRule;
+import org.robolectric.RobolectricTestRunner;
+
+/**
+ * Tests for {@link AccessibilityFooterPreferenceController}.
+ */
+@RunWith(RobolectricTestRunner.class)
+public class AccessibilityFooterPreferenceControllerTest {
+
+ private static final String TEST_KEY = "test_pref_key";
+ private static final String TEST_TITLE = "test_title";
+ private static final String TEST_INTRODUCTION_TITLE = "test_introduction_title";
+ private static final String TEST_CONTENT_DESCRIPTION = "test_content_description";
+ private static final int TEST_HELP_ID = 12345;
+
+ @Rule
+ public final MockitoRule mockito = MockitoJUnit.rule();
+
+ @Spy
+ private final Context mContext = ApplicationProvider.getApplicationContext();
+ @Mock
+ private PreferenceScreen mScreen;
+ private AccessibilityFooterPreferenceController mController;
+ private AccessibilityFooterPreference mPreference;
+ private PreferenceViewHolder mPreferenceViewHolder;
+
+ @Before
+ public void setUp() {
+ mController = new AccessibilityFooterPreferenceController(mContext, TEST_KEY);
+ mPreference = new AccessibilityFooterPreference(mContext);
+ mPreference.setKey(TEST_KEY);
+ mPreference.setTitle(TEST_TITLE);
+
+ final LayoutInflater inflater = LayoutInflater.from(mContext);
+ final View view = inflater.inflate(R.layout.preference_footer, null);
+ mPreferenceViewHolder = PreferenceViewHolder.createInstanceForTests(view);
+ mPreference.onBindViewHolder(mPreferenceViewHolder);
+
+ when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn(mPreference);
+ }
+
+ @Test
+ public void setIntroductionTitle_setCorrectIntroductionTitle() {
+ mController.setIntroductionTitle(TEST_INTRODUCTION_TITLE);
+
+ assertThat(mController.getIntroductionTitle()).isEqualTo(TEST_INTRODUCTION_TITLE);
+ }
+
+ @Test
+ public void onBindViewHolder_setIntroductionTitle_setCorrectIntroductionTitle() {
+ mController.setIntroductionTitle(TEST_INTRODUCTION_TITLE);
+ mController.displayPreference(mScreen);
+
+ mPreference.onBindViewHolder(mPreferenceViewHolder);
+
+ final TextView summaryView = (TextView) mPreferenceViewHolder
+ .findViewById(android.R.id.title);
+ assertThat(summaryView.getContentDescription().toString())
+ .contains(TEST_INTRODUCTION_TITLE);
+ }
+
+ @Test
+ public void setupHelpLink_setCorrectHelpLinkAndContentDescription() {
+ mController.setupHelpLink(TEST_HELP_ID, TEST_CONTENT_DESCRIPTION);
+
+ assertThat(mController.getHelpResource()).isEqualTo(TEST_HELP_ID);
+ assertThat(mController.getLearnMoreContentDescription())
+ .isEqualTo(TEST_CONTENT_DESCRIPTION);
+ }
+
+ @Test
+ public void onBindViewHolder_setupHelpLink_setCorrectHelpLinkAndContentDescription() {
+ mController.setupHelpLink(TEST_HELP_ID, TEST_CONTENT_DESCRIPTION);
+ mController.displayPreference(mScreen);
+
+ mPreference.onBindViewHolder(mPreferenceViewHolder);
+
+ final TextView learnMoreView = (TextView) mPreferenceViewHolder
+ .findViewById(com.android.settingslib.R.id.settingslib_learn_more);
+ assertThat(learnMoreView.getContentDescription().toString())
+ .contains(TEST_CONTENT_DESCRIPTION);
+ assertThat(mPreference.isLinkEnabled()).isTrue();
+ }
+}
diff --git a/tests/robotests/src/com/android/settings/accessibility/FloatingMenuLayerDrawableTest.java b/tests/robotests/src/com/android/settings/accessibility/AccessibilityLayerDrawableTest.java
similarity index 83%
rename from tests/robotests/src/com/android/settings/accessibility/FloatingMenuLayerDrawableTest.java
rename to tests/robotests/src/com/android/settings/accessibility/AccessibilityLayerDrawableTest.java
index 45cefe4..915c788 100644
--- a/tests/robotests/src/com/android/settings/accessibility/FloatingMenuLayerDrawableTest.java
+++ b/tests/robotests/src/com/android/settings/accessibility/AccessibilityLayerDrawableTest.java
@@ -30,9 +30,9 @@
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
-/** Tests for {@link FloatingMenuLayerDrawable}. */
+/** Tests for {@link AccessibilityLayerDrawable}. */
@RunWith(RobolectricTestRunner.class)
-public class FloatingMenuLayerDrawableTest {
+public class AccessibilityLayerDrawableTest {
private static final int TEST_RES_ID =
com.android.internal.R.drawable.ic_accessibility_magnification;
@@ -46,8 +46,8 @@
R.drawable.accessibility_button_preview_base);
final Drawable expected2ndDrawable = mContext.getDrawable(TEST_RES_ID);
- final FloatingMenuLayerDrawable actualDrawable =
- FloatingMenuLayerDrawable.createLayerDrawable(mContext, TEST_RES_ID,
+ final AccessibilityLayerDrawable actualDrawable =
+ AccessibilityLayerDrawable.createLayerDrawable(mContext, TEST_RES_ID,
/* opacity= */ 27);
final Drawable actual1stDrawable = actualDrawable.getDrawable(0);
@@ -60,14 +60,14 @@
@Test
public void updateLayerDrawable_expectedFloatingMenuLayerDrawableState() {
- final FloatingMenuLayerDrawable originalDrawable =
- FloatingMenuLayerDrawable.createLayerDrawable(mContext, TEST_RES_ID, /* opacity= */
+ final AccessibilityLayerDrawable originalDrawable =
+ AccessibilityLayerDrawable.createLayerDrawable(mContext, TEST_RES_ID, /* opacity= */
72);
originalDrawable.updateLayerDrawable(mContext, TEST_RES_ID_2, /* opacity= */ 27);
assertThat(originalDrawable.getConstantState()).isEqualTo(
- new FloatingMenuLayerDrawable.FloatingMenuLayerDrawableState(mContext,
+ new AccessibilityLayerDrawable.AccessibilityLayerDrawableState(mContext,
TEST_RES_ID_2, /* opacity= */ 27));
}
}