From 0cce70c9faf64171c466ec8441b0ca026f6a2703 Mon Sep 17 00:00:00 2001 From: Jorim Jaggi Date: Tue, 4 Nov 2014 16:13:41 +0100 Subject: [PATCH] Fix jump in two-finger expand motion with no notifications Bug: 18185048 Change-Id: Ib54789e45b7b68a5fc9d6056cb53de23b2be3260 --- .../statusbar/phone/NotificationPanelView.java | 10 ++++++++++ .../statusbar/stack/NotificationStackScrollLayout.java | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index d9e44c30c7a67..50775427fab90 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -1329,6 +1329,16 @@ public class NotificationPanelView extends PanelView implements float notificationHeight = mNotificationStackScroller.getHeight() - mNotificationStackScroller.getEmptyBottomMargin() - mNotificationStackScroller.getTopPadding(); + + // When only empty shade view is visible in QS collapsed state, simulate that we would have + // it in expanded QS state as well so we don't run into troubles when fading the view in/out + // and expanding/collapsing the whole panel from/to quick settings. + if (mNotificationStackScroller.getNotGoneChildCount() == 0 + && mShadeEmpty) { + notificationHeight = mNotificationStackScroller.getEmptyShadeViewHeight() + + mNotificationStackScroller.getBottomStackPeekSize() + + mNotificationStackScroller.getCollapseSecondCardPadding(); + } float totalHeight = Math.max( mQsMaxExpansionHeight + mNotificationStackScroller.getNotificationTopPadding(), mClockPositionResult.stackScrollerPadding - mTopPaddingAdjustment) 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 87ce565d5da0e..d543cff178058 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -2272,6 +2272,10 @@ public class NotificationStackScrollLayout extends ViewGroup return height; } + public int getEmptyShadeViewHeight() { + return mEmptyShadeView.getHeight(); + } + public float getBottomMostNotificationBottom() { final int count = getChildCount(); float max = 0;