Skip to content

Commit fb4a113

Browse files
mikejurkaAndroid (Google) Code Review
authored andcommitted
Merge "Fix jump cut when dismissing items in Recents" into jb-mr1-dev
2 parents 0944d62 + 841594b commit fb4a113

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,19 @@ public boolean onLongClick(View v) {
156156
}
157157
setLayoutTransition(transitioner);
158158

159-
// Scroll to end after layout.
160-
final ViewTreeObserver observer = getViewTreeObserver();
159+
// Scroll to end after initial layout.
161160

162161
final OnGlobalLayoutListener updateScroll = new OnGlobalLayoutListener() {
163162
public void onGlobalLayout() {
164163
mLastScrollPosition = scrollPositionOfMostRecent();
165164
scrollTo(mLastScrollPosition, 0);
165+
final ViewTreeObserver observer = getViewTreeObserver();
166166
if (observer.isAlive()) {
167167
observer.removeOnGlobalLayoutListener(this);
168168
}
169169
}
170170
};
171-
observer.addOnGlobalLayoutListener(updateScroll);
171+
getViewTreeObserver().addOnGlobalLayoutListener(updateScroll);
172172
}
173173

174174
@Override

0 commit comments

Comments
 (0)