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)
committerandroid-build-team Robot <android-build-team-robot@google.com>
Thu, 1 Jun 2017 20:31:43 +0000 (20:31 +0000)
When collapsing directly from the expanded quicksettings
the shade would jump when there were no notifications.

Test: manual
Merged-In: I9a85cd57e2f96970ad4ea78a8c679145b58d563a
Change-Id: I9a85cd57e2f96970ad4ea78a8c679145b58d563a
Fixes: 35996906
(cherry picked from commit 7cb49d6f40955652950409b4feead43e58f68ca5)

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

index cd93b97..3cc3604 100644 (file)
@@ -815,7 +815,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();
@@ -823,7 +824,7 @@ public class NotificationStackScrollLayout extends ViewGroup
             } else {
                 appearPosition = 0;
             }
-            if (getNotGoneChildCount() >= minNotificationsForShelf) {
+            if (notGoneChildCount >= minNotificationsForShelf) {
                 appearPosition += mShelf.getIntrinsicHeight();
             }
         } else {