Avoid unnecessary onLayout if gesture is going to state without overview panel

Fixes: 186508379
Test: swipe up to carousel, then to home
Test: quick switch, immediately swipe up to overview, then to home
Change-Id: I0b28e163cbb289a636a89bc52c43a1977a59d86f
This commit is contained in:
Alex Chau
2021-08-24 12:36:27 +01:00
parent 19a616f268
commit 96ffcbcd2d

View File

@@ -3314,9 +3314,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
// If we're going to HOME, avoid unnecessary onLayout that cause TaskViews to re-arrange
// during animation to HOME.
if (mCurrentGestureEndTarget == GestureState.GestureEndTarget.HOME) {
// If we're going to a state without overview panel, avoid unnecessary onLayout that
// cause TaskViews to re-arrange during animation to that state.
if (!mOverviewStateEnabled && !mFirstLayout) {
return;
}