Snap for 7510676 from a86c8be5fa to sc-release
Change-Id: Ic69bede413749310d0ee2a85eb066f56194de7a3
This commit is contained in:
91
res/drawable-night/ic_enhanced_connectivity.xml
Normal file
91
res/drawable-night/ic_enhanced_connectivity.xml
Normal file
@@ -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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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="M28.1,0L383.9,0A28.1,28.1 0,0 1,412 28.1L412,271.9A28.1,28.1 0,0 1,383.9 300L28.1,300A28.1,28.1 0,0 1,0 271.9L0,28.1A28.1,28.1 0,0 1,28.1 0z"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206,150m-108.79,0a108.79,108.79 0,1 1,217.58 0a108.79,108.79 0,1 1,-217.58 0"
|
||||||
|
android:strokeAlpha="0.2"
|
||||||
|
android:fillColor="#d2e3fc"
|
||||||
|
android:fillAlpha="0.2"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206,150m-93.27,0a93.27,93.27 0,1 1,186.54 0a93.27,93.27 0,1 1,-186.54 0"
|
||||||
|
android:strokeAlpha="0.2"
|
||||||
|
android:fillColor="#d2e3fc"
|
||||||
|
android:fillAlpha="0.2"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206,150m-77.85,0a77.85,77.85 0,1 1,155.7 0a77.85,77.85 0,1 1,-155.7 0"
|
||||||
|
android:strokeAlpha="0.2"
|
||||||
|
android:fillColor="#d2e3fc"
|
||||||
|
android:fillAlpha="0.2"/>
|
||||||
|
<path
|
||||||
|
android:fillColor="#FF000000"
|
||||||
|
android:pathData="M153.7,35.5H256.88A7.09,7.09 0,0 1,264 42.57V257.19a7.09,7.09 0,0 1,-7.12 7.06H153.7a7.09,7.09 0,0 1,-7.13 -7.06V42.57A7.1,7.1 0,0 1,153.7 35.5Z"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M267.85,102.26L267.85,93.58a2.17,2.17 0,0 0,-2.17 -2.17L265.68,45.83A10.87,10.87 0,0 0,254.83 35L155,35a10.87,10.87 0,0 0,-10.85 10.85L144.15,254.17A10.87,10.87 0,0 0,155 265h99.83a10.87,10.87 0,0 0,10.85 -10.85L265.68,147.83a2.17,2.17 0,0 0,2.17 -2.17L267.85,124a2.17,2.17 0,0 0,-2.17 -2.17L265.68,104.43A2.17,2.17 0,0 0,267.85 102.26ZM263.51,254.17a8.7,8.7 0,0 1,-8.68 8.68L155,262.85a8.7,8.7 0,0 1,-8.68 -8.68L146.32,45.83A8.7,8.7 0,0 1,155 37.15h99.83a8.7,8.7 0,0 1,8.68 8.68Z"
|
||||||
|
android:fillColor="#80868b"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M199.72,230.82h14a4.45,4.45 0,0 1,4.45 4.45h0a4.46,4.46 0,0 1,-4.45 4.46h-14a4.46,4.46 0,0 1,-4.45 -4.46h0a4.45,4.45 0,0 1,4.45 -4.45Z"
|
||||||
|
android:fillColor="#3c4043"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M211.83,228.91h0a6.36,6.36 0,0 1,6.36 6.36h0a6.36,6.36 0,0 1,-6.35 6.37h0a6.37,6.37 0,0 1,-6.37 -6.37h0a6.36,6.36 0,0 1,6.36 -6.36Z"
|
||||||
|
android:fillColor="#669df6"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206.59,179.58m-15.27,0a15.27,15.27 0,1 1,30.54 0a15.27,15.27 0,1 1,-30.54 0"
|
||||||
|
android:fillColor="#f1f3f4"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M191.32,179.58a15.27,15.24 0,1 0,30.54 0a15.27,15.24 0,1 0,-30.54 0z"
|
||||||
|
android:fillColor="#feefc3"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206.59,172.63l-5.72,4.29l0,8.59l3.57,0l0,-5.01l4.3,0l0,5.01l3.57,0l0,-8.59l-5.72,-4.29z"
|
||||||
|
android:fillColor="#fcc934"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M168.97,105.11m-15.24,0a15.24,15.24 0,1 1,30.48 0a15.24,15.24 0,1 1,-30.48 0"
|
||||||
|
android:fillColor="#fad2cf"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M172.6,111.39L172.6,100.28a0.92,0.92 0,0 0,-0.92 -0.92h-1.22L170.46,97.87h-2.9v1.42h-1.2a0.93,0.93 0,0 0,-0.93 0.92v11.07a0.93,0.93 0,0 0,0.93 0.92h5.31A0.92,0.92 0,0 0,172.6 111.39ZM171.15,100.77L171.15,106h-4.34v-5.2Z"
|
||||||
|
android:fillColor="#ee675c"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M243.03,151.92m-15.27,0a15.27,15.27 0,1 1,30.54 0a15.27,15.27 0,1 1,-30.54 0"
|
||||||
|
android:fillColor="#fad2cf"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M248.3,146.31a1.09,1.09 0,0 0,-1 -0.73h-8a1.1,1.1 0,0 0,-1 0.73l-1.5,4.34v5.8a0.71,0.71 0,0 0,0.71 0.73h0.79a0.72,0.72 0,0 0,0.72 -0.72h0v-0.72h8.68v0.72a0.73,0.73 0,0 0,0.73 0.73h0.72a0.73,0.73 0,0 0,0.73 -0.73v-5.79ZM240,153.54a1.09,1.09 0,1 1,1.09 -1.09h0a1.08,1.08 0,0 1,-1 1.12h0ZM246.52,153.54a1.09,1.09 0,1 1,1.08 -1.1v0a1.09,1.09 0,0 1,-1 1.12ZM238.75,149.28 L239.53,147.03L247,147.03l0.78,2.25Z"
|
||||||
|
android:fillColor="#ee675c"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M168.97,151.92m-15.27,0a15.27,15.27 0,1 1,30.54 0a15.27,15.27 0,1 1,-30.54 0"
|
||||||
|
android:fillColor="#d2e3fc"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M175.8,149.23a3.68,3.68 0,0 0,-3.69 -3.08h-5.63a3.73,3.73 0,0 0,-3.69 3.08s-1.17,6.76 -1.17,6.86a1.61,1.61 0,0 0,2.72 1.15l2.66,-2.63h4.61l2.66,2.63a1.61,1.61 0,0 0,2.73 -1.15C177,156 175.8,149.23 175.8,149.23ZM168.51,150.77L167,150.77v1.53h-0.77v-1.53h-1.53L164.7,150h1.53v-1.54L167,148.46L167,150h1.54ZM170.67,151a0.62,0.62 0,1 1,0.61 -0.63h0a0.62,0.62 0,0 1,-0.61 0.62ZM171.97,152.3a0.61,0.61 0,0 1,-0.63 -0.6,0.62 0.62,0 0,1 1.24,0h0a0.61,0.61 0,0 1,-0.61 0.61ZM171.97,149.69a0.62,0.62 0,1 1,0.61 -0.63h0a0.62,0.62 0,0 1,-0.61 0.62ZM173.28,151a0.62,0.62 0,1 1,0.62 -0.62h0a0.62,0.62 0,0 1,-0.62 0.62Z"
|
||||||
|
android:fillColor="#669df6"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M243.03,105.11m-15.24,0a15.24,15.24 0,1 1,30.48 0a15.24,15.24 0,1 1,-30.48 0"
|
||||||
|
android:fillColor="#d2e3fc"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M240,100.65a4.16,4.16 0,0 0,-0.1 5.88l0.1,0.1 0.76,-0.76a3.28,3.28 0,0 1,-0.92 -2.24,3 3,0 0,1 0.92,-2.22ZM247.51,99.12 L246.75,99.88a5.39,5.39 0,0 1,0 7.51l0.76,0.76a6.22,6.22 0,0 0,1.85 -4.52A6.52,6.52 0,0 0,247.54 99.12ZM239.22,99.88 L238.46,99.12a6.45,6.45 0,0 0,0 9l0.76,-0.76A5.39,5.39 0,0 1,239.25 99.88ZM245.96,100.65 L245.2,101.41a3.18,3.18 0,0 1,0.92 2.22,3 3,0 0,1 -0.92,2.24l0.76,0.76a4.24,4.24 0,0 0,1.28 -3,4.55 4.55,0 0,0 -1.26,-3ZM242.96,102.06a1.58,1.58 0,0 0,-1.6 1.56v0a1.63,1.63 0,0 0,0.92 1.47v5.53h1.28v-5.53a1.63,1.63 0,0 0,0.92 -1.47A1.58,1.58 0,0 0,243 102.06Z"
|
||||||
|
android:fillColor="#669df6"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206.59,77.45m-15.21,0a15.21,15.21 0,1 1,30.42 0a15.21,15.21 0,1 1,-30.42 0"
|
||||||
|
android:fillColor="#ceead6"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M211.66,72.38h-1.9L211,74.92h-1.9l-1.29,-2.54h-1.27l1.27,2.54L206,74.92l-1.26,-2.54h-1.32l1.27,2.54h-1.9l-1.27,-2.54a1.26,1.26 0,0 0,-1.26 1.26h0v7.61a1.25,1.25 0,0 0,1.26 1.26h10.14a1.26,1.26 0,0 0,1.27 -1.26L212.93,73.65a1.27,1.27 0,0 0,-1.27 -1.27ZM211.66,81.26L201.52,81.26L201.52,76.19h10.14Z"
|
||||||
|
android:fillColor="#5bb974"/>
|
||||||
|
</vector>
|
||||||
91
res/drawable/ic_enhanced_connectivity.xml
Normal file
91
res/drawable/ic_enhanced_connectivity.xml
Normal file
@@ -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.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<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="M28.1,0L383.9,0A28.1,28.1 0,0 1,412 28.1L412,271.9A28.1,28.1 0,0 1,383.9 300L28.1,300A28.1,28.1 0,0 1,0 271.9L0,28.1A28.1,28.1 0,0 1,28.1 0z"
|
||||||
|
android:fillColor="#fff"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206,150m-108.79,0a108.79,108.79 0,1 1,217.58 0a108.79,108.79 0,1 1,-217.58 0"
|
||||||
|
android:strokeAlpha="0.2"
|
||||||
|
android:fillColor="#669df6"
|
||||||
|
android:fillAlpha="0.2"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206,150m-93.27,0a93.27,93.27 0,1 1,186.54 0a93.27,93.27 0,1 1,-186.54 0"
|
||||||
|
android:strokeAlpha="0.2"
|
||||||
|
android:fillColor="#669df6"
|
||||||
|
android:fillAlpha="0.2"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206,150m-77.85,0a77.85,77.85 0,1 1,155.7 0a77.85,77.85 0,1 1,-155.7 0"
|
||||||
|
android:strokeAlpha="0.2"
|
||||||
|
android:fillColor="#669df6"
|
||||||
|
android:fillAlpha="0.2"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M153.7,35.5H256.88A7.09,7.09 0,0 1,264 42.57V257.19a7.09,7.09 0,0 1,-7.12 7.06H153.7a7.09,7.09 0,0 1,-7.13 -7.06V42.57A7.1,7.1 0,0 1,153.7 35.5Z"
|
||||||
|
android:fillColor="#fff"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M267.85,102.26L267.85,93.58a2.17,2.17 0,0 0,-2.17 -2.17L265.68,45.83A10.87,10.87 0,0 0,254.83 35L155,35a10.87,10.87 0,0 0,-10.85 10.85L144.15,254.17A10.87,10.87 0,0 0,155 265h99.83a10.87,10.87 0,0 0,10.85 -10.85L265.68,147.83a2.17,2.17 0,0 0,2.17 -2.17L267.85,124a2.17,2.17 0,0 0,-2.17 -2.17L265.68,104.43A2.17,2.17 0,0 0,267.85 102.26ZM263.51,254.17a8.7,8.7 0,0 1,-8.68 8.68L155,262.85a8.7,8.7 0,0 1,-8.68 -8.68L146.32,45.83A8.7,8.7 0,0 1,155 37.15h99.83a8.7,8.7 0,0 1,8.68 8.68Z"
|
||||||
|
android:fillColor="#dadce0"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M199.72,230.82h14a4.45,4.45 0,0 1,4.45 4.45h0a4.46,4.46 0,0 1,-4.45 4.46h-14a4.46,4.46 0,0 1,-4.45 -4.46h0a4.45,4.45 0,0 1,4.45 -4.45Z"
|
||||||
|
android:fillColor="#e8f0fe"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M211.83,228.91h0a6.36,6.36 0,0 1,6.36 6.36h0a6.36,6.36 0,0 1,-6.35 6.37h0a6.37,6.37 0,0 1,-6.37 -6.37h0a6.36,6.36 0,0 1,6.36 -6.36Z"
|
||||||
|
android:fillColor="#1a73e8"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206.59,179.58m-15.27,0a15.27,15.27 0,1 1,30.54 0a15.27,15.27 0,1 1,-30.54 0"
|
||||||
|
android:fillColor="#f1f3f4"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M191.32,179.58a15.27,15.24 0,1 0,30.54 0a15.27,15.24 0,1 0,-30.54 0z"
|
||||||
|
android:fillColor="#feefc3"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206.59,172.63l-5.72,4.29l0,8.59l3.57,0l0,-5.01l4.3,0l0,5.01l3.57,0l0,-8.59l-5.72,-4.29z"
|
||||||
|
android:fillColor="#f9ab00"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M168.97,105.11m-15.24,0a15.24,15.24 0,1 1,30.48 0a15.24,15.24 0,1 1,-30.48 0"
|
||||||
|
android:fillColor="#fad2cf"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M172.6,111.39L172.6,100.28a0.92,0.92 0,0 0,-0.92 -0.92h-1.22L170.46,97.87h-2.9v1.42h-1.2a0.93,0.93 0,0 0,-0.93 0.92v11.07a0.93,0.93 0,0 0,0.93 0.92h5.31A0.92,0.92 0,0 0,172.6 111.39ZM171.15,100.77L171.15,106h-4.34v-5.2Z"
|
||||||
|
android:fillColor="#d93025"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M243.03,151.92m-15.27,0a15.27,15.27 0,1 1,30.54 0a15.27,15.27 0,1 1,-30.54 0"
|
||||||
|
android:fillColor="#fad2cf"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M248.3,146.31a1.09,1.09 0,0 0,-1 -0.73h-8a1.1,1.1 0,0 0,-1 0.73l-1.5,4.34v5.8a0.71,0.71 0,0 0,0.71 0.73h0.79a0.72,0.72 0,0 0,0.72 -0.72h0v-0.72h8.68v0.72a0.73,0.73 0,0 0,0.73 0.73h0.72a0.73,0.73 0,0 0,0.73 -0.73v-5.79ZM240,153.54a1.09,1.09 0,1 1,1.09 -1.09h0a1.08,1.08 0,0 1,-1 1.12h0ZM246.52,153.54a1.09,1.09 0,1 1,1.08 -1.1v0a1.09,1.09 0,0 1,-1 1.12ZM238.75,149.28 L239.53,147.03L247,147.03l0.78,2.25Z"
|
||||||
|
android:fillColor="#d93025"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M168.97,151.92m-15.27,0a15.27,15.27 0,1 1,30.54 0a15.27,15.27 0,1 1,-30.54 0"
|
||||||
|
android:fillColor="#d2e3fc"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M175.8,149.23a3.68,3.68 0,0 0,-3.69 -3.08h-5.63a3.73,3.73 0,0 0,-3.69 3.08s-1.17,6.76 -1.17,6.86a1.61,1.61 0,0 0,2.72 1.15l2.66,-2.63h4.61l2.66,2.63a1.61,1.61 0,0 0,2.73 -1.15C177,156 175.8,149.23 175.8,149.23ZM168.51,150.77L167,150.77v1.53h-0.77v-1.53h-1.53L164.7,150h1.53v-1.54L167,148.46L167,150h1.54ZM170.67,151a0.62,0.62 0,1 1,0.61 -0.63h0a0.62,0.62 0,0 1,-0.61 0.62ZM171.97,152.3a0.61,0.61 0,0 1,-0.63 -0.6,0.62 0.62,0 0,1 1.24,0h0a0.61,0.61 0,0 1,-0.61 0.61ZM171.97,149.69a0.62,0.62 0,1 1,0.61 -0.63h0a0.62,0.62 0,0 1,-0.61 0.62ZM173.28,151a0.62,0.62 0,1 1,0.62 -0.62h0a0.62,0.62 0,0 1,-0.62 0.62Z"
|
||||||
|
android:fillColor="#1a73e8"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M243.03,105.11m-15.24,0a15.24,15.24 0,1 1,30.48 0a15.24,15.24 0,1 1,-30.48 0"
|
||||||
|
android:fillColor="#d2e3fc"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M240,100.65a4.16,4.16 0,0 0,-0.1 5.88l0.1,0.1 0.76,-0.76a3.28,3.28 0,0 1,-0.92 -2.24,3 3,0 0,1 0.92,-2.22ZM247.51,99.12 L246.75,99.88a5.39,5.39 0,0 1,0 7.51l0.76,0.76a6.22,6.22 0,0 0,1.85 -4.52A6.52,6.52 0,0 0,247.54 99.12ZM239.22,99.88 L238.46,99.12a6.45,6.45 0,0 0,0 9l0.76,-0.76A5.39,5.39 0,0 1,239.25 99.88ZM245.96,100.65 L245.2,101.41a3.18,3.18 0,0 1,0.92 2.22,3 3,0 0,1 -0.92,2.24l0.76,0.76a4.24,4.24 0,0 0,1.28 -3,4.55 4.55,0 0,0 -1.26,-3ZM242.96,102.06a1.58,1.58 0,0 0,-1.6 1.56v0a1.63,1.63 0,0 0,0.92 1.47v5.53h1.28v-5.53a1.63,1.63 0,0 0,0.92 -1.47A1.58,1.58 0,0 0,243 102.06Z"
|
||||||
|
android:fillColor="#1a73e8"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M206.59,77.45m-15.21,0a15.21,15.21 0,1 1,30.42 0a15.21,15.21 0,1 1,-30.42 0"
|
||||||
|
android:fillColor="#ceead6"/>
|
||||||
|
<path
|
||||||
|
android:pathData="M211.66,72.38h-1.9L211,74.92h-1.9l-1.29,-2.54h-1.27l1.27,2.54L206,74.92l-1.26,-2.54h-1.32l1.27,2.54h-1.9l-1.27,-2.54a1.26,1.26 0,0 0,-1.26 1.26h0v7.61a1.25,1.25 0,0 0,1.26 1.26h10.14a1.26,1.26 0,0 0,1.27 -1.26L212.93,73.65a1.27,1.27 0,0 0,-1.27 -1.27ZM211.66,81.26L201.52,81.26L201.52,76.19h10.14Z"
|
||||||
|
android:fillColor="#1e8e3e"/>
|
||||||
|
</vector>
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (C) 2019 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/autoclick_preview_height"
|
|
||||||
android:contentDescription="@null"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:src="@drawable/accessibility_dwell"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
android:paddingTop="24dp">
|
android:paddingTop="24dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/icon_fingerprint"
|
android:id="@+id/icon_device_locked"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
android:paddingTop="24dp">
|
android:paddingTop="24dp">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/icon_fingerprint"
|
android:id="@+id/icon_trash_can"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:contentDescription="@null"
|
android:contentDescription="@null"
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<FrameLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -24,40 +24,38 @@
|
|||||||
android:id="@+id/pinned_header"
|
android:id="@+id/pinned_header"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:elevation="2dp"/>
|
android:elevation="2dp"
|
||||||
|
settings:layout_constraintTop_toTopOf="parent"/>
|
||||||
|
|
||||||
<FrameLayout
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/list_container"
|
android:id="@+id/apps_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:visibility="gone">
|
android:clipToPadding="false"
|
||||||
|
android:scrollbars="none"
|
||||||
|
android:visibility="invisible"
|
||||||
|
settings:fastScrollEnabled="true"
|
||||||
|
settings:fastScrollHorizontalThumbDrawable="@drawable/thumb_drawable"
|
||||||
|
settings:fastScrollHorizontalTrackDrawable="@drawable/line_drawable"
|
||||||
|
settings:fastScrollVerticalThumbDrawable="@drawable/thumb_drawable"
|
||||||
|
settings:fastScrollVerticalTrackDrawable="@drawable/line_drawable"
|
||||||
|
settings:layout_constraintTop_toBottomOf="@id/pinned_header"/>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<TextView
|
||||||
android:id="@+id/apps_list"
|
android:id="@android:id/empty"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="0dp"
|
||||||
android:clipToPadding="false"
|
android:gravity="center"
|
||||||
android:scrollbars="none"
|
android:textAlignment="gravity"
|
||||||
settings:fastScrollEnabled="true"
|
android:text="@string/no_applications"
|
||||||
settings:fastScrollHorizontalThumbDrawable="@drawable/thumb_drawable"
|
android:textAppearance="?android:attr/textAppearanceLarge"
|
||||||
settings:fastScrollHorizontalTrackDrawable="@drawable/line_drawable"
|
android:visibility="invisible"
|
||||||
settings:fastScrollVerticalThumbDrawable="@drawable/thumb_drawable"
|
settings:layout_constraintTop_toBottomOf="@id/pinned_header"
|
||||||
settings:fastScrollVerticalTrackDrawable="@drawable/line_drawable"/>
|
settings:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
||||||
<TextView
|
<include layout="@layout/loading_container"
|
||||||
android:id="@android:id/empty"
|
settings:layout_constraintTop_toBottomOf="@id/pinned_header"
|
||||||
android:layout_width="match_parent"
|
settings:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:gravity="bottom|center_horizontal"
|
|
||||||
android:layout_gravity="center"
|
|
||||||
android:text="@string/no_applications"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
|
||||||
android:visibility="invisible"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
<include layout="@layout/loading_container"/>
|
|
||||||
|
|
||||||
</FrameLayout>
|
|
||||||
|
|
||||||
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
Copyright (C) 2019 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.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="@dimen/settingslib_illustration_height"
|
|
||||||
android:gravity="center"
|
|
||||||
android:padding="@dimen/settingslib_illustration_padding"
|
|
||||||
android:orientation="vertical"
|
|
||||||
android:importantForAccessibility="noHideDescendants">
|
|
||||||
|
|
||||||
<ImageView
|
|
||||||
android:id="@+id/animated_img"
|
|
||||||
android:maxWidth="@dimen/settingslib_illustration_width"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@drawable/protection_background"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:adjustViewBounds="true"/>
|
|
||||||
|
|
||||||
<com.airbnb.lottie.LottieAnimationView
|
|
||||||
android:id="@+id/lottie_view"
|
|
||||||
android:maxWidth="@dimen/settingslib_illustration_width"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:background="@drawable/protection_background"
|
|
||||||
android:scaleType="fitCenter"
|
|
||||||
android:adjustViewBounds="true"
|
|
||||||
android:clipToOutline="true"/>
|
|
||||||
</LinearLayout>
|
|
||||||
0
res/raw/lottie_swipe_for_notifications.json
Normal file
0
res/raw/lottie_swipe_for_notifications.json
Normal file
@@ -149,8 +149,6 @@
|
|||||||
<dimen name="wifi_assistant_height">182dp</dimen>
|
<dimen name="wifi_assistant_height">182dp</dimen>
|
||||||
<dimen name="wifi_assistant_image_top">32dp</dimen>
|
<dimen name="wifi_assistant_image_top">32dp</dimen>
|
||||||
<dimen name="wifi_assistant_image_start">24dp</dimen>
|
<dimen name="wifi_assistant_image_start">24dp</dimen>
|
||||||
<!-- appbar height is equal search bar height (48dp) plus search bar top and bottom margin -->
|
|
||||||
<dimen name="app_bar_height">80dp</dimen>
|
|
||||||
|
|
||||||
<!-- CryptKeeper top margin for password/pin screen -->
|
<!-- CryptKeeper top margin for password/pin screen -->
|
||||||
<dimen name="crypt_keeper_password_top_margin">88dip</dimen>
|
<dimen name="crypt_keeper_password_top_margin">88dip</dimen>
|
||||||
|
|||||||
@@ -926,16 +926,8 @@
|
|||||||
<string name="security_settings_fingerprint_enroll_introduction_cancel">Cancel</string>
|
<string name="security_settings_fingerprint_enroll_introduction_cancel">Cancel</string>
|
||||||
<!-- Button text to cancel enrollment [CHAR LIMIT=30] -->
|
<!-- Button text to cancel enrollment [CHAR LIMIT=30] -->
|
||||||
<string name="security_settings_fingerprint_enroll_introduction_no_thanks">No thanks</string>
|
<string name="security_settings_fingerprint_enroll_introduction_no_thanks">No thanks</string>
|
||||||
<!-- Button text to skip enrollment [CHAR LIMIT=30] -->
|
|
||||||
<string name="security_settings_fingerprint_enroll_introduction_skip">No thanks</string>
|
|
||||||
<!-- Button text to continue to the next screen from the introduction [CHAR LIMIT=22] -->
|
|
||||||
<string name="security_settings_fingerprint_enroll_introduction_continue">Continue</string>
|
|
||||||
<!-- Button text to agree the consent and continue to the next screen from the introduction [CHAR LIMIT=22] -->
|
<!-- Button text to agree the consent and continue to the next screen from the introduction [CHAR LIMIT=22] -->
|
||||||
<string name="security_settings_fingerprint_enroll_introduction_agree">I agree</string>
|
<string name="security_settings_fingerprint_enroll_introduction_agree">I agree</string>
|
||||||
<!-- Button text to cancel enrollment from the introduction (this string variant is used while in setup wizard) [CHAR LIMIT=22] -->
|
|
||||||
<string name="security_settings_fingerprint_enroll_introduction_cancel_setup">Skip</string>
|
|
||||||
<!-- Button text to continue to the next screen from the introduction (this string variant is used while in setup wizard) [CHAR LIMIT=22] -->
|
|
||||||
<string name="security_settings_fingerprint_enroll_introduction_continue_setup">Next</string>
|
|
||||||
<!-- Title of dialog shown when the user tries to skip setting up fingerprint after adding lock screen during initial setup. [CHAR LIMIT=30] -->
|
<!-- Title of dialog shown when the user tries to skip setting up fingerprint after adding lock screen during initial setup. [CHAR LIMIT=30] -->
|
||||||
<string name="setup_fingerprint_enroll_skip_title">Skip fingerprint?</string>
|
<string name="setup_fingerprint_enroll_skip_title">Skip fingerprint?</string>
|
||||||
<!-- Body text of dialog shown when the user tries to skip setting up fingerprint after adding lock screen during initial setup [CHAR LIMIT=NONE] -->
|
<!-- Body text of dialog shown when the user tries to skip setting up fingerprint after adding lock screen during initial setup [CHAR LIMIT=NONE] -->
|
||||||
@@ -12892,6 +12884,8 @@
|
|||||||
<string name="sim_action_reboot">Restart</string>
|
<string name="sim_action_reboot">Restart</string>
|
||||||
<!-- Button on a dialog to reject SIM operations. [CHAR LIMIT=30] -->
|
<!-- Button on a dialog to reject SIM operations. [CHAR LIMIT=30] -->
|
||||||
<string name="sim_action_no_thanks">No thanks</string>
|
<string name="sim_action_no_thanks">No thanks</string>
|
||||||
|
<!-- Button text to cancel operations proposed by a sim operation dialog [CHAR LIMIT=20] -->
|
||||||
|
<string name="sim_action_cancel">Cancel</string>
|
||||||
<!-- Button which will disconnect the user from one mobile network and immediately connect to another. [CHAR LIMIT=30] -->
|
<!-- Button which will disconnect the user from one mobile network and immediately connect to another. [CHAR LIMIT=30] -->
|
||||||
<string name="sim_switch_button">Switch</string>
|
<string name="sim_switch_button">Switch</string>
|
||||||
<!-- Title of DSDS activation failure dialog [CHAR LIMIT=40] -->
|
<!-- Title of DSDS activation failure dialog [CHAR LIMIT=40] -->
|
||||||
@@ -13389,7 +13383,7 @@
|
|||||||
<string name="mobile_data_no_connection">No connection</string>
|
<string name="mobile_data_no_connection">No connection</string>
|
||||||
<!-- Provider Model:
|
<!-- Provider Model:
|
||||||
Summary indicating that a SIM has no mobile data connection [CHAR LIMIT=50] -->
|
Summary indicating that a SIM has no mobile data connection [CHAR LIMIT=50] -->
|
||||||
<string name="mobile_data_off_summary">Internet won\u0027t auto\u2011connect</string>
|
<string name="mobile_data_off_summary">Mobile data won\u0027t auto\u2011connect</string>
|
||||||
<!-- Provider Model: Summary indicating that no other networks available [CHAR LIMIT=50] -->
|
<!-- Provider Model: Summary indicating that no other networks available [CHAR LIMIT=50] -->
|
||||||
<string name="non_carrier_network_unavailable">No other networks available</string>
|
<string name="non_carrier_network_unavailable">No other networks available</string>
|
||||||
<!-- Provider Model: Summary indicating that no networks available [CHAR LIMIT=50] -->
|
<!-- Provider Model: Summary indicating that no networks available [CHAR LIMIT=50] -->
|
||||||
|
|||||||
@@ -19,14 +19,13 @@
|
|||||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||||
android:title="@string/accessibility_autoclick_preference_title">
|
android:title="@string/accessibility_autoclick_preference_title">
|
||||||
|
|
||||||
<com.android.settingslib.widget.LayoutPreference
|
<com.android.settingslib.widget.IllustrationPreference
|
||||||
android:key="accessibility_autoclick_preview"
|
android:key="accessibility_autoclick_banner"
|
||||||
android:layout="@layout/accessibility_autoclick_preview"
|
|
||||||
android:persistent="false"
|
android:persistent="false"
|
||||||
android:selectable="false"
|
android:selectable="false"
|
||||||
android:title="@string/summary_placeholder"
|
|
||||||
settings:allowDividerBelow="true"
|
settings:allowDividerBelow="true"
|
||||||
settings:searchable="false" />
|
settings:searchable="false"
|
||||||
|
settings:lottie_rawRes="@drawable/accessibility_dwell" />
|
||||||
|
|
||||||
<com.android.settingslib.widget.RadioButtonPreference
|
<com.android.settingslib.widget.RadioButtonPreference
|
||||||
android:key="accessibility_control_autoclick_default"
|
android:key="accessibility_control_autoclick_default"
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
<com.android.settings.widget.GearPreference
|
<com.android.settings.widget.GearPreference
|
||||||
android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
|
android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
|
||||||
android:key="default_autofill_main"
|
android:key="default_autofill_main"
|
||||||
android:title="@string/autofill_app"
|
|
||||||
settings:keywords="@string/autofill_keywords">
|
settings:keywords="@string/autofill_keywords">
|
||||||
<extra
|
<extra
|
||||||
android:name="for_work"
|
android:name="for_work"
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
<com.android.settings.widget.GearPreference
|
<com.android.settings.widget.GearPreference
|
||||||
android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
|
android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
|
||||||
android:key="default_autofill_main"
|
android:key="default_autofill_main"
|
||||||
android:title="@string/autofill_app"
|
|
||||||
settings:keywords="@string/autofill_keywords">
|
settings:keywords="@string/autofill_keywords">
|
||||||
<extra
|
<extra
|
||||||
android:name="for_work"
|
android:name="for_work"
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
<com.android.settings.widget.GearPreference
|
<com.android.settings.widget.GearPreference
|
||||||
android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
|
android:fragment="com.android.settings.applications.defaultapps.DefaultAutofillPicker"
|
||||||
android:key="default_autofill_work"
|
android:key="default_autofill_work"
|
||||||
android:title="@string/autofill_app"
|
|
||||||
settings:searchable="false">
|
settings:searchable="false">
|
||||||
<extra
|
<extra
|
||||||
android:name="for_work"
|
android:name="for_work"
|
||||||
|
|||||||
@@ -19,20 +19,18 @@
|
|||||||
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
xmlns:settings="http://schemas.android.com/apk/res-auto"
|
||||||
android:title="@string/adaptive_connectivity_title">
|
android:title="@string/adaptive_connectivity_title">
|
||||||
|
|
||||||
<com.android.settingslib.widget.LayoutPreference
|
<com.android.settingslib.widget.TopIntroPreference
|
||||||
android:key="adaptive_connectivity_header"
|
settings:searchable="false"
|
||||||
android:layout="@layout/adaptive_connectivity_header"
|
android:title="@string/adaptive_connectivity_summary"/>
|
||||||
android:persistent="false"
|
|
||||||
android:selectable="false"
|
|
||||||
android:title="@string/summary_placeholder"
|
|
||||||
settings:allowDividerBelow="true"
|
|
||||||
settings:searchable="false"/>
|
|
||||||
|
|
||||||
<SwitchPreference
|
<com.android.settingslib.widget.IllustrationPreference
|
||||||
|
android:key="adaptive_connectivity_header"
|
||||||
|
settings:searchable="false"
|
||||||
|
settings:lottie_rawRes="@drawable/ic_enhanced_connectivity"/>
|
||||||
|
|
||||||
|
<com.android.settingslib.widget.MainSwitchPreference
|
||||||
android:key="adaptive_connectivity"
|
android:key="adaptive_connectivity"
|
||||||
android:title="@string/adaptive_connectivity_title"
|
android:title="@string/adaptive_connectivity_title"
|
||||||
android:summary="@string/adaptive_connectivity_summary"
|
|
||||||
settings:allowDividerAbove="true"
|
|
||||||
settings:controller="com.android.settings.network.AdaptiveConnectivityTogglePreferenceController"/>
|
settings:controller="com.android.settings.network.AdaptiveConnectivityTogglePreferenceController"/>
|
||||||
|
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|||||||
@@ -1,181 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (C) 2019 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.graphics.drawable.Animatable;
|
|
||||||
import android.graphics.drawable.Animatable2;
|
|
||||||
import android.graphics.drawable.AnimationDrawable;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
|
|
||||||
import androidx.preference.Preference;
|
|
||||||
import androidx.preference.PreferenceViewHolder;
|
|
||||||
|
|
||||||
import com.android.settings.R;
|
|
||||||
|
|
||||||
import com.airbnb.lottie.LottieAnimationView;
|
|
||||||
import com.airbnb.lottie.LottieDrawable;
|
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.util.Objects;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A custom {@link ImageView} preference for showing animated or static image, such as <a
|
|
||||||
* href="https://developers.google.com/speed/webp/">animated webp</a> and static png.
|
|
||||||
*/
|
|
||||||
public class AnimatedImagePreference extends Preference {
|
|
||||||
|
|
||||||
private static final String TAG = "AnimatedImagePreference";
|
|
||||||
private Uri mImageUri;
|
|
||||||
private int mMaxHeight = -1;
|
|
||||||
|
|
||||||
private final Animatable2.AnimationCallback mAnimationCallback =
|
|
||||||
new Animatable2.AnimationCallback() {
|
|
||||||
@Override
|
|
||||||
public void onAnimationEnd(Drawable drawable) {
|
|
||||||
((Animatable2) drawable).start();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
AnimatedImagePreference(Context context) {
|
|
||||||
super(context);
|
|
||||||
setLayoutResource(R.layout.preference_animated_image);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
|
||||||
super.onBindViewHolder(holder);
|
|
||||||
|
|
||||||
final ImageView imageView = holder.itemView.findViewById(R.id.animated_img);
|
|
||||||
final LottieAnimationView lottieView = holder.itemView.findViewById(R.id.lottie_view);
|
|
||||||
if (imageView == null || lottieView == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mImageUri != null) {
|
|
||||||
resetAnimations(imageView, lottieView);
|
|
||||||
hideAllChildViews(holder.itemView);
|
|
||||||
|
|
||||||
imageView.setImageURI(mImageUri);
|
|
||||||
if (imageView.getDrawable() != null) {
|
|
||||||
startAnimationWith(imageView);
|
|
||||||
} else {
|
|
||||||
// The lottie image from the raw folder also returns null.
|
|
||||||
startLottieAnimationWith(lottieView);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mMaxHeight > -1) {
|
|
||||||
imageView.setMaxHeight(mMaxHeight);
|
|
||||||
lottieView.setMaxHeight(mMaxHeight);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets image uri to display image in {@link ImageView}
|
|
||||||
*
|
|
||||||
* @param imageUri the Uri of an image
|
|
||||||
*/
|
|
||||||
public void setImageUri(Uri imageUri) {
|
|
||||||
if (imageUri != null && !imageUri.equals(mImageUri)) {
|
|
||||||
mImageUri = imageUri;
|
|
||||||
notifyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the maximum height of the view.
|
|
||||||
*
|
|
||||||
* @param maxHeight the maximum height of ImageView in terms of pixels.
|
|
||||||
*/
|
|
||||||
public void setMaxHeight(int maxHeight) {
|
|
||||||
if (maxHeight != mMaxHeight) {
|
|
||||||
mMaxHeight = maxHeight;
|
|
||||||
notifyChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startAnimationWith(ImageView imageView) {
|
|
||||||
startAnimation(imageView.getDrawable());
|
|
||||||
|
|
||||||
imageView.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startLottieAnimationWith(LottieAnimationView lottieView) {
|
|
||||||
final InputStream inputStream = getInputStreamFromUri(mImageUri);
|
|
||||||
Objects.requireNonNull(inputStream, "Invalid resource.");
|
|
||||||
lottieView.setAnimation(inputStream, /* cacheKey= */ null);
|
|
||||||
lottieView.setRepeatCount(LottieDrawable.INFINITE);
|
|
||||||
lottieView.playAnimation();
|
|
||||||
|
|
||||||
lottieView.setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startAnimation(Drawable drawable) {
|
|
||||||
if (!(drawable instanceof Animatable)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (drawable instanceof Animatable2) {
|
|
||||||
((Animatable2) drawable).registerAnimationCallback(mAnimationCallback);
|
|
||||||
} else if (drawable instanceof AnimationDrawable) {
|
|
||||||
((AnimationDrawable) drawable).setOneShot(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
((Animatable) drawable).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resetAnimations(ImageView imageView, LottieAnimationView lottieView) {
|
|
||||||
resetAnimation(imageView.getDrawable());
|
|
||||||
|
|
||||||
lottieView.cancelAnimation();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void resetAnimation(Drawable drawable) {
|
|
||||||
if (!(drawable instanceof Animatable)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (drawable instanceof Animatable2) {
|
|
||||||
((Animatable2) drawable).clearAnimationCallbacks();
|
|
||||||
}
|
|
||||||
|
|
||||||
((Animatable) drawable).stop();
|
|
||||||
}
|
|
||||||
|
|
||||||
private InputStream getInputStreamFromUri(Uri uri) {
|
|
||||||
try {
|
|
||||||
return getContext().getContentResolver().openInputStream(uri);
|
|
||||||
} catch (FileNotFoundException e) {
|
|
||||||
Log.w(TAG, "Cannot find content uri: " + uri, e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void hideAllChildViews(View itemView) {
|
|
||||||
final ViewGroup viewGroup = (ViewGroup) itemView;
|
|
||||||
for (int i = 0; i < viewGroup.getChildCount(); i++) {
|
|
||||||
viewGroup.getChildAt(i).setVisibility(View.GONE);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -59,6 +59,7 @@ import com.android.settings.widget.SettingsMainSwitchBar;
|
|||||||
import com.android.settings.widget.SettingsMainSwitchPreference;
|
import com.android.settings.widget.SettingsMainSwitchPreference;
|
||||||
import com.android.settingslib.HelpUtils;
|
import com.android.settingslib.HelpUtils;
|
||||||
import com.android.settingslib.accessibility.AccessibilityUtils;
|
import com.android.settingslib.accessibility.AccessibilityUtils;
|
||||||
|
import com.android.settingslib.widget.IllustrationPreference;
|
||||||
import com.android.settingslib.widget.OnMainSwitchChangeListener;
|
import com.android.settingslib.widget.OnMainSwitchChangeListener;
|
||||||
|
|
||||||
import com.google.android.setupcompat.util.WizardManagerHelper;
|
import com.google.android.setupcompat.util.WizardManagerHelper;
|
||||||
@@ -398,15 +399,13 @@ public abstract class ToggleFeaturePreferenceFragment extends SettingsPreference
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final int screenHalfHeight = AccessibilityUtil.getScreenHeightPixels(getPrefContext()) / 2;
|
final IllustrationPreference illustrationPreference =
|
||||||
final AnimatedImagePreference animatedImagePreference =
|
new IllustrationPreference(getPrefContext());
|
||||||
new AnimatedImagePreference(getPrefContext());
|
illustrationPreference.setImageUri(mImageUri);
|
||||||
animatedImagePreference.setImageUri(mImageUri);
|
illustrationPreference.setSelectable(false);
|
||||||
animatedImagePreference.setSelectable(false);
|
illustrationPreference.setKey(KEY_ANIMATED_IMAGE);
|
||||||
animatedImagePreference.setMaxHeight(screenHalfHeight);
|
|
||||||
animatedImagePreference.setKey(KEY_ANIMATED_IMAGE);
|
|
||||||
|
|
||||||
getPreferenceScreen().addPreference(animatedImagePreference);
|
getPreferenceScreen().addPreference(illustrationPreference);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initToggleServiceSwitchPreference() {
|
private void initToggleServiceSwitchPreference() {
|
||||||
|
|||||||
@@ -72,7 +72,11 @@ public class RunningServices extends SettingsPreferenceFragment {
|
|||||||
public void onResume() {
|
public void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
boolean haveData = mRunningProcessesView.doResume(this, mRunningProcessesAvail);
|
boolean haveData = mRunningProcessesView.doResume(this, mRunningProcessesAvail);
|
||||||
mLoadingViewController.handleLoadingContainer(haveData /* done */, false /* animate */);
|
if (haveData) {
|
||||||
|
mLoadingViewController.showContent(false /* animate */);
|
||||||
|
} else {
|
||||||
|
mLoadingViewController.showLoadingView();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -65,11 +65,19 @@ public abstract class DefaultAppPreferenceController extends AbstractPreferenceC
|
|||||||
((TwoTargetPreference) preference).setIconSize(ICON_SIZE_MEDIUM);
|
((TwoTargetPreference) preference).setIconSize(ICON_SIZE_MEDIUM);
|
||||||
}
|
}
|
||||||
if (!TextUtils.isEmpty(defaultAppLabel)) {
|
if (!TextUtils.isEmpty(defaultAppLabel)) {
|
||||||
preference.setSummary(defaultAppLabel);
|
if (showLabelAsTitle()) {
|
||||||
|
preference.setTitle(defaultAppLabel);
|
||||||
|
} else {
|
||||||
|
preference.setSummary(defaultAppLabel);
|
||||||
|
}
|
||||||
preference.setIcon(Utils.getSafeIcon(getDefaultAppIcon()));
|
preference.setIcon(Utils.getSafeIcon(getDefaultAppIcon()));
|
||||||
} else {
|
} else {
|
||||||
Log.d(TAG, "No default app");
|
Log.d(TAG, "No default app");
|
||||||
preference.setSummary(R.string.app_list_preference_none);
|
if (showLabelAsTitle()) {
|
||||||
|
preference.setTitle(R.string.app_list_preference_none);
|
||||||
|
} else {
|
||||||
|
preference.setSummary(R.string.app_list_preference_none);
|
||||||
|
}
|
||||||
preference.setIcon(null);
|
preference.setIcon(null);
|
||||||
}
|
}
|
||||||
mayUpdateGearIcon(app, preference);
|
mayUpdateGearIcon(app, preference);
|
||||||
@@ -102,6 +110,13 @@ public abstract class DefaultAppPreferenceController extends AbstractPreferenceC
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether to show the default app label as the title, instead of as the summary.
|
||||||
|
*/
|
||||||
|
protected boolean showLabelAsTitle() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public Drawable getDefaultAppIcon() {
|
public Drawable getDefaultAppIcon() {
|
||||||
if (!isAvailable()) {
|
if (!isAvailable()) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -69,4 +69,9 @@ public class DefaultAutofillPreferenceController extends DefaultAppPreferenceCon
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean showLabelAsTitle() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -208,7 +208,6 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
private ApplicationsAdapter mApplications;
|
private ApplicationsAdapter mApplications;
|
||||||
|
|
||||||
private View mLoadingContainer;
|
private View mLoadingContainer;
|
||||||
private View mListContainer;
|
|
||||||
private SearchView mSearchView;
|
private SearchView mSearchView;
|
||||||
|
|
||||||
// Size resource used for packages whose size computation failed for some reason
|
// Size resource used for packages whose size computation failed for some reason
|
||||||
@@ -402,25 +401,21 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
|
|
||||||
mRootView = inflater.inflate(R.layout.manage_applications_apps, null);
|
mRootView = inflater.inflate(R.layout.manage_applications_apps, null);
|
||||||
mLoadingContainer = mRootView.findViewById(R.id.loading_container);
|
mLoadingContainer = mRootView.findViewById(R.id.loading_container);
|
||||||
mListContainer = mRootView.findViewById(R.id.list_container);
|
mEmptyView = mRootView.findViewById(android.R.id.empty);
|
||||||
if (mListContainer != null) {
|
mRecyclerView = mRootView.findViewById(R.id.apps_list);
|
||||||
// Create adapter and list view here
|
|
||||||
mEmptyView = mListContainer.findViewById(android.R.id.empty);
|
|
||||||
|
|
||||||
mApplications = new ApplicationsAdapter(mApplicationsState, this, mFilter,
|
mApplications = new ApplicationsAdapter(mApplicationsState, this, mFilter,
|
||||||
savedInstanceState);
|
savedInstanceState);
|
||||||
if (savedInstanceState != null) {
|
if (savedInstanceState != null) {
|
||||||
mApplications.mHasReceivedLoadEntries =
|
mApplications.mHasReceivedLoadEntries =
|
||||||
savedInstanceState.getBoolean(EXTRA_HAS_ENTRIES, false);
|
savedInstanceState.getBoolean(EXTRA_HAS_ENTRIES, false);
|
||||||
mApplications.mHasReceivedBridgeCallback =
|
mApplications.mHasReceivedBridgeCallback =
|
||||||
savedInstanceState.getBoolean(EXTRA_HAS_BRIDGE, false);
|
savedInstanceState.getBoolean(EXTRA_HAS_BRIDGE, false);
|
||||||
}
|
|
||||||
mRecyclerView = mListContainer.findViewById(R.id.apps_list);
|
|
||||||
mRecyclerView.setItemAnimator(null);
|
|
||||||
mRecyclerView.setLayoutManager(new LinearLayoutManager(
|
|
||||||
getContext(), RecyclerView.VERTICAL, false /* reverseLayout */));
|
|
||||||
mRecyclerView.setAdapter(mApplications);
|
|
||||||
}
|
}
|
||||||
|
mRecyclerView.setItemAnimator(null);
|
||||||
|
mRecyclerView.setLayoutManager(new LinearLayoutManager(
|
||||||
|
getContext(), RecyclerView.VERTICAL, false /* reverseLayout */));
|
||||||
|
mRecyclerView.setAdapter(mApplications);
|
||||||
|
|
||||||
// We have to do this now because PreferenceFrameLayout looks at it
|
// We have to do this now because PreferenceFrameLayout looks at it
|
||||||
// only when the view is added.
|
// only when the view is added.
|
||||||
@@ -985,16 +980,8 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
// overlapped by floating filter.
|
// overlapped by floating filter.
|
||||||
if (hasFilter) {
|
if (hasFilter) {
|
||||||
mManageApplications.mSpinnerHeader.setVisibility(View.VISIBLE);
|
mManageApplications.mSpinnerHeader.setVisibility(View.VISIBLE);
|
||||||
mManageApplications.mRecyclerView.setPadding(0 /* left */,
|
|
||||||
mContext.getResources().getDimensionPixelSize(
|
|
||||||
R.dimen.app_bar_height) /* top */,
|
|
||||||
0 /* right */,
|
|
||||||
0 /* bottom */);
|
|
||||||
} else {
|
} else {
|
||||||
mManageApplications.mSpinnerHeader.setVisibility(View.GONE);
|
mManageApplications.mSpinnerHeader.setVisibility(View.GONE);
|
||||||
mManageApplications.mRecyclerView.setPadding(0 /* left */, 0 /* top */,
|
|
||||||
0 /* right */,
|
|
||||||
0 /* bottom */);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1044,7 +1031,8 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
mManageApplications = manageApplications;
|
mManageApplications = manageApplications;
|
||||||
mLoadingViewController = new LoadingViewController(
|
mLoadingViewController = new LoadingViewController(
|
||||||
mManageApplications.mLoadingContainer,
|
mManageApplications.mLoadingContainer,
|
||||||
mManageApplications.mListContainer
|
mManageApplications.mRecyclerView,
|
||||||
|
mManageApplications.mEmptyView
|
||||||
);
|
);
|
||||||
mContext = manageApplications.getActivity();
|
mContext = manageApplications.getActivity();
|
||||||
mIconDrawableFactory = IconDrawableFactory.newInstance(mContext);
|
mIconDrawableFactory = IconDrawableFactory.newInstance(mContext);
|
||||||
@@ -1303,11 +1291,9 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
mOriginalEntries = entries;
|
mOriginalEntries = entries;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
if (getItemCount() == 0) {
|
if (getItemCount() == 0) {
|
||||||
mManageApplications.mRecyclerView.setVisibility(View.GONE);
|
mLoadingViewController.showEmpty(false /* animate */);
|
||||||
mManageApplications.mEmptyView.setVisibility(View.VISIBLE);
|
|
||||||
} else {
|
} else {
|
||||||
mManageApplications.mEmptyView.setVisibility(View.GONE);
|
mLoadingViewController.showContent(false /* animate */);
|
||||||
mManageApplications.mRecyclerView.setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
if (mManageApplications.mSearchView != null
|
if (mManageApplications.mSearchView != null
|
||||||
&& mManageApplications.mSearchView.isVisibleToUser()) {
|
&& mManageApplications.mSearchView.isVisibleToUser()) {
|
||||||
@@ -1324,10 +1310,6 @@ public class ManageApplications extends InstrumentedFragment
|
|||||||
mLastIndex = -1;
|
mLastIndex = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mSession.getAllApps().size() != 0
|
|
||||||
&& mManageApplications.mListContainer.getVisibility() != View.VISIBLE) {
|
|
||||||
mLoadingViewController.showContent(true /* animate */);
|
|
||||||
}
|
|
||||||
if (mManageApplications.mListType == LIST_TYPE_USAGE_ACCESS) {
|
if (mManageApplications.mListType == LIST_TYPE_USAGE_ACCESS) {
|
||||||
// No enabled or disabled filters for usage access.
|
// No enabled or disabled filters for usage access.
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -64,9 +64,13 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
final ImageView iconFingerprint = findViewById(R.id.icon_fingerprint);
|
final ImageView iconFingerprint = findViewById(R.id.icon_fingerprint);
|
||||||
|
final ImageView iconDeviceLocked = findViewById(R.id.icon_device_locked);
|
||||||
|
final ImageView iconTrashCan = findViewById(R.id.icon_trash_can);
|
||||||
final ImageView iconInfo = findViewById(R.id.icon_info);
|
final ImageView iconInfo = findViewById(R.id.icon_info);
|
||||||
final ImageView iconLink = findViewById(R.id.icon_link);
|
final ImageView iconLink = findViewById(R.id.icon_link);
|
||||||
iconFingerprint.getDrawable().setColorFilter(getIconColorFilter());
|
iconFingerprint.getDrawable().setColorFilter(getIconColorFilter());
|
||||||
|
iconDeviceLocked.getDrawable().setColorFilter(getIconColorFilter());
|
||||||
|
iconTrashCan.getDrawable().setColorFilter(getIconColorFilter());
|
||||||
iconInfo.getDrawable().setColorFilter(getIconColorFilter());
|
iconInfo.getDrawable().setColorFilter(getIconColorFilter());
|
||||||
iconLink.getDrawable().setColorFilter(getIconColorFilter());
|
iconLink.getDrawable().setColorFilter(getIconColorFilter());
|
||||||
|
|
||||||
@@ -87,7 +91,7 @@ public class FingerprintEnrollIntroduction extends BiometricEnrollIntroduction {
|
|||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
int getNegativeButtonTextId() {
|
int getNegativeButtonTextId() {
|
||||||
return R.string.security_settings_fingerprint_enroll_introduction_skip;
|
return R.string.security_settings_fingerprint_enroll_introduction_no_thanks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@StringRes
|
@StringRes
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import android.os.UserHandle;
|
|||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
|
||||||
import com.android.internal.widget.LockPatternUtils;
|
import com.android.internal.widget.LockPatternUtils;
|
||||||
import com.android.settings.R;
|
|
||||||
import com.android.settings.SetupWizardUtils;
|
import com.android.settings.SetupWizardUtils;
|
||||||
import com.android.settings.Utils;
|
import com.android.settings.Utils;
|
||||||
import com.android.settings.biometrics.BiometricUtils;
|
import com.android.settings.biometrics.BiometricUtils;
|
||||||
@@ -34,8 +33,6 @@ import com.android.settings.password.ChooseLockSettingsHelper;
|
|||||||
import com.android.settings.password.SetupChooseLockGeneric;
|
import com.android.settings.password.SetupChooseLockGeneric;
|
||||||
import com.android.settings.password.SetupSkipDialog;
|
import com.android.settings.password.SetupSkipDialog;
|
||||||
|
|
||||||
import com.google.android.setupcompat.template.FooterButton;
|
|
||||||
|
|
||||||
public class SetupFingerprintEnrollIntroduction extends FingerprintEnrollIntroduction {
|
public class SetupFingerprintEnrollIntroduction extends FingerprintEnrollIntroduction {
|
||||||
/**
|
/**
|
||||||
* Returns the number of fingerprint enrolled.
|
* Returns the number of fingerprint enrolled.
|
||||||
@@ -56,11 +53,6 @@ public class SetupFingerprintEnrollIntroduction extends FingerprintEnrollIntrodu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
int getNegativeButtonTextId() {
|
|
||||||
return R.string.security_settings_face_enroll_introduction_cancel;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
@@ -78,19 +70,6 @@ public class SetupFingerprintEnrollIntroduction extends FingerprintEnrollIntrodu
|
|||||||
return intent;
|
return intent;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void initViews() {
|
|
||||||
super.initViews();
|
|
||||||
|
|
||||||
FooterButton nextButton = getNextButton();
|
|
||||||
nextButton.setText(
|
|
||||||
this, R.string.security_settings_fingerprint_enroll_introduction_continue_setup);
|
|
||||||
|
|
||||||
final FooterButton cancelButton = getCancelButton();
|
|
||||||
cancelButton.setText(
|
|
||||||
this, R.string.security_settings_fingerprint_enroll_introduction_cancel_setup);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
// if lock was already present, do not return intent data since it must have been
|
// if lock was already present, do not return intent data since it must have been
|
||||||
|
|||||||
@@ -16,19 +16,18 @@
|
|||||||
|
|
||||||
package com.android.settings.gestures;
|
package com.android.settings.gestures;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.app.settings.SettingsEnums;
|
import android.app.settings.SettingsEnums;
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.UserHandle;
|
import android.os.UserHandle;
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
|
|
||||||
import com.android.internal.accessibility.AccessibilityShortcutController;
|
import com.android.internal.accessibility.AccessibilityShortcutController;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
import com.android.settings.accessibility.AccessibilityShortcutPreferenceFragment;
|
import com.android.settings.accessibility.AccessibilityShortcutPreferenceFragment;
|
||||||
import com.android.settings.search.BaseSearchIndexProvider;
|
import com.android.settings.search.BaseSearchIndexProvider;
|
||||||
|
import com.android.settingslib.widget.IllustrationPreference;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fragment for One-handed mode settings
|
* Fragment for One-handed mode settings
|
||||||
@@ -37,13 +36,27 @@ import com.android.settings.search.BaseSearchIndexProvider;
|
|||||||
* providing basic accessibility shortcut service setup.
|
* providing basic accessibility shortcut service setup.
|
||||||
*/
|
*/
|
||||||
public class OneHandedSettings extends AccessibilityShortcutPreferenceFragment {
|
public class OneHandedSettings extends AccessibilityShortcutPreferenceFragment {
|
||||||
|
|
||||||
private static final String ONE_HANDED_SHORTCUT_KEY = "one_handed_shortcuts_preference";
|
private static final String ONE_HANDED_SHORTCUT_KEY = "one_handed_shortcuts_preference";
|
||||||
|
private static final String ONE_HANDED_ILLUSTRATION_KEY = "one_handed_header";
|
||||||
private String mFeatureName;
|
private String mFeatureName;
|
||||||
|
private OneHandedSettingsUtils mUtils;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void updatePreferenceStates() {
|
protected void updatePreferenceStates() {
|
||||||
OneHandedSettingsUtils.setUserId(UserHandle.myUserId());
|
OneHandedSettingsUtils.setUserId(UserHandle.myUserId());
|
||||||
super.updatePreferenceStates();
|
super.updatePreferenceStates();
|
||||||
|
|
||||||
|
final IllustrationPreference preference =
|
||||||
|
(IllustrationPreference) getPreferenceScreen().findPreference(
|
||||||
|
ONE_HANDED_ILLUSTRATION_KEY);
|
||||||
|
if (preference != null) {
|
||||||
|
final boolean isSwipeDownNotification =
|
||||||
|
OneHandedSettingsUtils.isSwipeDownNotificationEnabled(getContext());
|
||||||
|
preference.setLottieAnimationResId(
|
||||||
|
isSwipeDownNotification ? R.raw.lottie_swipe_for_notifications
|
||||||
|
: R.raw.lottie_one_hand_mode);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -69,9 +82,21 @@ public class OneHandedSettings extends AccessibilityShortcutPreferenceFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
public void onStart() {
|
||||||
Bundle savedInstanceState) {
|
super.onStart();
|
||||||
return super.onCreateView(inflater, container, savedInstanceState);
|
mUtils = new OneHandedSettingsUtils(this.getContext());
|
||||||
|
mUtils.registerToggleAwareObserver(uri -> {
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity != null) {
|
||||||
|
activity.runOnUiThread(() -> updatePreferenceStates());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStop() {
|
||||||
|
super.onStop();
|
||||||
|
mUtils.unregisterToggleAwareObserver();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -22,12 +22,14 @@ import android.provider.Settings;
|
|||||||
|
|
||||||
import androidx.preference.PreferenceScreen;
|
import androidx.preference.PreferenceScreen;
|
||||||
|
|
||||||
import com.android.settings.core.TogglePreferenceController;
|
import com.android.settings.widget.SettingsMainSwitchPreferenceController;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link TogglePreferenceController} that controls whether Adaptive connectivity option is enabled.
|
* {@link SettingsMainSwitchPreferenceController}
|
||||||
|
* that controls whether Adaptive connectivity option is enabled.
|
||||||
*/
|
*/
|
||||||
public class AdaptiveConnectivityTogglePreferenceController extends TogglePreferenceController {
|
public class AdaptiveConnectivityTogglePreferenceController extends
|
||||||
|
SettingsMainSwitchPreferenceController {
|
||||||
|
|
||||||
private final WifiManager mWifiManager;
|
private final WifiManager mWifiManager;
|
||||||
|
|
||||||
|
|||||||
@@ -338,7 +338,7 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
|
|||||||
getString(R.string.sim_action_restart_title),
|
getString(R.string.sim_action_restart_title),
|
||||||
getString(R.string.sim_action_enable_dsds_text),
|
getString(R.string.sim_action_enable_dsds_text),
|
||||||
getString(R.string.sim_action_reboot),
|
getString(R.string.sim_action_reboot),
|
||||||
getString(R.string.cancel));
|
getString(R.string.sim_action_cancel));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Displays the SIM toggling confirmation dialog. */
|
/* Displays the SIM toggling confirmation dialog. */
|
||||||
@@ -359,7 +359,7 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
|
|||||||
title,
|
title,
|
||||||
null,
|
null,
|
||||||
getString(R.string.yes),
|
getString(R.string.yes),
|
||||||
getString(R.string.cancel));
|
getString(R.string.sim_action_cancel));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showEnableSimConfirmDialog() {
|
private void showEnableSimConfirmDialog() {
|
||||||
@@ -384,7 +384,7 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
|
|||||||
getSwitchSubscriptionTitle(),
|
getSwitchSubscriptionTitle(),
|
||||||
getSwitchDialogBodyMsg(activeSub, isBetweenEsim),
|
getSwitchDialogBodyMsg(activeSub, isBetweenEsim),
|
||||||
getSwitchDialogPosBtnText(),
|
getSwitchDialogPosBtnText(),
|
||||||
getString(android.R.string.cancel));
|
getString(R.string.sim_action_cancel));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showNonSwitchSimConfirmDialog() {
|
private void showNonSwitchSimConfirmDialog() {
|
||||||
@@ -395,7 +395,7 @@ public class ToggleSubscriptionDialogActivity extends SubscriptionActionDialogAc
|
|||||||
getEnableSubscriptionTitle(),
|
getEnableSubscriptionTitle(),
|
||||||
null /* msg */,
|
null /* msg */,
|
||||||
getString(R.string.yes),
|
getString(R.string.yes),
|
||||||
getString(android.R.string.cancel));
|
getString(R.string.sim_action_cancel));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getSwitchDialogPosBtnText() {
|
private String getSwitchDialogPosBtnText() {
|
||||||
|
|||||||
@@ -65,9 +65,6 @@ public class NotificationSbnViewHolder extends RecyclerView.ViewHolder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setTitle(CharSequence title) {
|
void setTitle(CharSequence title) {
|
||||||
if (title == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
mTitle.setText(title);
|
mTitle.setText(title);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,34 +22,66 @@ import android.view.View;
|
|||||||
import android.view.animation.Animation;
|
import android.view.animation.Animation;
|
||||||
import android.view.animation.AnimationUtils;
|
import android.view.animation.AnimationUtils;
|
||||||
|
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A helper class that manages show/hide loading spinner.
|
* A helper class that manages show/hide loading spinner, content view and empty view (optional).
|
||||||
*/
|
*/
|
||||||
public class LoadingViewController {
|
public class LoadingViewController {
|
||||||
|
|
||||||
private static final long DELAY_SHOW_LOADING_CONTAINER_THRESHOLD_MS = 100L;
|
private static final long DELAY_SHOW_LOADING_CONTAINER_THRESHOLD_MS = 100L;
|
||||||
|
|
||||||
public final Handler mFgHandler;
|
private final Handler mFgHandler;
|
||||||
public final View mLoadingView;
|
private final View mLoadingView;
|
||||||
public final View mContentView;
|
private final View mContentView;
|
||||||
|
private final View mEmptyView;
|
||||||
|
|
||||||
public LoadingViewController(View loadingView, View contentView) {
|
public LoadingViewController(View loadingView, View contentView) {
|
||||||
|
this(loadingView, contentView, null /* emptyView*/);
|
||||||
|
}
|
||||||
|
|
||||||
|
public LoadingViewController(View loadingView, View contentView, @Nullable View emptyView) {
|
||||||
mLoadingView = loadingView;
|
mLoadingView = loadingView;
|
||||||
mContentView = contentView;
|
mContentView = contentView;
|
||||||
|
mEmptyView = emptyView;
|
||||||
mFgHandler = new Handler(Looper.getMainLooper());
|
mFgHandler = new Handler(Looper.getMainLooper());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Runnable mShowLoadingContainerRunnable = new Runnable() {
|
private Runnable mShowLoadingContainerRunnable = new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
handleLoadingContainer(false /* done */, false /* animate */);
|
showLoadingView();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows content view and hides loading view & empty view.
|
||||||
|
*/
|
||||||
public void showContent(boolean animate) {
|
public void showContent(boolean animate) {
|
||||||
// Cancel any pending task to show the loading animation and show the list of
|
// Cancel any pending task to show the loading animation and show the list of
|
||||||
// apps directly.
|
// apps directly.
|
||||||
mFgHandler.removeCallbacks(mShowLoadingContainerRunnable);
|
mFgHandler.removeCallbacks(mShowLoadingContainerRunnable);
|
||||||
handleLoadingContainer(true /* show */, animate);
|
handleLoadingContainer(true /* showContent */, false /* showEmpty*/, animate);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows empty view and hides loading view & content view.
|
||||||
|
*/
|
||||||
|
public void showEmpty(boolean animate) {
|
||||||
|
if (mEmptyView == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cancel any pending task to show the loading animation and show the list of
|
||||||
|
// apps directly.
|
||||||
|
mFgHandler.removeCallbacks(mShowLoadingContainerRunnable);
|
||||||
|
handleLoadingContainer(false /* showContent */, true /* showEmpty */, animate);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Shows loading view and hides content view & empty view.
|
||||||
|
*/
|
||||||
|
public void showLoadingView() {
|
||||||
|
handleLoadingContainer(false /* showContent */, false /* showEmpty */, false /* animate */);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showLoadingViewDelayed() {
|
public void showLoadingViewDelayed() {
|
||||||
@@ -57,8 +89,9 @@ public class LoadingViewController {
|
|||||||
mShowLoadingContainerRunnable, DELAY_SHOW_LOADING_CONTAINER_THRESHOLD_MS);
|
mShowLoadingContainerRunnable, DELAY_SHOW_LOADING_CONTAINER_THRESHOLD_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleLoadingContainer(boolean done, boolean animate) {
|
private void handleLoadingContainer(boolean showContent, boolean showEmpty, boolean animate) {
|
||||||
handleLoadingContainer(mLoadingView, mContentView, done, animate);
|
handleLoadingContainer(mLoadingView, mContentView, mEmptyView,
|
||||||
|
showContent, showEmpty, animate);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,6 +108,25 @@ public class LoadingViewController {
|
|||||||
setViewShown(content, done, animate);
|
setViewShown(content, done, animate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show/hide loading view and content view and empty view.
|
||||||
|
*
|
||||||
|
* @param loading The loading spinner view
|
||||||
|
* @param content The content view
|
||||||
|
* @param empty The empty view shows no item summary to users.
|
||||||
|
* @param showContent If true, content is set visible and loading is set invisible.
|
||||||
|
* @param showEmpty If true, empty is set visible and loading is set invisible.
|
||||||
|
* @param animate Whether or not content/loading views should animate in/out.
|
||||||
|
*/
|
||||||
|
public static void handleLoadingContainer(View loading, View content, View empty,
|
||||||
|
boolean showContent, boolean showEmpty, boolean animate) {
|
||||||
|
if (empty != null) {
|
||||||
|
setViewShown(empty, showEmpty, animate);
|
||||||
|
}
|
||||||
|
setViewShown(content, showContent, animate);
|
||||||
|
setViewShown(loading, !showContent && !showEmpty, animate);
|
||||||
|
}
|
||||||
|
|
||||||
private static void setViewShown(final View view, boolean shown, boolean animate) {
|
private static void setViewShown(final View view, boolean shown, boolean animate) {
|
||||||
if (animate) {
|
if (animate) {
|
||||||
Animation animation = AnimationUtils.loadAnimation(view.getContext(),
|
Animation animation = AnimationUtils.loadAnimation(view.getContext(),
|
||||||
|
|||||||
@@ -1,155 +0,0 @@
|
|||||||
/*
|
|
||||||
* 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.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.android.settings.accessibility;
|
|
||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
|
||||||
|
|
||||||
import static org.mockito.ArgumentMatchers.any;
|
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
|
||||||
import static org.mockito.Mockito.doReturn;
|
|
||||||
import static org.mockito.Mockito.mock;
|
|
||||||
import static org.mockito.Mockito.never;
|
|
||||||
import static org.mockito.Mockito.spy;
|
|
||||||
import static org.mockito.Mockito.verify;
|
|
||||||
|
|
||||||
import android.content.ContentResolver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.graphics.drawable.AnimatedImageDrawable;
|
|
||||||
import android.graphics.drawable.AnimatedVectorDrawable;
|
|
||||||
import android.graphics.drawable.AnimationDrawable;
|
|
||||||
import android.net.Uri;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
|
|
||||||
import androidx.preference.PreferenceViewHolder;
|
|
||||||
|
|
||||||
import com.android.settings.R;
|
|
||||||
|
|
||||||
import com.airbnb.lottie.LottieAnimationView;
|
|
||||||
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.runner.RunWith;
|
|
||||||
import org.mockito.Mock;
|
|
||||||
import org.mockito.MockitoAnnotations;
|
|
||||||
import org.mockito.Spy;
|
|
||||||
import org.robolectric.RobolectricTestRunner;
|
|
||||||
import org.robolectric.RuntimeEnvironment;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
|
||||||
|
|
||||||
/** Tests for {@link AnimatedImagePreference}. */
|
|
||||||
@RunWith(RobolectricTestRunner.class)
|
|
||||||
public class AnimatedImagePreferenceTest {
|
|
||||||
private final Context mContext = RuntimeEnvironment.application;
|
|
||||||
private Uri mImageUri;
|
|
||||||
private PreferenceViewHolder mViewHolder;
|
|
||||||
private AnimatedImagePreference mAnimatedImagePreference;
|
|
||||||
|
|
||||||
@Mock
|
|
||||||
private ViewGroup mRootView;
|
|
||||||
|
|
||||||
@Spy
|
|
||||||
private ImageView mImageView;
|
|
||||||
|
|
||||||
@Before
|
|
||||||
public void init() {
|
|
||||||
MockitoAnnotations.initMocks(this);
|
|
||||||
|
|
||||||
mViewHolder = spy(PreferenceViewHolder.createInstanceForTests(mRootView));
|
|
||||||
doReturn(new LottieAnimationView(mContext)).when(mRootView).findViewById(R.id.lottie_view);
|
|
||||||
mImageView = spy(new ImageView(mContext));
|
|
||||||
|
|
||||||
mAnimatedImagePreference = new AnimatedImagePreference(mContext);
|
|
||||||
mImageUri = new Uri.Builder().build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void playAnimation_animatedImageDrawable_success() {
|
|
||||||
final AnimatedImageDrawable drawable = mock(AnimatedImageDrawable.class);
|
|
||||||
doReturn(mImageView).when(mRootView).findViewById(R.id.animated_img);
|
|
||||||
doReturn(drawable).when(mImageView).getDrawable();
|
|
||||||
|
|
||||||
mAnimatedImagePreference.setImageUri(mImageUri);
|
|
||||||
mAnimatedImagePreference.onBindViewHolder(mViewHolder);
|
|
||||||
|
|
||||||
verify(drawable).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void playAnimation_animatedVectorDrawable_success() {
|
|
||||||
final AnimatedVectorDrawable drawable = mock(AnimatedVectorDrawable.class);
|
|
||||||
doReturn(mImageView).when(mRootView).findViewById(R.id.animated_img);
|
|
||||||
doReturn(drawable).when(mImageView).getDrawable();
|
|
||||||
|
|
||||||
mAnimatedImagePreference.setImageUri(mImageUri);
|
|
||||||
mAnimatedImagePreference.onBindViewHolder(mViewHolder);
|
|
||||||
|
|
||||||
verify(drawable).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void playAnimation_animationDrawable_success() {
|
|
||||||
final AnimationDrawable drawable = mock(AnimationDrawable.class);
|
|
||||||
doReturn(mImageView).when(mRootView).findViewById(R.id.animated_img);
|
|
||||||
doReturn(drawable).when(mImageView).getDrawable();
|
|
||||||
|
|
||||||
mAnimatedImagePreference.setImageUri(mImageUri);
|
|
||||||
mAnimatedImagePreference.onBindViewHolder(mViewHolder);
|
|
||||||
|
|
||||||
verify(drawable).start();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void setImageUri_viewNotExist_setFail() {
|
|
||||||
doReturn(null).when(mRootView).findViewById(R.id.animated_img);
|
|
||||||
|
|
||||||
mAnimatedImagePreference.setImageUri(mImageUri);
|
|
||||||
mAnimatedImagePreference.onBindViewHolder(mViewHolder);
|
|
||||||
|
|
||||||
verify(mImageView, never()).setImageURI(mImageUri);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void setMaxHeight_success() {
|
|
||||||
final int maxHeight = 100;
|
|
||||||
doReturn(mImageView).when(mRootView).findViewById(R.id.animated_img);
|
|
||||||
|
|
||||||
mAnimatedImagePreference.setMaxHeight(maxHeight);
|
|
||||||
mAnimatedImagePreference.onBindViewHolder(mViewHolder);
|
|
||||||
|
|
||||||
assertThat(mImageView.getMaxHeight()).isEqualTo(maxHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
|
||||||
public void setImageUriAndRebindViewHolder_lottieImageFromRawFolder_setAnimation() {
|
|
||||||
final int fakeLottieResId = 111111;
|
|
||||||
final Uri lottieImageUri =
|
|
||||||
new Uri.Builder().scheme(ContentResolver.SCHEME_ANDROID_RESOURCE)
|
|
||||||
.authority(mContext.getPackageName())
|
|
||||||
.appendPath(String.valueOf(fakeLottieResId))
|
|
||||||
.build();
|
|
||||||
final LottieAnimationView lottieView = spy(new LottieAnimationView(mContext));
|
|
||||||
doReturn(mImageView).when(mRootView).findViewById(R.id.animated_img);
|
|
||||||
doReturn(lottieView).when(mRootView).findViewById(R.id.lottie_view);
|
|
||||||
|
|
||||||
mAnimatedImagePreference.setImageUri(lottieImageUri);
|
|
||||||
mAnimatedImagePreference.onBindViewHolder(mViewHolder);
|
|
||||||
|
|
||||||
verify(lottieView).setAnimation(any(InputStream.class), eq(null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -28,7 +28,6 @@ import static com.google.common.truth.Truth.assertThat;
|
|||||||
import static org.mockito.ArgumentMatchers.any;
|
import static org.mockito.ArgumentMatchers.any;
|
||||||
import static org.mockito.ArgumentMatchers.anyBoolean;
|
import static org.mockito.ArgumentMatchers.anyBoolean;
|
||||||
import static org.mockito.ArgumentMatchers.anyInt;
|
import static org.mockito.ArgumentMatchers.anyInt;
|
||||||
import static org.mockito.ArgumentMatchers.eq;
|
|
||||||
import static org.mockito.Mockito.doNothing;
|
import static org.mockito.Mockito.doNothing;
|
||||||
import static org.mockito.Mockito.doReturn;
|
import static org.mockito.Mockito.doReturn;
|
||||||
import static org.mockito.Mockito.mock;
|
import static org.mockito.Mockito.mock;
|
||||||
@@ -49,7 +48,6 @@ import android.view.Menu;
|
|||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.SearchView;
|
import android.widget.SearchView;
|
||||||
|
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
@@ -155,22 +153,6 @@ public class ManageApplicationsTest {
|
|||||||
assertThat(mMenu.findItem(R.id.sort_order_frequent_notification).isVisible()).isFalse();
|
assertThat(mMenu.findItem(R.id.sort_order_frequent_notification).isVisible()).isFalse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void onCreateView_shouldNotShowLoadingContainer() {
|
|
||||||
ReflectionHelpers.setField(mFragment, "mResetAppsHelper", mock(ResetAppsHelper.class));
|
|
||||||
doNothing().when(mFragment).createHeader();
|
|
||||||
|
|
||||||
final LayoutInflater layoutInflater = mock(LayoutInflater.class);
|
|
||||||
final View view = mock(View.class);
|
|
||||||
final View loadingContainer = mock(View.class);
|
|
||||||
when(layoutInflater.inflate(anyInt(), eq(null))).thenReturn(view);
|
|
||||||
when(view.findViewById(R.id.loading_container)).thenReturn(loadingContainer);
|
|
||||||
|
|
||||||
mFragment.onCreateView(layoutInflater, mock(ViewGroup.class), null);
|
|
||||||
|
|
||||||
verify(loadingContainer, never()).setVisibility(View.VISIBLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void onCreateOptionsMenu_shouldSetSearchQueryListener() {
|
public void onCreateOptionsMenu_shouldSetSearchQueryListener() {
|
||||||
final SearchView searchView = mock(SearchView.class);
|
final SearchView searchView = mock(SearchView.class);
|
||||||
@@ -221,7 +203,6 @@ public class ManageApplicationsTest {
|
|||||||
@Test
|
@Test
|
||||||
public void updateLoading_appLoaded_shouldNotDelayCallToHandleLoadingContainer() {
|
public void updateLoading_appLoaded_shouldNotDelayCallToHandleLoadingContainer() {
|
||||||
ReflectionHelpers.setField(mFragment, "mLoadingContainer", mock(View.class));
|
ReflectionHelpers.setField(mFragment, "mLoadingContainer", mock(View.class));
|
||||||
ReflectionHelpers.setField(mFragment, "mListContainer", mock(View.class));
|
|
||||||
final ManageApplications.ApplicationsAdapter adapter =
|
final ManageApplications.ApplicationsAdapter adapter =
|
||||||
spy(new ManageApplications.ApplicationsAdapter(mState, mFragment,
|
spy(new ManageApplications.ApplicationsAdapter(mState, mFragment,
|
||||||
AppFilterRegistry.getInstance().get(FILTER_APPS_ALL), new Bundle()));
|
AppFilterRegistry.getInstance().get(FILTER_APPS_ALL), new Bundle()));
|
||||||
@@ -243,7 +224,6 @@ public class ManageApplicationsTest {
|
|||||||
@Test
|
@Test
|
||||||
public void updateLoading_appNotLoaded_shouldDelayCallToHandleLoadingContainer() {
|
public void updateLoading_appNotLoaded_shouldDelayCallToHandleLoadingContainer() {
|
||||||
ReflectionHelpers.setField(mFragment, "mLoadingContainer", mock(View.class));
|
ReflectionHelpers.setField(mFragment, "mLoadingContainer", mock(View.class));
|
||||||
ReflectionHelpers.setField(mFragment, "mListContainer", mock(View.class));
|
|
||||||
final ManageApplications.ApplicationsAdapter adapter =
|
final ManageApplications.ApplicationsAdapter adapter =
|
||||||
spy(new ManageApplications.ApplicationsAdapter(mState, mFragment,
|
spy(new ManageApplications.ApplicationsAdapter(mState, mFragment,
|
||||||
AppFilterRegistry.getInstance().get(FILTER_APPS_ALL), new Bundle()));
|
AppFilterRegistry.getInstance().get(FILTER_APPS_ALL), new Bundle()));
|
||||||
@@ -272,7 +252,6 @@ public class ManageApplicationsTest {
|
|||||||
when(listContainer.getVisibility()).thenReturn(View.INVISIBLE);
|
when(listContainer.getVisibility()).thenReturn(View.INVISIBLE);
|
||||||
when(listContainer.getContext()).thenReturn(context);
|
when(listContainer.getContext()).thenReturn(context);
|
||||||
ReflectionHelpers.setField(mFragment, "mLoadingContainer", loadingContainer);
|
ReflectionHelpers.setField(mFragment, "mLoadingContainer", loadingContainer);
|
||||||
ReflectionHelpers.setField(mFragment, "mListContainer", listContainer);
|
|
||||||
final ManageApplications.ApplicationsAdapter adapter =
|
final ManageApplications.ApplicationsAdapter adapter =
|
||||||
spy(new ManageApplications.ApplicationsAdapter(mState, mFragment,
|
spy(new ManageApplications.ApplicationsAdapter(mState, mFragment,
|
||||||
AppFilterRegistry.getInstance().get(FILTER_APPS_ALL), new Bundle()));
|
AppFilterRegistry.getInstance().get(FILTER_APPS_ALL), new Bundle()));
|
||||||
@@ -296,7 +275,7 @@ public class ManageApplicationsTest {
|
|||||||
|
|
||||||
adapter.onRebuildComplete(null);
|
adapter.onRebuildComplete(null);
|
||||||
|
|
||||||
verify(loadingViewController).showContent(true /* animate */);
|
verify(loadingViewController).showEmpty(false /* animate */);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -304,15 +283,16 @@ public class ManageApplicationsTest {
|
|||||||
final String query = "Test";
|
final String query = "Test";
|
||||||
final RecyclerView recyclerView = mock(RecyclerView.class);
|
final RecyclerView recyclerView = mock(RecyclerView.class);
|
||||||
final View emptyView = mock(View.class);
|
final View emptyView = mock(View.class);
|
||||||
|
final View loadingContainer = mock(View.class);
|
||||||
ReflectionHelpers.setField(mFragment, "mRecyclerView", recyclerView);
|
ReflectionHelpers.setField(mFragment, "mRecyclerView", recyclerView);
|
||||||
ReflectionHelpers.setField(mFragment, "mEmptyView", emptyView);
|
ReflectionHelpers.setField(mFragment, "mEmptyView", emptyView);
|
||||||
|
ReflectionHelpers.setField(mFragment, "mLoadingContainer", loadingContainer);
|
||||||
final SearchView searchView = mock(SearchView.class);
|
final SearchView searchView = mock(SearchView.class);
|
||||||
ReflectionHelpers.setField(mFragment, "mSearchView", searchView);
|
ReflectionHelpers.setField(mFragment, "mSearchView", searchView);
|
||||||
when(searchView.isVisibleToUser()).thenReturn(true);
|
when(searchView.isVisibleToUser()).thenReturn(true);
|
||||||
when(searchView.getQuery()).thenReturn(query);
|
when(searchView.getQuery()).thenReturn(query);
|
||||||
final View listContainer = mock(View.class);
|
final View listContainer = mock(View.class);
|
||||||
when(listContainer.getVisibility()).thenReturn(View.VISIBLE);
|
when(listContainer.getVisibility()).thenReturn(View.VISIBLE);
|
||||||
ReflectionHelpers.setField(mFragment, "mListContainer", listContainer);
|
|
||||||
ReflectionHelpers.setField(
|
ReflectionHelpers.setField(
|
||||||
mFragment, "mFilterAdapter", mock(ManageApplications.FilterSpinnerAdapter.class));
|
mFragment, "mFilterAdapter", mock(ManageApplications.FilterSpinnerAdapter.class));
|
||||||
final ArrayList<ApplicationsState.AppEntry> appList = new ArrayList<>();
|
final ArrayList<ApplicationsState.AppEntry> appList = new ArrayList<>();
|
||||||
@@ -491,8 +471,6 @@ public class ManageApplicationsTest {
|
|||||||
mFragment.mFilterAdapter.updateFilterView(true);
|
mFragment.mFilterAdapter.updateFilterView(true);
|
||||||
|
|
||||||
assertThat(mFragment.mSpinnerHeader.getVisibility()).isEqualTo(View.VISIBLE);
|
assertThat(mFragment.mSpinnerHeader.getVisibility()).isEqualTo(View.VISIBLE);
|
||||||
assertThat(mFragment.mRecyclerView.getPaddingTop()).isEqualTo(
|
|
||||||
mContext.getResources().getDimensionPixelSize(R.dimen.app_bar_height));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user