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

Commit 238693ee authored by Lyn Han's avatar Lyn Han Committed by Automerger Merge Worker
Browse files

Merge "Fix fickle footer visibility" into sc-dev am: ab2dd817

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

Change-Id: Ic26b1762c3b7b288c7b95f0a2677c7f71c8e05e5
parents d9641ba9 ab2dd817
Loading
Loading
Loading
Loading
+7 −3
Original line number Original line Diff line number Diff line
@@ -664,7 +664,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            mDebugPaint.setColor(Color.CYAN);
            mDebugPaint.setColor(Color.CYAN);
            canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
            canvas.drawLine(0, y, getWidth(), y, mDebugPaint);


            y = (int) (mAmbientState.getStackY() + mSidePaddings + mAmbientState.getStackHeight());
            y = (int) (mAmbientState.getStackY() + mAmbientState.getStackHeight());
            mDebugPaint.setColor(Color.BLUE);
            mDebugPaint.setColor(Color.BLUE);
            canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
            canvas.drawLine(0, y, getWidth(), y, mDebugPaint);
        }
        }
@@ -1151,7 +1151,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
        if (mQsExpansionFraction <= 0) {
        if (mQsExpansionFraction <= 0) {
            final float scrimTopPadding = mAmbientState.isOnKeyguard() ? 0 : mSidePaddings;
            final float scrimTopPadding = mAmbientState.isOnKeyguard() ? 0 : mSidePaddings;
            final float stackEndHeight = Math.max(0f,
            final float stackEndHeight = Math.max(0f,
                    getHeight() - getEmptyBottomMargin() - stackY - scrimTopPadding);
                    getHeight() - getEmptyBottomMargin() - stackY);
            mAmbientState.setStackEndHeight(stackEndHeight);
            mAmbientState.setStackEndHeight(stackEndHeight);
            mAmbientState.setStackHeight(
            mAmbientState.setStackHeight(
                    MathUtils.lerp(stackEndHeight * StackScrollAlgorithm.START_FRACTION,
                    MathUtils.lerp(stackEndHeight * StackScrollAlgorithm.START_FRACTION,
@@ -2068,18 +2068,22 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable


    @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
    @ShadeViewRefactor(RefactorComponent.STATE_RESOLVER)
    private void updateContentHeight() {
    private void updateContentHeight() {
        int height = 0;
        final float scrimTopPadding = mAmbientState.isOnKeyguard() ? 0 : mSidePaddings;
        int height = (int) scrimTopPadding;
        float previousPaddingRequest = mPaddingBetweenElements;
        float previousPaddingRequest = mPaddingBetweenElements;
        int numShownItems = 0;
        int numShownItems = 0;
        int numShownNotifs = 0;
        int numShownNotifs = 0;
        boolean finish = false;
        boolean finish = false;
        int maxDisplayedNotifications = mMaxDisplayedNotifications;
        int maxDisplayedNotifications = mMaxDisplayedNotifications;
        ExpandableView previousView = null;
        ExpandableView previousView = null;

        for (int i = 0; i < getChildCount(); i++) {
        for (int i = 0; i < getChildCount(); i++) {
            ExpandableView expandableView = (ExpandableView) getChildAt(i);
            ExpandableView expandableView = (ExpandableView) getChildAt(i);
            boolean footerViewOnLockScreen = expandableView == mFooterView && onKeyguard();
            boolean footerViewOnLockScreen = expandableView == mFooterView && onKeyguard();

            if (expandableView.getVisibility() != View.GONE
            if (expandableView.getVisibility() != View.GONE
                    && !expandableView.hasNoContentHeight() && !footerViewOnLockScreen) {
                    && !expandableView.hasNoContentHeight() && !footerViewOnLockScreen) {

                boolean limitReached = maxDisplayedNotifications != -1
                boolean limitReached = maxDisplayedNotifications != -1
                        && numShownNotifs >= maxDisplayedNotifications;
                        && numShownNotifs >= maxDisplayedNotifications;
                final float viewHeight;
                final float viewHeight;