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

Commit 40fdc4ac authored by Roman Birg's avatar Roman Birg
Browse files

SystemUI: various qs tile detail improvements



- Handle top padding inside QSDragPanel, so the detail clipping animation
doesn't get cut off by the top padding.

- Increase bottom padding of the QSContainer to give some more
breathing room for the circle page indicator.

- Disable pager overscrolling

- Add dual tile carrot indicators to cast, dnd, and mobile data tiles

Change-Id: I81f56760140a2d7dd31e25b23f477eb1be0af305
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 6ec9ea72
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -19,8 +19,7 @@
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@drawable/qs_background_primary"
        android:paddingTop="8dp"
        android:paddingBottom="8dp"
        android:paddingBottom="12dp"
        android:elevation="2dp">

    <com.android.systemui.qs.QSDragPanel
+1 −1
Original line number Diff line number Diff line
@@ -63,7 +63,7 @@ public class QSContainer extends FrameLayout {
     */
    public int getDesiredHeight() {
        if (mQSPanel.isClosingDetail()) {
            return mQSPanel.getGridHeight() + getPaddingTop() + getPaddingBottom();
            return mQSPanel.getGridHeight() + getPaddingBottom();
        } else {
            return getMeasuredHeight();
        }
+4 −0
Original line number Diff line number Diff line
@@ -36,6 +36,10 @@ public class QSDetailClipper {
        mBackground = (TransitionDrawable) detail.getBackground();
    }

    public boolean isAnimating() {
        return mAnimator != null && mAnimator.isRunning();
    }

    public void animateCircularClip(int x, int y, boolean in, AnimatorListener listener) {
        if (mAnimator != null) {
            mAnimator.cancel();
+29 −6
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.util.Log;
import android.util.TypedValue;
import android.view.DragEvent;
import android.view.LayoutInflater;
import android.view.View;
@@ -177,7 +176,6 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
            }
        };
        mViewPager.setAdapter(mPagerAdapter);
        mViewPager.setCurrentItem(0);

        mPageIndicator.setViewPager(mViewPager);
        mPageIndicator.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@@ -212,15 +210,22 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On

            }
        });
        mPageIndicator.setCurrentItem(0);
        mViewPager.setOverScrollMode(OVER_SCROLL_NEVER);

        setClipChildren(false);
        updateResources();

        mViewPager.setOnDragListener(this);
        mPageIndicator.setOnDragListener(this);
        mQsPanelTop.getBrightnessView().setOnDragListener(this);
        mQsPanelTop.getDropTarget().setOnDragListener(this);
    }

    @Override
    public boolean hasOverlappingRendering() {
        return mClipper.isAnimating();
    }

    protected void drawTile(TileRecord r, QSTile.State state) {
        final int visibility = state.visible || mEditing ? VISIBLE : GONE;
        setTileVisibility(r.tileView, visibility);
@@ -474,7 +479,8 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
        mPageIndicator.measure(exactly(width), MeasureSpec.UNSPECIFIED);
        mFooter.getView().measure(exactly(width), MeasureSpec.UNSPECIFIED);

        int h = mQsPanelTop.getMeasuredHeight()
        int h = mBrightnessPaddingTop
                + mQsPanelTop.getMeasuredHeight()
                + mViewPager.getMeasuredHeight()
                + mPageIndicator.getMeasuredHeight();
        if (mFooter.hasFooter()) {
@@ -501,12 +507,30 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
        return MeasureSpec.makeMeasureSpec(size, MeasureSpec.EXACTLY);
    }

    @Override
    protected void handleShowDetailTile(TileRecord r, boolean show) {
        if (r instanceof DragTileRecord) {
            if ((mDetailRecord != null) == show && mDetailRecord == r) return;

            if (show) {
                r.detailAdapter = r.tile.getDetailAdapter();
                if (r.detailAdapter == null) return;
            }
            r.tile.setDetailListening(show);
            int x = (int) ((DragTileRecord) r).destination.x + r.tileView.getWidth() / 2;
            int y = mViewPager.getTop() + (int) ((DragTileRecord) r).destination.y + r.tileView.getHeight() / 2;
            handleShowDetailImpl(r, show, x, y);
        } else {
            super.handleShowDetailTile(r, show);
        }
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        if (DEBUG_DRAG) Log.d(TAG, "onLayout()");
        final int w = getWidth();

        int top = 0;
        int top = mBrightnessPaddingTop;
        mQsPanelTop.layout(0, top, w, top + mQsPanelTop.getMeasuredHeight());
        top += mQsPanelTop.getMeasuredHeight();

@@ -517,7 +541,6 @@ public class QSDragPanel extends QSPanel implements View.OnDragListener, View.On
        mPageIndicator.layout(0, top, w, top + mPageIndicator.getMeasuredHeight());

        // detail takes up whole height
        final int dh = Math.max(mDetail.getMeasuredHeight(), mViewPager.getMeasuredHeight());
        mDetail.layout(0, 0, mDetail.getMeasuredWidth(), getMeasuredHeight());

        if (mFooter.hasFooter()) {
+5 −0
Original line number Diff line number Diff line
@@ -33,6 +33,11 @@ public class QSPage extends ViewGroup {
        setClipToOutline(false);
    }

    @Override
    public boolean hasOverlappingRendering() {
        return false;
    }

    public int getPageIndex() {
        return mPage;
    }
Loading