Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1b99d25 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Make QS footer 90% transparent."

parents e52b9454 c225e32c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -20,13 +20,19 @@
    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"
    android:clipChildren="false"
    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"
+0 −1
Original line number Diff line number Diff line
@@ -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"
    />

+3 −0
Original line number Diff line number Diff line
@@ -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)
+5 −1
Original line number Diff line number Diff line
@@ -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();
+6 −5
Original line number Diff line number Diff line
@@ -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) {