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

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

[flexiglass] Update ScrollViewFields#intrinsicStackHeight on the LS

Update ScrollViewFields#intrinsicStackHeight to the restricted stack height,
when we are on the LockScreen. Stop using NSSL.mIntrinsicContentHeight,
when flexiglass is enabled.

Bug: 296118689
Test: atest NotificationStackScrollLayoutTest
Flag: com.android.systemui.scene_container
Change-Id: I7bd162f018e502ceb1d40ce9b48a644666b89fea
parent aae95605
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -1574,7 +1574,7 @@ public class NotificationStackScrollLayout
        if (mMaxDisplayedNotifications != -1) {
            // The stack intrinsic height already contains the correct value when there is a limit
            // in the max number of notifications (e.g. as in keyguard).
            height = mIntrinsicContentHeight;
            height = mScrollViewFields.getIntrinsicStackHeight();
        } else {
            height = Math.max(0f, mAmbientState.getStackCutoff() - mAmbientState.getStackTop());
        }
@@ -2610,7 +2610,7 @@ public class NotificationStackScrollLayout
    }

    @VisibleForTesting
    void updateStackHeight() {
    void updateIntrinsicStackHeight() {
        if (SceneContainerFlag.isUnexpectedlyInLegacyMode()) return;

        final int shelfIntrinsicHeight = mShelf != null ? mShelf.getIntrinsicHeight() : 0;
@@ -2621,8 +2621,11 @@ public class NotificationStackScrollLayout
                mMaxDisplayedNotifications,
                shelfIntrinsicHeight
        );
        mIntrinsicContentHeight = notificationsHeight;
        final int fullStackHeight = notificationsHeight + footerIntrinsicHeight + mBottomPadding;
        // When there is a limit in the max number of notifications, we never display the footer.
        final int fullStackHeight = mMaxDisplayedNotifications != -1
                ? notificationsHeight
                : notificationsHeight + footerIntrinsicHeight + mBottomPadding;

        if (mScrollViewFields.getIntrinsicStackHeight() != fullStackHeight) {
            mScrollViewFields.setIntrinsicStackHeight(fullStackHeight);
            notifyStackHeightChangedListeners();
@@ -2631,7 +2634,7 @@ public class NotificationStackScrollLayout

    private void updateContentHeight() {
        if (SceneContainerFlag.isEnabled()) {
            updateStackHeight();
            updateIntrinsicStackHeight();
            return;
        }

+1 −1
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ public class NotificationStackScrollLayoutTest extends SysuiTestCase {
        when(mStackSizeCalculator.computeHeight(eq(mStackScroller), anyInt(), anyFloat()))
                .thenReturn((float) stackHeight);

        mStackScroller.updateStackHeight();
        mStackScroller.updateIntrinsicStackHeight();

        assertThat(mStackScroller.getIntrinsicStackHeight()).isEqualTo(stackHeight);
    }