OSDN Git Service

Fixed an issue where the shade would jump
authorSelim Cinek <cinek@google.com>
Fri, 26 May 2017 20:48:47 +0000 (13:48 -0700)
committerSelim Cinek <cinek@google.com>
Wed, 31 May 2017 21:09:50 +0000 (14:09 -0700)
When collapsing directly from the expanded quicksettings
the shade would jump when there were no notifications.

Test: manual
Change-Id: I9a85cd57e2f96970ad4ea78a8c679145b58d563a
Fixes: 35996906

packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java

index d0ff050..edb6b9b 100644 (file)
@@ -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();
             }