diff options
| author | 2020-06-23 00:52:50 +0000 | |
|---|---|---|
| committer | 2020-06-23 00:52:50 +0000 | |
| commit | 8b9d2ed3ac1cd5415d75b0adb218e9f84e190e28 (patch) | |
| tree | 547ad46ad76089a175ac25823e3f9ec3fb7e1425 | |
| parent | 5dc36b2f9d7150b1c417898ca77e49c020b90657 (diff) | |
| parent | d313871d151dbca4e202bc994bfe3887d16acb7d (diff) | |
Merge "Adjusted the expand animation to be smooth again" into rvc-dev
3 files changed, 12 insertions, 8 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java index bf32f5b63a46..b9d31a93f408 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/stack/NotificationStackScrollLayout.java @@ -535,6 +535,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd private float mLastSentAppear; private float mLastSentExpandedHeight; private boolean mWillExpand; + private int mGapHeight; private int mWaterfallTopInset; @@ -1060,6 +1061,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd Resources res = context.getResources(); mCollapsedSize = res.getDimensionPixelSize(R.dimen.notification_min_height); + mGapHeight = res.getDimensionPixelSize(R.dimen.notification_section_divider_height); mStackScrollAlgorithm.initView(context); mAmbientState.reload(context); mPaddingBetweenElements = Math.max(1, @@ -5099,8 +5101,10 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) - public int getFooterViewHeight() { - return mFooterView == null ? 0 : mFooterView.getHeight() + mPaddingBetweenElements; + public int getFooterViewHeightWithPadding() { + return mFooterView == null ? 0 : mFooterView.getHeight() + + mPaddingBetweenElements + + mGapHeight; } @ShadeViewRefactor(RefactorComponent.SHADE_VIEW) diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java index e720d820fd76..0b664e68b426 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelViewController.java @@ -2397,8 +2397,8 @@ public class NotificationPanelViewController extends PanelViewController { } @Override - protected int getClearAllHeight() { - return mNotificationStackScroller.getFooterViewHeight(); + protected int getClearAllHeightWithPadding() { + return mNotificationStackScroller.getFooterViewHeightWithPadding(); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java index a902e1b0c960..caddc4a874f4 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PanelViewController.java @@ -537,9 +537,9 @@ public abstract class PanelViewController { // the animation only to the last notification, and then jump to the maximum panel height so // clear all just fades in and the decelerating motion is towards the last notification. final boolean clearAllExpandHack = expand && - shouldExpandToTopOfClearAll(getMaxPanelHeight() - getClearAllHeight()); + shouldExpandToTopOfClearAll(getMaxPanelHeight() - getClearAllHeightWithPadding()); if (clearAllExpandHack) { - target = getMaxPanelHeight() - getClearAllHeight(); + target = getMaxPanelHeight() - getClearAllHeightWithPadding(); } if (target == mExpandedHeight || getOverExpansionAmount() > 0f && expand) { notifyExpandingFinished(); @@ -1030,9 +1030,9 @@ public abstract class PanelViewController { protected abstract boolean isClearAllVisible(); /** - * @return the height of the clear all button, in pixels + * @return the height of the clear all button, in pixels including padding */ - protected abstract int getClearAllHeight(); + protected abstract int getClearAllHeightWithPadding(); public void setHeadsUpManager(HeadsUpManagerPhone headsUpManager) { mHeadsUpManager = headsUpManager; |