diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index 3aed7cc630..538e61e83e 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -125,6 +125,7 @@ import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.touch.OverScroll; import com.android.launcher3.touch.PagedOrientationHandler; import com.android.launcher3.util.DynamicResource; +import com.android.launcher3.util.IntArray; import com.android.launcher3.util.IntSet; import com.android.launcher3.util.MultiValueAlpha; import com.android.launcher3.util.ResourceBasedOverride.Overrides; @@ -2087,23 +2088,39 @@ public abstract class RecentsView startRebalanceAfter) { + mTopRowIdSet.remove(taskViewId); + isTopRow = topRowWidth <= bottomRowWidth; + } else { + isTopRow = mTopRowIdSet.contains(taskViewId); + } + } else { + isTopRow = topRowWidth <= bottomRowWidth; + } + if (isTopRow) { if (homeTaskView != null && nextFocusedTaskView == null) { // TaskView will be focused when swipe up, don't count towards row width. @@ -2677,9 +2706,44 @@ public abstract class RecentsView= screenEnd - mPageSpacing; + } + + if (shouldRebalance) { + updateGridProperties(/*isTaskDismissal=*/ true, + highestVisibleTaskIndex); + updateScrollSynchronously(); + } + } + setCurrentPage(pageToSnapTo); dispatchScrollChanged(); } @@ -2691,6 +2755,52 @@ public abstract class RecentsView ActivityManagerWrapper.getInstance().removeTask(dismissedTaskId),