OSDN Git Service

[WifiSettings] Use arrows for advanced options
authorMaurice Lam <yukl@google.com>
Thu, 12 Feb 2015 22:53:59 +0000 (14:53 -0800)
committerMaurice Lam <yukl@google.com>
Wed, 18 Feb 2015 18:54:04 +0000 (10:54 -0800)
Use an arrow pointing up / down for advanced options instead of a
checkbox, making it more clear that it is merely hiding the options,
and not a setting in itself that others are dependent upon.

Bug: 18007635
Change-Id: Ie2f2cca708b661f76749bc4af5918275806af1a8

res/drawable/ic_expand.xml [new file with mode: 0644]
res/drawable/ic_expand_less.xml [new file with mode: 0644]
res/drawable/ic_expand_more.xml [new file with mode: 0644]
res/layout/wifi_dialog.xml
res/values/styles.xml

diff --git a/res/drawable/ic_expand.xml b/res/drawable/ic_expand.xml
new file mode 100644 (file)
index 0000000..72da2b9
--- /dev/null
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_checked="true" android:drawable="@drawable/ic_expand_less" />
+
+    <item android:drawable="@drawable/ic_expand_more" />
+
+</selector>
diff --git a/res/drawable/ic_expand_less.xml b/res/drawable/ic_expand_less.xml
new file mode 100644 (file)
index 0000000..3a00faf
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2015 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="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+
+    <path
+        android:fillColor="?android:attr/colorControlNormal"
+        android:pathData="M12.0,8.0l-6.0,6.0 1.41,1.41L12.0,10.83l4.59,4.58L18.0,14.0z"/>
+
+</vector>
diff --git a/res/drawable/ic_expand_more.xml b/res/drawable/ic_expand_more.xml
new file mode 100644 (file)
index 0000000..64d2242
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2015 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="24dp"
+    android:height="24dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24">
+
+    <path
+        android:fillColor="?android:attr/colorControlNormal"
+        android:pathData="M16.59,8.59L12.0,13.17 7.41,8.59 6.0,10.0l6.0,6.0 6.0,-6.0z"/>
+
+</vector>
index c1d6124..84d98da 100644 (file)
             <CheckBox android:id="@+id/wifi_advanced_togglebox"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
-                    style="@style/wifi_item_content"
-                    android:textSize="14sp"
+                    style="@style/wifi_advanced_toggle"
                     android:text="@string/wifi_show_advanced" />
         </LinearLayout>
 
index 55dcd66..83d02d6 100644 (file)
         <item name="android:textColor">?android:attr/textColorPrimary</item>
     </style>
 
+    <style name="wifi_advanced_toggle" parent="wifi_item_content">
+        <item name="android:background">@null</item>
+        <item name="android:button">@null</item>
+        <item name="android:drawableEnd">@drawable/ic_expand</item>
+        <item name="android:paddingStart">8dip</item>
+        <item name="android:textSize">14sp</item>
+    </style>
+
     <style name="wifi_item_edit_content">
         <item name="android:paddingStart">4dip</item>
         <item name="android:layout_marginStart">4dip</item>