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

Commit b89445a6 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed the clipping of the keyguard status bar during drag down

It wasn't clipped at all, but now it is.

Bug: 184946919
Test: drag down on lockscreen, observe no cliping
Change-Id: I13ad278898d76bdd364bbfb3c7e8d599b21bcdae
parent 48f51861
Loading
Loading
Loading
Loading
+27 −0
Original line number Diff line number Diff line
@@ -116,6 +116,12 @@ public class KeyguardStatusBarView extends RelativeLayout implements
    // right and left padding applied to this view to account for cutouts and rounded corners
    private Pair<Integer, Integer> mPadding = new Pair(0, 0);

    /**
     * The clipping on the top
     */
    private int mTopClipping;
    private final Rect mClipRect = new Rect(0, 0, 0, 0);

    public KeyguardStatusBarView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mUserManager = UserManager.get(getContext());
@@ -549,4 +555,25 @@ public class KeyguardStatusBarView extends RelativeLayout implements
    public void onSystemChromeAnimationUpdate(ValueAnimator anim) {
        mSystemIconsContainer.setAlpha((float) anim.getAnimatedValue());
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        super.onLayout(changed, l, t, r, b);
        updateClipping();
    }

    /**
     * Set the clipping on the top of the view.
     */
    public void setTopClipping(int topClipping) {
        if (topClipping != mTopClipping) {
            mTopClipping = topClipping;
            updateClipping();
        }
    }

    private void updateClipping() {
        mClipRect.set(0, mTopClipping, getWidth(), getHeight());
        setClipBounds(mClipRect);
    }
}
+3 −0
Original line number Diff line number Diff line
@@ -2235,6 +2235,7 @@ public class NotificationPanelViewController extends PanelViewController {
            boolean visible) {
        // Fancy clipping for quick settings
        int radius = mScrimCornerRadius;
        int statusBarClipTop = 0;
        if (!mShouldUseSplitNotificationShade) {
            // The padding on this area is large enough that we can use a cheaper clipping strategy
            mKeyguardStatusAreaClipBounds.set(left, top, right, bottom);
@@ -2242,12 +2243,14 @@ public class NotificationPanelViewController extends PanelViewController {
                    ? mKeyguardStatusAreaClipBounds : null);
            radius = (int) MathUtils.lerp(mScreenCornerRadius, mScrimCornerRadius,
                    Math.min(top / (float) mScrimCornerRadius, 1f));
            statusBarClipTop = top - mKeyguardStatusBar.getTop();
        }
        if (mQs != null) {
            mQs.setFancyClipping(top, bottom, radius, visible);
        }
        mScrimController.setNotificationsBounds(left, top, right, bottom);
        mScrimController.setScrimCornerRadius(radius);
        mKeyguardStatusBar.setTopClipping(statusBarClipTop);
    }

    private float getQSEdgePosition() {