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

Commit 95974d6a authored by Nick Chameyev's avatar Nick Chameyev Committed by Automerger Merge Worker
Browse files

Merge "Fix split shade issues when going from portrait expanded quick...

Merge "Fix split shade issues when going from portrait expanded quick settings" into tm-dev am: 0bad2dee

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17136516

Change-Id: I754c962343f419f4d8170c1460872244ba6a7538
parents 1b2e189b 0bad2dee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ public class ScrimDrawable extends Drawable {
            drawConcave(canvas);
        } else if (mCornerRadiusEnabled && mCornerRadius > 0) {
            canvas.drawRoundRect(getBounds().left, getBounds().top, getBounds().right,
                    getBounds().bottom + mCornerRadius,
                    getBounds().bottom,
                    /* x radius*/ mCornerRadius, /* y radius*/ mCornerRadius, mPaint);
        } else {
            canvas.drawRect(getBounds().left, getBounds().top, getBounds().right,
+6 −2
Original line number Diff line number Diff line
@@ -689,7 +689,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        boolean showFooterView = (showDismissView || mController.getVisibleNotificationCount() > 0)
                && mIsCurrentUserSetup  // see: b/193149550
                && mStatusBarState != StatusBarState.KEYGUARD
                && mQsExpansionFraction != 1
                // quick settings don't affect notifications when not in full screen
                && (mQsExpansionFraction != 1 || !mQsFullScreen)
                && !mScreenOffAnimationController.shouldHideNotificationsFooter()
                && !mIsRemoteInputActive;
        boolean showHistory = mController.isHistoryEnabled();
@@ -799,6 +800,9 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        y = (int) (mAmbientState.getStackY() + mKeyguardNotificationAvailableSpace);
        drawDebugInfo(canvas, y, Color.RED, /* label= */
                "mAmbientState.getStackY() + mKeyguardNotificationAvailableSpace = " + y);

        drawDebugInfo(canvas, mRoundedRectClippingBottom, Color.DKGRAY,
                /* label= */ "mRoundedRectClippingBottom) = " + y);
    }

    private void drawDebugInfo(Canvas canvas, int y, int color, String label) {
@@ -1311,7 +1315,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        if (mOnStackYChanged != null) {
            mOnStackYChanged.accept(listenerNeedsAnimation);
        }
        if (mQsExpansionFraction <= 0 && !shouldSkipHeightUpdate()) {
        if ((mQsExpansionFraction <= 0 || !mQsFullScreen) && !shouldSkipHeightUpdate()) {
            final float endHeight = updateStackEndHeight();
            updateStackHeight(endHeight, fraction);
        }
+13 −3
Original line number Diff line number Diff line
@@ -1098,6 +1098,8 @@ public class NotificationPanelViewController extends PanelViewController {

        if (splitNotificationShadeChanged) {
            updateClockAppearance();
            updateQsState();
            mNotificationStackScrollLayoutController.updateFooter();
        }
    }

@@ -2348,7 +2350,7 @@ public class NotificationPanelViewController extends PanelViewController {
    private int calculateBottomQsClippingBound(int top) {
        if (mShouldUseSplitNotificationShade) {
            return top + mNotificationStackScrollLayoutController.getHeight()
                    - mSplitShadeNotificationsScrimMarginBottom;
                    + mSplitShadeNotificationsScrimMarginBottom;
        } else {
            return getView().getBottom();
        }
@@ -2466,7 +2468,12 @@ public class NotificationPanelViewController extends PanelViewController {
            // be visible, otherwise you can see the bounds once swiping up to see bouncer
            mScrimController.setNotificationsBounds(0, 0, 0, 0);
        } else {
            mScrimController.setNotificationsBounds(left, top, right, bottom);
            // Increase the height of the notifications scrim when not in split shade
            // (e.g. portrait tablet) so the rounded corners are not visible at the bottom,
            // in this case they are rendered off-screen
            final int notificationsScrimBottom =
                    mShouldUseSplitNotificationShade ? bottom : bottom + radius;
            mScrimController.setNotificationsBounds(left, top, right, notificationsScrimBottom);
        }

        if (mShouldUseSplitNotificationShade) {
@@ -2476,10 +2483,13 @@ public class NotificationPanelViewController extends PanelViewController {
        }

        mScrimController.setScrimCornerRadius(radius);

        // Convert global clipping coordinates to local ones,
        // relative to NotificationStackScrollLayout
        int nsslLeft = left - mNotificationStackScrollLayoutController.getLeft();
        int nsslRight = right - mNotificationStackScrollLayoutController.getLeft();
        int nsslTop = top - mNotificationStackScrollLayoutController.getTop();
        int nsslBottom = bottom;
        int nsslBottom = bottom - mNotificationStackScrollLayoutController.getTop();
        int bottomRadius = mShouldUseSplitNotificationShade ? radius : 0;
        mNotificationStackScrollLayoutController.setRoundedClippingBounds(
                nsslLeft, nsslTop, nsslRight, nsslBottom, radius, bottomRadius);