diff options
author | Michael Jurka <mikejurka@google.com> | 2012-10-02 12:22:12 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-02 12:22:13 -0700 |
commit | 141efcb5b633f76056260f6763652270931853f3 (patch) | |
tree | d7d76ea70589dff37a79c25b2d33ab5904c93023 | |
parent | 87d7d94673512c9572fa62c2842ce20bc87bf8b9 (diff) | |
parent | 9a0890c109b6c861e6ed7f76e123e5999c4acf5a (diff) | |
download | frameworks_base-141efcb5b633f76056260f6763652270931853f3.zip frameworks_base-141efcb5b633f76056260f6763652270931853f3.tar.gz frameworks_base-141efcb5b633f76056260f6763652270931853f3.tar.bz2 |
Merge "Fix jump cut when dismissing items in Recents" into jb-mr1-dev
-rw-r--r-- | packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java index a0f197d..5e0df49 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java @@ -165,19 +165,18 @@ public class RecentsVerticalScrollView extends ScrollView } setLayoutTransition(transitioner); - // Scroll to end after layout. - final ViewTreeObserver observer = getViewTreeObserver(); - + // Scroll to end after initial layout. final OnGlobalLayoutListener updateScroll = new OnGlobalLayoutListener() { public void onGlobalLayout() { mLastScrollPosition = scrollPositionOfMostRecent(); scrollTo(0, mLastScrollPosition); + final ViewTreeObserver observer = getViewTreeObserver(); if (observer.isAlive()) { observer.removeOnGlobalLayoutListener(this); } } }; - observer.addOnGlobalLayoutListener(updateScroll); + getViewTreeObserver().addOnGlobalLayoutListener(updateScroll); } @Override |