OSDN Git Service

Fix QS Detail header touch target
authorJason Monk <jmonk@google.com>
Fri, 26 May 2017 17:19:38 +0000 (13:19 -0400)
committerJason Monk <jmonk@google.com>
Fri, 26 May 2017 17:19:38 +0000 (13:19 -0400)
Move around some spacings and paddings to make sure the whole area
counts as a touch for the header.

Test: manual
Change-Id: I3d7515767cc3624efb195481886dc03c69cc39c9
Fixes: 38250837

packages/SystemUI/res/layout/qs_detail.xml
packages/SystemUI/res/layout/qs_detail_header.xml
packages/SystemUI/res/layout/qs_detail_items.xml
packages/SystemUI/res/layout/zen_mode_panel.xml
packages/SystemUI/res/values/dimens.xml

index f41c494..34e43ce 100644 (file)
     android:paddingBottom="8dp"
     android:visibility="invisible">
 
-    <com.android.systemui.ResizingSpace
-        android:layout_width="match_parent"
-        android:layout_height="@dimen/qs_detail_margin_top" />
-
     <include
         android:id="@+id/qs_detail_header"
         layout="@layout/qs_detail_header"
index 871ed67..a1f0ee7 100644 (file)
     android:layout_height="wrap_content"
     android:paddingLeft="@dimen/qs_detail_header_padding"
     android:paddingTop="@dimen/qs_detail_header_padding"
-    android:paddingBottom="@dimen/qs_detail_header_bottom_padding"
+    android:paddingBottom="@dimen/qs_detail_items_padding_top"
     android:paddingEnd="@dimen/qs_panel_padding"
     android:background="@drawable/btn_borderless_rect"
+    android:orientation="vertical"
     android:gravity="center">
 
-    <TextView
-        android:id="@android:id/title"
-        android:paddingStart="@dimen/qs_detail_header_text_padding"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_weight="1"
-        android:textDirection="locale"
-        android:textAppearance="@style/TextAppearance.QS.DetailHeader" />
-
-    <ImageView
-        android:id="@+id/settings"
-        android:layout_width="@dimen/qs_detail_image_width"
-        android:layout_height="@dimen/qs_detail_image_height"
-        android:background="?android:attr/selectableItemBackground"
-        android:padding="@dimen/qs_detail_image_padding"
-        android:src="@drawable/ic_settings"
-        android:visibility="gone"/>
-
-    <Switch
-        android:id="@android:id/toggle"
-        android:layout_width="wrap_content"
+    <com.android.systemui.ResizingSpace
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/qs_detail_margin_top" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:clickable="false"
-        android:textAppearance="@style/TextAppearance.QS.DetailHeader" />
+        android:orientation="horizontal">
+
+        <TextView
+            android:id="@android:id/title"
+            android:paddingStart="@dimen/qs_detail_header_text_padding"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:textDirection="locale"
+            android:textAppearance="@style/TextAppearance.QS.DetailHeader" />
+
+        <ImageView
+            android:id="@+id/settings"
+            android:layout_width="@dimen/qs_detail_image_width"
+            android:layout_height="@dimen/qs_detail_image_height"
+            android:background="?android:attr/selectableItemBackground"
+            android:padding="@dimen/qs_detail_image_padding"
+            android:src="@drawable/ic_settings"
+            android:visibility="gone"/>
+
+        <Switch
+            android:id="@android:id/toggle"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:clickable="false"
+            android:textAppearance="@style/TextAppearance.QS.DetailHeader" />
+
+    </LinearLayout>
 
 </com.android.keyguard.AlphaOptimizedLinearLayout>
index b9cdf28..60cba67 100644 (file)
@@ -20,7 +20,6 @@
     xmlns:sysui="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingTop="@dimen/qs_detail_items_padding_top"
     android:paddingStart="@dimen/qs_detail_padding_start"
     android:paddingEnd="16dp">
 
index 8707840..200eabf 100644 (file)
@@ -36,7 +36,6 @@
             android:layout_height="wrap_content"
             android:layout_marginStart="16dp"
             android:layout_marginEnd="16dp"
-            android:layout_marginTop="8dp"
             android:layout_marginBottom="8dp" />
 
         <RelativeLayout
index 6604b6c..4245b11 100644 (file)
     <dimen name="qs_panel_padding_bottom">0dp</dimen>
     <dimen name="qs_detail_header_height">56dp</dimen>
     <dimen name="qs_detail_header_padding">0dp</dimen>
-    <dimen name="qs_detail_header_bottom_padding">0dp</dimen>
     <dimen name="qs_detail_image_width">56dp</dimen>
     <dimen name="qs_detail_image_height">56dp</dimen>
     <dimen name="qs_detail_image_padding">16dp</dimen>