From 66440cfc05ed9ac1f3773f09416f30aba6a9ef56 Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Fri, 26 May 2017 13:48:47 -0700 Subject: [PATCH] Fixed an issue where the shade would jump When collapsing directly from the expanded quicksettings the shade would jump when there were no notifications. Test: manual Change-Id: I9a85cd57e2f96970ad4ea78a8c679145b58d563a Fixes: 35996906 --- .../systemui/statusbar/stack/NotificationStackScrollLayout.java | 5 +++-- 1 file changed, 3 insertions(+), 2 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 d0ff0502d987..edb6b9b848bd 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -817,7 +817,8 @@ public class NotificationStackScrollLayout extends ViewGroup */ private float getAppearEndPosition() { int appearPosition; - if (mEmptyShadeView.getVisibility() == GONE) { + int notGoneChildCount = getNotGoneChildCount(); + if (mEmptyShadeView.getVisibility() == GONE && notGoneChildCount != 0) { int minNotificationsForShelf = 1; if (mTrackingHeadsUp || mHeadsUpManager.hasPinnedHeadsUp()) { appearPosition = mHeadsUpManager.getTopHeadsUpPinnedHeight(); @@ -825,7 +826,7 @@ public class NotificationStackScrollLayout extends ViewGroup } else { appearPosition = 0; } - if (getNotGoneChildCount() >= minNotificationsForShelf + if (notGoneChildCount >= minNotificationsForShelf && mShelf.getVisibility() != GONE) { appearPosition += mShelf.getIntrinsicHeight(); } -- 2.11.0