From b24e0a90fde332b102c9787f590a94900467340c Mon Sep 17 00:00:00 2001 From: Selim Cinek Date: Tue, 9 Jun 2015 20:17:30 -0700 Subject: [PATCH] Reseting scrollposition to 0 when going to keyguard This avoids some jank when going to the keyguard from the locked shade. Change-Id: I21dcd8a7cbb2aa98659061d29670b2663f1e7fc9 --- .../systemui/statusbar/phone/NotificationPanelView.java | 1 + .../statusbar/stack/NotificationStackScrollLayout.java | 5 +++++ 2 files changed, 6 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 39dc4808f51db..fe1e85dbaf3ae 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -482,6 +482,7 @@ public class NotificationPanelView extends PanelView implements mStatusBar.dismissPopups(); mNotificationStackScroller.setOverScrollAmount(0f, true /* onTop */, false /* animate */, true /* cancelAnimators */); + mNotificationStackScroller.resetScrollPosition(); } public void closeQs() { 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 6e0c85cba3890..f11a878e0fae8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/stack/NotificationStackScrollLayout.java @@ -2230,6 +2230,11 @@ public class NotificationStackScrollLayout extends ViewGroup } } + public void resetScrollPosition() { + mScroller.abortAnimation(); + mOwnScrollY = 0; + } + private void setIsExpanded(boolean isExpanded) { boolean changed = isExpanded != mIsExpanded; mIsExpanded = isExpanded;