OSDN Git Service

Fix QS header touch targets
authorJason Monk <jmonk@google.com>
Tue, 30 May 2017 16:47:10 +0000 (12:47 -0400)
committerJason Monk <jmonk@google.com>
Tue, 30 May 2017 19:32:42 +0000 (15:32 -0400)
 - Fix the sizing by removing padding and repositioning
 - Have container absorb clicks so misses don't collapse
   the panel.

Test: manual
Change-Id: I2f7f79ca23105561c4ce8b7ff44f59ae99131f85
Fixes: 37049839
Fixes: 38359316

packages/SystemUI/res/layout/quick_status_bar_expanded_header.xml
packages/SystemUI/src/com/android/systemui/qs/QSContainerImpl.java
packages/SystemUI/src/com/android/systemui/qs/QuickQSPanel.java

index 005e955..66c5dd5 100644 (file)
@@ -29,7 +29,6 @@
     android:clickable="false"
     android:clipChildren="false"
     android:clipToPadding="false"
-    android:paddingBottom="48dp"
     android:paddingTop="0dp"
     android:paddingEnd="0dp"
     android:paddingStart="0dp">
     <com.android.systemui.qs.QuickQSPanel
         android:id="@+id/quick_qs_panel"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
+        android:layout_height="48dp"
         android:layout_alignParentEnd="true"
-        android:layout_marginTop="36dp"
-        android:layout_marginBottom="8dp"
+        android:layout_marginTop="31dp"
         android:layout_alignParentTop="true"
         android:accessibilityTraversalAfter="@+id/date_time_group"
         android:accessibilityTraversalBefore="@id/expand_indicator"
@@ -95,8 +93,7 @@
         android:layout_marginStart="8dp"
         android:layout_marginEnd="8dp"
         android:focusable="true"
-        android:importantForAccessibility="yes"
-        android:paddingTop="0dp"/>
+        android:importantForAccessibility="yes" />
 
     <com.android.systemui.statusbar.AlphaOptimizedImageView
         android:id="@+id/qs_detail_header_progress"
index 149b5cc..0d74b7a 100644 (file)
@@ -58,6 +58,16 @@ public class QSContainerImpl extends FrameLayout {
         mBackground = findViewById(R.id.qs_background);
         mGutterHeight = getContext().getResources().getDimensionPixelSize(R.dimen.qs_gutter_height);
         mFullElevation = mQSPanel.getElevation();
+
+        setClickable(true);
+        setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
+    }
+
+    @Override
+    public boolean performClick() {
+        // Want to receive clicks so missing QQS tiles doesn't cause collapse, but
+        // don't want to do anything with them.
+        return true;
     }
 
     @Override
index 8539cb9..00b883a 100644 (file)
@@ -60,6 +60,12 @@ public class QuickQSPanel extends QSPanel {
         mTileLayout = new HeaderTileLayout(context);
         mTileLayout.setListening(mListening);
         addView((View) mTileLayout, 0 /* Between brightness and footer */);
+        super.setPadding(0, 0, 0, 0);
+    }
+
+    @Override
+    public void setPadding(int left, int top, int right, int bottom) {
+        // Always have no padding.
     }
 
     @Override