File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
packages/SystemUI/src/com/android/systemui/recent Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments