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

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

Merge "Fix up the QS gutter" into oc-dev

parents f3a50f16 4de5d3c0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@ public interface QS extends FragmentBase {

    View getHeader();

    default void setHasNotifications(boolean hasNotifications) {
    }

    @ProvidesInterface(version = HeightListener.VERSION)
    public interface HeightListener {
        public static final int VERSION = 1;
+9 −2
Original line number Diff line number Diff line
@@ -27,20 +27,22 @@
    android:clipChildren="false"
    android:clipToPadding="false"
    android:paddingTop="0dp"
    android:paddingEnd="8dp"
    android:paddingStart="16dp"
    android:gravity="center_vertical"
    android:orientation="horizontal">

    <include
        android:id="@+id/date_time_alarm_group"
        layout="@layout/status_bar_alarm_group"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="8dp"
        android:layout_width="wrap_content"
        android:layout_height="match_parent" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginStart="16dp"
        android:layout_marginEnd="8dp"
        android:gravity="end">

        <com.android.systemui.statusbar.phone.MultiUserSwitch
@@ -113,4 +115,9 @@
            android:padding="14dp" />
    </LinearLayout>

    <include layout="@layout/qs_divider"
        android:layout_width="match_parent"
        android:layout_height="1dp"
        android:layout_gravity="bottom" />

</com.android.systemui.qs.QSFooter>
+2 −2
Original line number Diff line number Diff line
@@ -41,8 +41,8 @@
        android:clipChildren="false"
        android:clipToPadding="false"
        android:gravity="center"
        android:paddingStart="8dp"
        android:paddingEnd="8dp"
        android:paddingStart="16dp"
        android:paddingEnd="16dp"
        android:orientation="horizontal">


+29 −10
Original line number Diff line number Diff line
@@ -17,14 +17,11 @@
package com.android.systemui.qs;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.util.AttributeSet;
import android.view.View;
import android.widget.FrameLayout;

import com.android.settingslib.Utils;
import com.android.systemui.R;
import com.android.systemui.qs.customize.QSCustomizer;

@@ -44,6 +41,7 @@ public class QSContainerImpl extends FrameLayout {
    private QSFooter mQSFooter;
    private int mGutterHeight;
    private View mBackground;
    private float mFullElevation;

    public QSContainerImpl(Context context, AttributeSet attrs) {
        super(context, attrs);
@@ -59,6 +57,7 @@ public class QSContainerImpl extends FrameLayout {
        mQSFooter = findViewById(R.id.qs_footer);
        mBackground = findViewById(R.id.qs_background);
        mGutterHeight = getContext().getResources().getDimensionPixelSize(R.dimen.qs_gutter_height);
        mFullElevation = mQSPanel.getElevation();
    }

    @Override
@@ -85,7 +84,7 @@ public class QSContainerImpl extends FrameLayout {
    @Override
    protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
        super.onLayout(changed, left, top, right, bottom);
        updateBottom();
        updateExpansion();
    }

    /**
@@ -96,27 +95,47 @@ public class QSContainerImpl extends FrameLayout {
     */
    public void setHeightOverride(int heightOverride) {
        mHeightOverride = heightOverride;
        updateBottom();
        updateExpansion();
    }

    public void updateBottom() {
    public void updateExpansion() {
        int height = calculateContainerHeight();
        setBottom(getTop() + height + mGutterHeight);
        int gutterHeight = Math.round(mQsExpansion * mGutterHeight);
        setBottom(getTop() + height + gutterHeight);
        mQSDetail.setBottom(getTop() + height);
        mBackground.setBottom(mQSDetail.getBottom());
        mBackground.setBottom(getTop() + height);
        // Pin QS Footer to the bottom of the panel.
        mQSFooter.setTranslationY(height - mQSFooter.getHeight());

        float elevation = mQsExpansion * mFullElevation;
        mQSDetail.setElevation(elevation);
        mBackground.setElevation(elevation);
        mQSFooter.setElevation(elevation);
        mQSPanel.setElevation(elevation);
    }

    protected int calculateContainerHeight() {
        int heightOverride = mHeightOverride != -1 ? mHeightOverride : getMeasuredHeight();
        return mQSCustomizer.isCustomizing() ? mQSCustomizer.getHeight()
                : (int) (mQsExpansion * (heightOverride - mHeader.getHeight()))
                : Math.round(mQsExpansion * (heightOverride - mHeader.getHeight()))
                + mHeader.getHeight();
    }

    public void setExpansion(float expansion) {
        mQsExpansion = expansion;
        updateBottom();
        updateExpansion();
    }

    public void setGutterEnabled(boolean gutterEnabled) {
        if (gutterEnabled == (mGutterHeight != 0)) {
            return;
        }
        if (gutterEnabled) {
            mGutterHeight = getContext().getResources().getDimensionPixelSize(
                    R.dimen.qs_gutter_height);
        } else {
            mGutterHeight = 0;
        }
        updateExpansion();
    }
}
+1 −0
Original line number Diff line number Diff line
@@ -235,6 +235,7 @@ public class QSFooter extends FrameLayout implements
        }

        TouchAnimator.Builder animatorBuilder = new TouchAnimator.Builder();
        animatorBuilder.setStartDelay(QSAnimator.EXPANDED_TILE_DELAY);

        if (mShowEditIcon) {
            animatorBuilder.addFloat(mEdit, "alpha", 0, 1);
Loading