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

Commit ab2dd817 authored by Lyn Han's avatar Lyn Han Committed by Android (Google) Code Review
Browse files

Merge "Fix fickle footer visibility" into sc-dev

parents 0a78fe6d 8cadb0bf
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -664,7 +664,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable
            mDebugPaint.setColor(Color.CYAN);
            canvas.drawLine(0, y, getWidth(), y, mDebugPaint);

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

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

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

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

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