summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/SystemUI/res/layout/qs_footer_impl.xml8
-rw-r--r--packages/SystemUI/res/layout/qs_panel.xml1
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java3
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSPanel.java6
-rw-r--r--packages/SystemUI/src/com/android/systemui/qs/QSScrollLayout.java11
5 files changed, 21 insertions, 8 deletions
diff --git a/packages/SystemUI/res/layout/qs_footer_impl.xml b/packages/SystemUI/res/layout/qs_footer_impl.xml
index 100c2aa51b4d..97472a49187a 100644
--- a/packages/SystemUI/res/layout/qs_footer_impl.xml
+++ b/packages/SystemUI/res/layout/qs_footer_impl.xml
@@ -20,7 +20,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/qs_footer"
android:layout_width="match_parent"
- android:layout_height="48dp"
+ android:layout_height="@dimen/qs_footer_height"
android:elevation="4dp"
android:baselineAligned="false"
android:clickable="false"
@@ -28,6 +28,12 @@
android:clipToPadding="false">
<View
+ android:id="@+id/qs_footer_background"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/qs_background_primary" />
+
+ <View
android:id="@+id/qs_footer_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
diff --git a/packages/SystemUI/res/layout/qs_panel.xml b/packages/SystemUI/res/layout/qs_panel.xml
index 1dab76183864..15b0f002d3b2 100644
--- a/packages/SystemUI/res/layout/qs_panel.xml
+++ b/packages/SystemUI/res/layout/qs_panel.xml
@@ -54,7 +54,6 @@
android:layout_marginTop="@*android:dimen/quick_qs_offset_height"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:layout_marginBottom="48dp"
android:elevation="4dp"
/>
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java b/packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java
index 7f34acb2ef94..fe3ffb926305 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSFooterImpl.java
@@ -87,6 +87,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
private View mActionsContainer;
private View mDragHandle;
private final int mDragHandleExpandOffset;
+ private View mBackground;
public QSFooterImpl(Context context, AttributeSet attrs) {
super(context, attrs);
@@ -99,6 +100,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
@Override
protected void onFinishInflate() {
super.onFinishInflate();
+ mBackground = findViewById(R.id.qs_footer_background);
mDivider = findViewById(R.id.qs_footer_divider);
mEdit = findViewById(android.R.id.edit);
mEdit.setOnClickListener(view ->
@@ -168,6 +170,7 @@ public class QSFooterImpl extends FrameLayout implements QSFooter,
@Nullable
private TouchAnimator createFooterAnimator() {
return new TouchAnimator.Builder()
+ .addFloat(mBackground, "alpha", 0, 0.90f)
.addFloat(mDivider, "alpha", 0, 1)
.addFloat(mCarrierText, "alpha", 0, 1)
.addFloat(mActionsContainer, "alpha", 0, 1)
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
index 00b6c1ed2475..eb8c62db114a 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSPanel.java
@@ -26,6 +26,7 @@ import android.metrics.LogMaker;
import android.os.Handler;
import android.os.Message;
import android.service.quicksettings.Tile;
+import android.support.v4.widget.Space;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.MotionEvent;
@@ -97,7 +98,10 @@ public class QSPanel extends LinearLayout implements Tunable, Callback, Brightne
R.layout.quick_settings_brightness_dialog, this, false);
mTileLayout = new TileLayout(mContext);
mTileLayout.setListening(mListening);
- mScrollLayout = new QSScrollLayout(mContext, mBrightnessView, (View) mTileLayout);
+ Space space = new Space(mContext);
+ space.setLayoutParams(new LayoutParams(LayoutParams.MATCH_PARENT,
+ mContext.getResources().getDimensionPixelSize(R.dimen.qs_footer_height)));
+ mScrollLayout = new QSScrollLayout(mContext, mBrightnessView, (View) mTileLayout, space);
addView(mScrollLayout);
addDivider();
diff --git a/packages/SystemUI/src/com/android/systemui/qs/QSScrollLayout.java b/packages/SystemUI/src/com/android/systemui/qs/QSScrollLayout.java
index 9a747877d9be..9cda75c858e8 100644
--- a/packages/SystemUI/src/com/android/systemui/qs/QSScrollLayout.java
+++ b/packages/SystemUI/src/com/android/systemui/qs/QSScrollLayout.java
@@ -15,7 +15,6 @@
package com.android.systemui.qs;
import android.content.Context;
-import android.graphics.Rect;
import android.support.v4.widget.NestedScrollView;
import android.view.MotionEvent;
import android.view.View;
@@ -23,6 +22,8 @@ import android.view.ViewConfiguration;
import android.view.ViewParent;
import android.widget.LinearLayout;
+import com.android.systemui.R;
+
/**
* Quick setting scroll view containing the brightness slider and the QS tiles.
*
@@ -32,12 +33,13 @@ import android.widget.LinearLayout;
*/
public class QSScrollLayout extends NestedScrollView {
private final int mTouchSlop;
+ private final int mFooterHeight;
private int mLastMotionY;
- private Rect mHitRect = new Rect();
public QSScrollLayout(Context context, View... children) {
super(context);
mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop();
+ mFooterHeight = getResources().getDimensionPixelSize(R.dimen.qs_footer_height);
LinearLayout linearLayout = new LinearLayout(mContext);
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.MATCH_PARENT,
@@ -50,9 +52,8 @@ public class QSScrollLayout extends NestedScrollView {
}
public boolean shouldIntercept(MotionEvent ev) {
- getHitRect(mHitRect);
- if (!mHitRect.contains((int) ev.getX(), (int) ev.getY())) {
- // Do not intercept touches that are not within this view's bounds.
+ if (ev.getY() > (getBottom() - mFooterHeight)) {
+ // Do not intercept touches that are below the divider between QS and the footer.
return false;
}
if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {