summaryrefslogtreecommitdiffstats
path: root/packages/SystemUI/src/com/android/systemui/recent
diff options
context:
space:
mode:
Diffstat (limited to 'packages/SystemUI/src/com/android/systemui/recent')
-rw-r--r--packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
index 4aa2095..50b32f9 100644
--- a/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
+++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsHorizontalScrollView.java
@@ -156,19 +156,19 @@ public class RecentsHorizontalScrollView extends HorizontalScrollView
}
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(mLastScrollPosition, 0);
+ final ViewTreeObserver observer = getViewTreeObserver();
if (observer.isAlive()) {
observer.removeOnGlobalLayoutListener(this);
}
}
};
- observer.addOnGlobalLayoutListener(updateScroll);
+ getViewTreeObserver().addOnGlobalLayoutListener(updateScroll);
}
@Override