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

Commit cca6684f authored by András Kurucz's avatar András Kurucz
Browse files

[flexiglass] Remove double footer height from the stack height

Bug: 380210512
Test: check the bottom padding of the stack in dual shade
	- empty shade (no notifications)
	- few notifications (not enough to have a full height shade)
	- lots of notifications (enough to scroll the shade)
	- check in the shade
	- check in locked shade
	- check in the lockscreen
Flag: com.android.systemui.scene_container
Change-Id: I016c0ace9cee5fae24e12b8149050dc054b8190a
parent 0246da22
Loading
Loading
Loading
Loading
+4 −11
Original line number Original line Diff line number Diff line
@@ -866,9 +866,9 @@ public class NotificationStackScrollLayout
            y = (int) mAmbientState.getHeadsUpTop();
            y = (int) mAmbientState.getHeadsUpTop();
            drawDebugInfo(canvas, y, Color.GREEN, /* label= */ "getHeadsUpTop() = " + y);
            drawDebugInfo(canvas, y, Color.GREEN, /* label= */ "getHeadsUpTop() = " + y);


            y += getTopHeadsUpHeight();
            y = (int) (mAmbientState.getStackTop() + mScrollViewFields.getIntrinsicStackHeight());
            drawDebugInfo(canvas, y, Color.BLUE,
            drawDebugInfo(canvas, y, Color.BLUE,
                    /* label= */ "getHeadsUpTop() + getTopHeadsUpHeight() = " + y);
                    /* label= */ "getStackTop() + getIntrinsicStackHeight() = " + y);


            return; // the rest of the fields are not important in Flexiglass
            return; // the rest of the fields are not important in Flexiglass
        }
        }
@@ -2612,20 +2612,13 @@ public class NotificationStackScrollLayout
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;


        final int shelfIntrinsicHeight = mShelf != null ? mShelf.getIntrinsicHeight() : 0;
        final int shelfIntrinsicHeight = mShelf != null ? mShelf.getIntrinsicHeight() : 0;
        final int footerIntrinsicHeight =
                mFooterView != null ? mFooterView.getIntrinsicHeight() : 0;
        final int notificationsHeight = (int) mNotificationStackSizeCalculator.computeHeight(
        final int notificationsHeight = (int) mNotificationStackSizeCalculator.computeHeight(
                /* notificationStackScrollLayout= */ this,
                /* notificationStackScrollLayout= */ this,
                mMaxDisplayedNotifications,
                mMaxDisplayedNotifications,
                shelfIntrinsicHeight
                shelfIntrinsicHeight
        );
        );
        // When there is a limit in the max number of notifications, we never display the footer.
        if (mScrollViewFields.getIntrinsicStackHeight() != notificationsHeight) {
        final int fullStackHeight = mMaxDisplayedNotifications != -1
            mScrollViewFields.setIntrinsicStackHeight(notificationsHeight);
                ? notificationsHeight
                : notificationsHeight + footerIntrinsicHeight + mBottomPadding;

        if (mScrollViewFields.getIntrinsicStackHeight() != fullStackHeight) {
            mScrollViewFields.setIntrinsicStackHeight(fullStackHeight);
            notifyStackHeightChangedListeners();
            notifyStackHeightChangedListeners();
        }
        }
    }
    }