From 1352b0748886d5056c8fbadaa3ff28f7669c55e7 Mon Sep 17 00:00:00 2001 From: Nicolo' Mazzucato Date: Fri, 1 Apr 2022 13:49:52 +0200 Subject: [PATCH] Revert logic to calculate StackEndHeight This partially reverts the logic to compute the stackEndHeight, as it doesn't make the shelf stick at the bottom when scrolling notifications. This might reintroduce the bug of trimmed notifications on lockscreen, that will be addressed in another cl. Bug: 227733494 Bug: 214504318 Fixes: 226054279 Test: Test: atest ShelfInvisibleWithLowNotifications && atest ShelfVisibleAtTheBottom Change-Id: I20286eb961d46439a0d80980c085a41b93241cb8 --- .../stack/NotificationStackScrollLayout.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index 32d37d18f407..8a64a0d71204 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -1315,14 +1315,15 @@ public class NotificationStackScrollLayout extends ViewGroup implements Dumpable if (mOnStackYChanged != null) { mOnStackYChanged.accept(listenerNeedsAnimation); } - if ((mQsExpansionFraction <= 0 || !mQsFullScreen) && !shouldSkipHeightUpdate()) { - final float endHeight = updateStackEndHeight(); + if (mQsExpansionFraction <= 0 && !shouldSkipHeightUpdate()) { + final float endHeight = updateStackEndHeight( + getHeight(), getEmptyBottomMargin(), mTopPadding); updateStackHeight(endHeight, fraction); } } - private float updateStackEndHeight() { - final float stackEndHeight = Math.max(0f, mIntrinsicContentHeight); + private float updateStackEndHeight(float height, float bottomMargin, float topPadding) { + final float stackEndHeight = Math.max(0f, height - bottomMargin - topPadding); mAmbientState.setStackEndHeight(stackEndHeight); return stackEndHeight; }