Loading quickstep/src/com/android/quickstep/util/RecentsViewUtils.kt +3 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,9 @@ class RecentsViewUtils { fun getLargeTaskViewIds(taskViews: Iterable<TaskView>): List<Int> = taskViews.filter { it.isLargeTile }.map { it.taskViewId } /** Counts [TaskView]s that are large tiles. */ fun getLargeTileCount(taskViews: Iterable<TaskView>): Int = taskViews.count { it.isLargeTile } /** * Returns the first TaskView that should be displayed as a large tile. * Loading quickstep/src/com/android/quickstep/views/RecentsView.java +12 −4 Original line number Diff line number Diff line Loading @@ -3669,8 +3669,8 @@ public abstract class RecentsView< float longGridRowWidthDiff = 0; int topGridRowSize = mTopRowIdSet.size(); int bottomGridRowSize = taskCount - mTopRowIdSet.size() - (enableGridOnlyOverview() ? 0 : 1); int numLargeTiles = mUtils.getLargeTileCount(getTaskViews()); int bottomGridRowSize = taskCount - mTopRowIdSet.size() - numLargeTiles; boolean topRowLonger = topGridRowSize > bottomGridRowSize; boolean bottomRowLonger = bottomGridRowSize > topGridRowSize; boolean dismissedTaskFromTop = mTopRowIdSet.contains(dismissedTaskViewId); Loading Loading @@ -3969,12 +3969,12 @@ public abstract class RecentsView< final boolean finalCloseGapBetweenClearAll = closeGapBetweenClearAll; final boolean finalSnapToLastTask = snapToLastTask; final boolean finalIsFocusedTaskDismissed = isFocusedTaskDismissed; mPendingAnimation.addEndListener(new Consumer<Boolean>() { mPendingAnimation.addEndListener(new Consumer<>() { @Override public void accept(Boolean success) { if (mEnableDrawingLiveTile && dismissedTaskView.isRunningTask() && success) { finishRecentsAnimation(true /* toRecents */, false /* shouldPip */, () -> onEnd(success)); () -> onEnd(true)); } else { onEnd(success); } Loading Loading @@ -4144,6 +4144,14 @@ public abstract class RecentsView< // If snapping to last task, find the last task after dismissal. pageToSnapTo = indexOfChild( getLastGridTaskView(topRowIdArray, bottomRowIdArray)); if (pageToSnapTo == INVALID_PAGE) { // Snap to latest large tile page after dismissing the // last grid task. This will prevent snapping to page 0 when // desktop task is visible as large tile. pageToSnapTo = indexOfChild( mUtils.getLastLargeTaskView(getTaskViews())); } } else if (taskViewIdToSnapTo != -1) { // If snapping to another page due to indices rearranging, find // the new index after dismissal & rearrange using the task view id. Loading Loading
quickstep/src/com/android/quickstep/util/RecentsViewUtils.kt +3 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,9 @@ class RecentsViewUtils { fun getLargeTaskViewIds(taskViews: Iterable<TaskView>): List<Int> = taskViews.filter { it.isLargeTile }.map { it.taskViewId } /** Counts [TaskView]s that are large tiles. */ fun getLargeTileCount(taskViews: Iterable<TaskView>): Int = taskViews.count { it.isLargeTile } /** * Returns the first TaskView that should be displayed as a large tile. * Loading
quickstep/src/com/android/quickstep/views/RecentsView.java +12 −4 Original line number Diff line number Diff line Loading @@ -3669,8 +3669,8 @@ public abstract class RecentsView< float longGridRowWidthDiff = 0; int topGridRowSize = mTopRowIdSet.size(); int bottomGridRowSize = taskCount - mTopRowIdSet.size() - (enableGridOnlyOverview() ? 0 : 1); int numLargeTiles = mUtils.getLargeTileCount(getTaskViews()); int bottomGridRowSize = taskCount - mTopRowIdSet.size() - numLargeTiles; boolean topRowLonger = topGridRowSize > bottomGridRowSize; boolean bottomRowLonger = bottomGridRowSize > topGridRowSize; boolean dismissedTaskFromTop = mTopRowIdSet.contains(dismissedTaskViewId); Loading Loading @@ -3969,12 +3969,12 @@ public abstract class RecentsView< final boolean finalCloseGapBetweenClearAll = closeGapBetweenClearAll; final boolean finalSnapToLastTask = snapToLastTask; final boolean finalIsFocusedTaskDismissed = isFocusedTaskDismissed; mPendingAnimation.addEndListener(new Consumer<Boolean>() { mPendingAnimation.addEndListener(new Consumer<>() { @Override public void accept(Boolean success) { if (mEnableDrawingLiveTile && dismissedTaskView.isRunningTask() && success) { finishRecentsAnimation(true /* toRecents */, false /* shouldPip */, () -> onEnd(success)); () -> onEnd(true)); } else { onEnd(success); } Loading Loading @@ -4144,6 +4144,14 @@ public abstract class RecentsView< // If snapping to last task, find the last task after dismissal. pageToSnapTo = indexOfChild( getLastGridTaskView(topRowIdArray, bottomRowIdArray)); if (pageToSnapTo == INVALID_PAGE) { // Snap to latest large tile page after dismissing the // last grid task. This will prevent snapping to page 0 when // desktop task is visible as large tile. pageToSnapTo = indexOfChild( mUtils.getLastLargeTaskView(getTaskViews())); } } else if (taskViewIdToSnapTo != -1) { // If snapping to another page due to indices rearranging, find // the new index after dismissal & rearrange using the task view id. Loading