From aa417dac584607d9ee704b5ccaef706227f5af91 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Thu, 27 Oct 2016 18:17:08 -0700 Subject: [PATCH] Fixed the lockscreen positon with a single notificaton The notification was wrongly pushed up on the lockscreen if there was only a single notification. Test: Add a single notification, observe that it's not pushed in. Bug: 32437839 Change-Id: Ica6275d0efb18a0a39d943e874d464a86593d5b3 --- .../stack/NotificationStackScrollLayout.java | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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); } /**