diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java index 2208f78045d07..1a6e492723c90 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -769,11 +769,17 @@ public class NotificationStackScrollLayout extends ViewGroup * Measured in absolute height. */ private float getAppearEndPosition() { - int firstItemHeight = mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp() - ? mHeadsUpManager.getTopHeadsUpPinnedHeight() + mBottomStackPeekSize - + mBottomStackSlowDownHeight - : getFirstItemMinHeight() + mShelf.getIntrinsicHeight(); - return firstItemHeight + (onKeyguard() ? mTopPadding : mIntrinsicPadding); + int appearPosition; + if (mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp()) { + appearPosition = mHeadsUpManager.getTopHeadsUpPinnedHeight() + mBottomStackPeekSize + + mBottomStackSlowDownHeight; + } else { + appearPosition = getFirstItemMinHeight(); + if (mAmbientState.getShelfIndex() > 1) { + appearPosition += mShelf.getIntrinsicHeight(); + } + } + return appearPosition + (onKeyguard() ? mTopPadding : mIntrinsicPadding); } /**