OSDN Git Service

QS: New disabled icon states for wifi/cell tiles.
authorJohn Spurlock <jspurlock@google.com>
Fri, 1 Aug 2014 16:12:32 +0000 (12:12 -0400)
committerJohn Spurlock <jspurlock@google.com>
Fri, 1 Aug 2014 16:12:32 +0000 (12:12 -0400)
Bug:15988601
Change-Id: I82c1b0f80277a6529e8648708199c45c5226b81f

packages/SystemUI/res/drawable/ic_qs_signal_disabled.xml [new file with mode: 0644]
packages/SystemUI/res/drawable/ic_qs_wifi_disabled.xml [new file with mode: 0644]
packages/SystemUI/src/com/android/systemui/qs/tiles/CellularTile.java
packages/SystemUI/src/com/android/systemui/qs/tiles/WifiTile.java

diff --git a/packages/SystemUI/res/drawable/ic_qs_signal_disabled.xml b/packages/SystemUI/res/drawable/ic_qs_signal_disabled.xml
new file mode 100644 (file)
index 0000000..4f253e3
--- /dev/null
@@ -0,0 +1,28 @@
+<!--
+Copyright (C) 2014 The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:autoMirrored="true"
+        android:width="32dp"
+        android:height="32dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:fillColor="#4DFFFFFF"
+        android:pathData="M21.799999,22.299999l-1.199999,-1.299999 0.000000,0.000000 -9.600000,-10.000000 0.000000,0.000000 -6.400000,-6.700000 -1.300000,1.300000 6.400000,6.700000 -8.700000,8.700000 16.900000,0.000000 2.600000,2.700001z"/>
+    <path
+        android:fillColor="#4DFFFFFF"
+        android:pathData="M21.000000,1.000000l-8.600000,8.600000 8.600000,9.100000z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_qs_wifi_disabled.xml b/packages/SystemUI/res/drawable/ic_qs_wifi_disabled.xml
new file mode 100644 (file)
index 0000000..c505783
--- /dev/null
@@ -0,0 +1,27 @@
+<!--
+Copyright (C) 2014 The Android Open Source Project
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+-->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="32.0dp"
+        android:height="29.5dp"
+        android:viewportWidth="26.0"
+        android:viewportHeight="24.0">
+    <path
+        android:fillColor="#4DFFFFFF"
+        android:pathData="M17.500000,16.500000L5.800000,3.400000c0.000000,0.000000 0.000000,0.000000 0.000000,0.000000l-2.700000,-3.000000L1.600000,1.800000l2.200000,2.500000c-2.000000,1.000000 -3.200000,2.000000 -3.400000,2.200000L13.000000,22.000000l0.000000,0.000000l0.000000,0.000000l0.000000,0.000000l0.000000,0.000000l3.200000,-3.900000l2.400000,2.700000l1.500000,-1.400000L17.500000,16.500000L17.500000,16.500000z"/>
+    <path
+        android:fillColor="#4DFFFFFF"
+        android:pathData="M25.600000,6.500000C25.100000,6.100000 20.299999,2.100000 13.000000,2.100000c-1.900000,0.000000 -3.600000,0.300000 -5.200000,0.700000L18.700001,15.000000L25.600000,6.500000z"/>
+</vector>
index 42da282..ce42d47 100644 (file)
@@ -91,10 +91,9 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
         if (cb == null) return;
 
         final Resources r = mContext.getResources();
-        state.iconId = cb.noSim
-                ? R.drawable.stat_sys_no_sim
-                : cb.enabled && (cb.mobileSignalIconId > 0) && !cb.airplaneModeEnabled
-                ? cb.mobileSignalIconId
+        state.iconId = cb.noSim ? R.drawable.stat_sys_no_sim
+                : !cb.enabled || cb.airplaneModeEnabled ? R.drawable.ic_qs_signal_disabled
+                : cb.mobileSignalIconId > 0 ? cb.mobileSignalIconId
                 : R.drawable.ic_qs_signal_no_signal;
         state.overlayIconId = cb.enabled && (cb.dataTypeIconId > 0) && !cb.wifiConnected
                 ? cb.dataTypeIconId
index 1707b32..5651d49 100644 (file)
@@ -113,7 +113,11 @@ public class WifiTile extends QSTile<QSTile.SignalState> {
         state.filter = true;
         final String signalContentDescription;
         final Resources r = mContext.getResources();
-        if (wifiConnected) {
+        if (!state.enabled) {
+            state.iconId = R.drawable.ic_qs_wifi_disabled;
+            state.label = r.getString(R.string.quick_settings_wifi_label);
+            signalContentDescription = r.getString(R.string.accessibility_wifi_off);
+        } else if (wifiConnected) {
             state.iconId = cb.wifiSignalIconId;
             state.label = removeDoubleQuotes(cb.enabledDesc);
             signalContentDescription = cb.wifiSignalContentDescription;