Skip to content

Commit 141efcb

Browse files
mikejurkaAndroid (Google) Code Review
authored andcommitted
Merge "Fix jump cut when dismissing items in Recents" into jb-mr1-dev
2 parents 87d7d94 + 9a0890c commit 141efcb

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/SystemUI/src/com/android/systemui/recent/RecentsVerticalScrollView.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,18 @@ public boolean onLongClick(View v) {
165165
}
166166
setLayoutTransition(transitioner);
167167

168-
// Scroll to end after layout.
169-
final ViewTreeObserver observer = getViewTreeObserver();
170-
168+
// Scroll to end after initial layout.
171169
final OnGlobalLayoutListener updateScroll = new OnGlobalLayoutListener() {
172170
public void onGlobalLayout() {
173171
mLastScrollPosition = scrollPositionOfMostRecent();
174172
scrollTo(0, mLastScrollPosition);
173+
final ViewTreeObserver observer = getViewTreeObserver();
175174
if (observer.isAlive()) {
176175
observer.removeOnGlobalLayoutListener(this);
177176
}
178177
}
179178
};
180-
observer.addOnGlobalLayoutListener(updateScroll);
179+
getViewTreeObserver().addOnGlobalLayoutListener(updateScroll);
181180
}
182181

183182
@Override

0 commit comments

Comments
 (0)