Merge "Remove focus task" into tm-qpr-dev am: 019f8a640a am: 110007f68e am: 4d95ac8c7e

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20980936

Change-Id: Ib71c06e3db0a5d5fb7ee68dc60421928e67aee95
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Alex Chau
2023-02-25 13:07:44 +00:00
committed by Automerger Merge Worker
10 changed files with 82 additions and 58 deletions
@@ -677,7 +677,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
@Override @Override
public void onMotionPauseDetected() { public void onMotionPauseDetected() {
mHasMotionEverBeenPaused = true; mHasMotionEverBeenPaused = true;
maybeUpdateRecentsAttachedState(true/* animate */, true/* moveFocusedTask */); maybeUpdateRecentsAttachedState(true/* animate */, true/* moveRunningTask */);
Optional.ofNullable(mActivityInterface.getTaskbarController()) Optional.ofNullable(mActivityInterface.getTaskbarController())
.ifPresent(TaskbarUIController::startTranslationSpring); .ifPresent(TaskbarUIController::startTranslationSpring);
performHapticFeedback(); performHapticFeedback();
@@ -695,7 +695,7 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
} }
private void maybeUpdateRecentsAttachedState(boolean animate) { private void maybeUpdateRecentsAttachedState(boolean animate) {
maybeUpdateRecentsAttachedState(animate, false /* moveFocusedTask */); maybeUpdateRecentsAttachedState(animate, false /* moveRunningTask */);
} }
/** /**
@@ -705,9 +705,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
* *
* Note this method has no effect unless the navigation mode is NO_BUTTON. * Note this method has no effect unless the navigation mode is NO_BUTTON.
* @param animate whether to animate when attaching RecentsView * @param animate whether to animate when attaching RecentsView
* @param moveFocusedTask whether to move focused task to front when attaching * @param moveRunningTask whether to move running task to front when attaching
*/ */
private void maybeUpdateRecentsAttachedState(boolean animate, boolean moveFocusedTask) { private void maybeUpdateRecentsAttachedState(boolean animate, boolean moveRunningTask) {
if (!mDeviceState.isFullyGesturalNavMode() || mRecentsView == null) { if (!mDeviceState.isFullyGesturalNavMode() || mRecentsView == null) {
return; return;
} }
@@ -726,11 +726,11 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
} else { } else {
recentsAttachedToAppWindow = mHasMotionEverBeenPaused || mIsLikelyToStartNewTask; recentsAttachedToAppWindow = mHasMotionEverBeenPaused || mIsLikelyToStartNewTask;
} }
if (moveFocusedTask && !mAnimationFactory.hasRecentsEverAttachedToAppWindow() if (moveRunningTask && !mAnimationFactory.hasRecentsEverAttachedToAppWindow()
&& recentsAttachedToAppWindow) { && recentsAttachedToAppWindow) {
// Only move focused task if RecentsView has never been attached before, to avoid // Only move running task if RecentsView has never been attached before, to avoid
// TaskView jumping to new position as we move the tasks. // TaskView jumping to new position as we move the tasks.
mRecentsView.moveFocusedTaskToFront(); mRecentsView.moveRunningTaskToFront();
} }
mAnimationFactory.setRecentsAttachedToAppWindow(recentsAttachedToAppWindow, animate); mAnimationFactory.setRecentsAttachedToAppWindow(recentsAttachedToAppWindow, animate);
@@ -231,17 +231,20 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
/** /**
* Calculates the taskView size for the provided device configuration. * Calculates the taskView size for the provided device configuration.
*/ */
public final void calculateTaskSize(Context context, DeviceProfile dp, Rect outRect) { public final void calculateTaskSize(Context context, DeviceProfile dp, Rect outRect,
Resources res = context.getResources(); PagedOrientationHandler orientedState) {
float maxScale = res.getFloat(R.dimen.overview_max_scale);
if (dp.isTablet) { if (dp.isTablet) {
Rect gridRect = new Rect(); if (FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW.get()) {
calculateGridSize(dp, gridRect); calculateGridTaskSize(context, dp, outRect, orientedState);
} else {
calculateTaskSizeInternal(context, dp, gridRect, maxScale, Gravity.CENTER, outRect); calculateFocusTaskSize(context, dp, outRect);
}
} else { } else {
Resources res = context.getResources();
float maxScale = res.getFloat(R.dimen.overview_max_scale);
int taskMargin = dp.overviewTaskMarginPx; int taskMargin = dp.overviewTaskMarginPx;
calculateTaskSizeInternal(context, dp, calculateTaskSizeInternal(
dp,
dp.overviewTaskThumbnailTopMarginPx, dp.overviewTaskThumbnailTopMarginPx,
dp.getOverviewActionsClaimedSpace(), dp.getOverviewActionsClaimedSpace(),
res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin, res.getDimensionPixelSize(R.dimen.overview_minimum_next_prev_size) + taskMargin,
@@ -251,7 +254,15 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
} }
} }
private void calculateTaskSizeInternal(Context context, DeviceProfile dp, int claimedSpaceAbove, private void calculateFocusTaskSize(Context context, DeviceProfile dp, Rect outRect) {
Resources res = context.getResources();
float maxScale = res.getFloat(R.dimen.overview_max_scale);
Rect gridRect = new Rect();
calculateGridSize(dp, gridRect);
calculateTaskSizeInternal(dp, gridRect, maxScale, Gravity.CENTER, outRect);
}
private void calculateTaskSizeInternal(DeviceProfile dp, int claimedSpaceAbove,
int claimedSpaceBelow, int minimumHorizontalPadding, float maxScale, int gravity, int claimedSpaceBelow, int minimumHorizontalPadding, float maxScale, int gravity,
Rect outRect) { Rect outRect) {
Rect insets = dp.getInsets(); Rect insets = dp.getInsets();
@@ -264,10 +275,10 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
minimumHorizontalPadding, minimumHorizontalPadding,
claimedSpaceBelow); claimedSpaceBelow);
calculateTaskSizeInternal(context, dp, potentialTaskRect, maxScale, gravity, outRect); calculateTaskSizeInternal(dp, potentialTaskRect, maxScale, gravity, outRect);
} }
private void calculateTaskSizeInternal(Context context, DeviceProfile dp, private void calculateTaskSizeInternal(DeviceProfile dp,
Rect potentialTaskRect, float maxScale, int gravity, Rect outRect) { Rect potentialTaskRect, float maxScale, int gravity, Rect outRect) {
PointF taskDimension = getTaskDimension(dp); PointF taskDimension = getTaskDimension(dp);
@@ -318,12 +329,15 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
public final void calculateGridTaskSize(Context context, DeviceProfile dp, Rect outRect, public final void calculateGridTaskSize(Context context, DeviceProfile dp, Rect outRect,
PagedOrientationHandler orientedState) { PagedOrientationHandler orientedState) {
Resources res = context.getResources(); Resources res = context.getResources();
Rect taskRect = new Rect(); Rect potentialTaskRect = new Rect();
calculateTaskSize(context, dp, taskRect); if (FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW.get()) {
calculateGridSize(dp, potentialTaskRect);
} else {
calculateFocusTaskSize(context, dp, potentialTaskRect);
}
float rowHeight = float rowHeight = (potentialTaskRect.height() + dp.overviewTaskThumbnailTopMarginPx
(taskRect.height() + dp.overviewTaskThumbnailTopMarginPx - dp.overviewRowSpacing) - dp.overviewRowSpacing) / 2f;
/ 2f;
PointF taskDimension = getTaskDimension(dp); PointF taskDimension = getTaskDimension(dp);
float scale = (rowHeight - dp.overviewTaskThumbnailTopMarginPx) / taskDimension.y; float scale = (rowHeight - dp.overviewTaskThumbnailTopMarginPx) / taskDimension.y;
@@ -332,14 +346,15 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
int gravity = Gravity.TOP; int gravity = Gravity.TOP;
gravity |= orientedState.getRecentsRtlSetting(res) ? Gravity.RIGHT : Gravity.LEFT; gravity |= orientedState.getRecentsRtlSetting(res) ? Gravity.RIGHT : Gravity.LEFT;
Gravity.apply(gravity, outWidth, outHeight, taskRect, outRect); Gravity.apply(gravity, outWidth, outHeight, potentialTaskRect, outRect);
} }
/** /**
* Calculates the modal taskView size for the provided device configuration * Calculates the modal taskView size for the provided device configuration
*/ */
public final void calculateModalTaskSize(Context context, DeviceProfile dp, Rect outRect) { public final void calculateModalTaskSize(Context context, DeviceProfile dp, Rect outRect,
calculateTaskSize(context, dp, outRect); PagedOrientationHandler orientedState) {
calculateTaskSize(context, dp, outRect, orientedState);
boolean isGridOnlyOverview = dp.isTablet && FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW.get(); boolean isGridOnlyOverview = dp.isTablet && FeatureFlags.ENABLE_GRID_ONLY_OVERVIEW.get();
int claimedSpaceBelow = isGridOnlyOverview int claimedSpaceBelow = isGridOnlyOverview
? dp.overviewActionsTopMarginPx + dp.overviewActionsHeight + dp.stashedTaskbarSize ? dp.overviewActionsTopMarginPx + dp.overviewActionsHeight + dp.stashedTaskbarSize
@@ -351,7 +366,7 @@ public abstract class BaseActivityInterface<STATE_TYPE extends BaseState<STATE_T
Math.round((dp.availableWidthPx - outRect.width() * maxScale) / 2); Math.round((dp.availableWidthPx - outRect.width() * maxScale) / 2);
} }
calculateTaskSizeInternal( calculateTaskSizeInternal(
context, dp, dp,
dp.overviewTaskMarginPx, dp.overviewTaskMarginPx,
claimedSpaceBelow, claimedSpaceBelow,
minimumHorizontalPadding, minimumHorizontalPadding,
@@ -61,7 +61,7 @@ public final class FallbackActivityInterface extends
@Override @Override
public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect, public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect,
PagedOrientationHandler orientationHandler) { PagedOrientationHandler orientationHandler) {
calculateTaskSize(context, dp, outRect); calculateTaskSize(context, dp, outRect, orientationHandler);
if (dp.isVerticalBarLayout() && DisplayController.getNavigationMode(context) != NO_BUTTON) { if (dp.isVerticalBarLayout() && DisplayController.getNavigationMode(context) != NO_BUTTON) {
return dp.isSeascape() ? outRect.left : (dp.widthPx - outRect.right); return dp.isSeascape() ? outRect.left : (dp.widthPx - outRect.right);
} else { } else {
@@ -18,7 +18,6 @@ package com.android.quickstep;
import static com.android.launcher3.LauncherState.BACKGROUND_APP; import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.LauncherState.NORMAL; import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
import static com.android.launcher3.anim.Interpolators.LINEAR; import static com.android.launcher3.anim.Interpolators.LINEAR;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
@@ -73,7 +72,7 @@ public final class LauncherActivityInterface extends
@Override @Override
public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect, public int getSwipeUpDestinationAndLength(DeviceProfile dp, Context context, Rect outRect,
PagedOrientationHandler orientationHandler) { PagedOrientationHandler orientationHandler) {
calculateTaskSize(context, dp, outRect); calculateTaskSize(context, dp, outRect, orientationHandler);
if (dp.isVerticalBarLayout() if (dp.isVerticalBarLayout()
&& DisplayController.getNavigationMode(context) != NavigationMode.NO_BUTTON) { && DisplayController.getNavigationMode(context) != NavigationMode.NO_BUTTON) {
return dp.isSeascape() ? outRect.left : (dp.widthPx - outRect.right); return dp.isSeascape() ? outRect.left : (dp.widthPx - outRect.right);
@@ -284,7 +284,7 @@ public class OverviewCommandHelper {
RecentsView<?, ?> visibleRecentsView = activityInterface.getVisibleRecentsView(); RecentsView<?, ?> visibleRecentsView = activityInterface.getVisibleRecentsView();
if (visibleRecentsView != null) { if (visibleRecentsView != null) {
visibleRecentsView.moveFocusedTaskToFront(); visibleRecentsView.moveRunningTaskToFront();
} }
if (mTaskAnimationManager.isRecentsAnimationRunning()) { if (mTaskAnimationManager.isRecentsAnimationRunning()) {
cmd.mActiveCallbacks = mTaskAnimationManager.continueRecentsAnimation(gestureState); cmd.mActiveCallbacks = mTaskAnimationManager.continueRecentsAnimation(gestureState);
@@ -59,7 +59,7 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
} }
Rect focusedTaskRect = new Rect(); Rect focusedTaskRect = new Rect();
LauncherActivityInterface.INSTANCE.calculateTaskSize(mContext, mDeviceProfile, LauncherActivityInterface.INSTANCE.calculateTaskSize(mContext, mDeviceProfile,
focusedTaskRect); focusedTaskRect, PagedOrientationHandler.PORTRAIT);
response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, focusedTaskRect.height()); response.putInt(TestProtocol.TEST_INFO_RESPONSE_FIELD, focusedTaskRect.height());
return response; return response;
} }
@@ -158,7 +158,8 @@ public class AnimatorControllerWithResistance {
Rect startRect = new Rect(); Rect startRect = new Rect();
PagedOrientationHandler orientationHandler = params.recentsOrientedState PagedOrientationHandler orientationHandler = params.recentsOrientedState
.getOrientationHandler(); .getOrientationHandler();
LauncherActivityInterface.INSTANCE.calculateTaskSize(params.context, params.dp, startRect); LauncherActivityInterface.INSTANCE.calculateTaskSize(params.context, params.dp, startRect,
orientationHandler);
long distanceToCover = startRect.bottom; long distanceToCover = startRect.bottom;
PendingAnimation resistAnim = params.resistAnim != null PendingAnimation resistAnim = params.resistAnim != null
? params.resistAnim ? params.resistAnim
@@ -43,7 +43,8 @@ public class LayoutUtils {
PagedOrientationHandler orientationHandler) { PagedOrientationHandler orientationHandler) {
// Track the bottom of the window. // Track the bottom of the window.
Rect taskSize = new Rect(); Rect taskSize = new Rect();
LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize); LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize,
orientationHandler);
return orientationHandler.getDistanceToBottomOfRect(dp, taskSize); return orientationHandler.getDistanceToBottomOfRect(dp, taskSize);
} }
@@ -157,7 +157,8 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy {
mSizeStrategy.calculateGridTaskSize(mContext, mDp, mTaskRect, mSizeStrategy.calculateGridTaskSize(mContext, mDp, mTaskRect,
mOrientationState.getOrientationHandler()); mOrientationState.getOrientationHandler());
} else { } else {
mSizeStrategy.calculateTaskSize(mContext, mDp, mTaskRect); mSizeStrategy.calculateTaskSize(mContext, mDp, mTaskRect,
mOrientationState.getOrientationHandler());
} }
Rect fullTaskSize; Rect fullTaskSize;
@@ -1480,20 +1480,20 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
} }
/** /**
* Moves the focused task to the front of the carousel in tablets, to minimize animation * Moves the running task to the front of the carousel in tablets, to minimize animation
* required to focus the task in grid. * required to move the running task in grid.
*/ */
public void moveFocusedTaskToFront() { public void moveRunningTaskToFront() {
if (!mActivity.getDeviceProfile().isTablet) { if (!mActivity.getDeviceProfile().isTablet) {
return; return;
} }
TaskView focusedTaskView = getFocusedTaskView(); TaskView runningTaskView = getRunningTaskView();
if (focusedTaskView == null) { if (runningTaskView == null) {
return; return;
} }
if (indexOfChild(focusedTaskView) != mCurrentPage) { if (indexOfChild(runningTaskView) != mCurrentPage) {
return; return;
} }
@@ -1505,20 +1505,20 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
int currentPageScroll = getScrollForPage(mCurrentPage); int currentPageScroll = getScrollForPage(mCurrentPage);
mCurrentPageScrollDiff = primaryScroll - currentPageScroll; mCurrentPageScrollDiff = primaryScroll - currentPageScroll;
mMovingTaskView = focusedTaskView; mMovingTaskView = runningTaskView;
removeView(focusedTaskView); removeView(runningTaskView);
mMovingTaskView = null; mMovingTaskView = null;
focusedTaskView.resetPersistentViewTransforms(); runningTaskView.resetPersistentViewTransforms();
int frontTaskIndex = 0; int frontTaskIndex = 0;
if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED && !focusedTaskView.isDesktopTask()) { if (DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED && !runningTaskView.isDesktopTask()) {
// If desktop mode is enabled, desktop task view is pinned at first position. // If desktop mode is enabled, desktop task view is pinned at first position.
// Move focused task to position 1 // Move running task to position 1
frontTaskIndex = 1; frontTaskIndex = 1;
} }
addView(focusedTaskView, frontTaskIndex); addView(runningTaskView, frontTaskIndex);
setCurrentPage(frontTaskIndex); setCurrentPage(frontTaskIndex);
updateGridProperties(); updateTaskSize();
} }
@Override @Override
@@ -1665,8 +1665,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
newFocusedTaskView = getTaskViewAt(1); newFocusedTaskView = getTaskViewAt(1);
} }
} }
mFocusedTaskViewId = mFocusedTaskViewId = newFocusedTaskView != null && !ENABLE_GRID_ONLY_OVERVIEW.get()
newFocusedTaskView != null ? newFocusedTaskView.getTaskViewId() : INVALID_TASK_ID; ? newFocusedTaskView.getTaskViewId() : INVALID_TASK_ID;
updateTaskSize(); updateTaskSize();
updateChildTaskOrientations(); updateChildTaskOrientations();
@@ -1781,7 +1781,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
* Returns the number of tasks in the bottom row of the overview grid. * Returns the number of tasks in the bottom row of the overview grid.
*/ */
public int getBottomRowTaskCountForTablet() { public int getBottomRowTaskCountForTablet() {
return getTaskViewCount() - mTopRowIdSet.size() - 1; return getTaskViewCount() - mTopRowIdSet.size() - (ENABLE_GRID_ONLY_OVERVIEW.get() ? 0 : 1);
} }
protected void onTaskStackUpdated() { protected void onTaskStackUpdated() {
@@ -1987,7 +1987,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
} }
public void getTaskSize(Rect outRect) { public void getTaskSize(Rect outRect) {
mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(), outRect); mSizeStrategy.calculateTaskSize(mActivity, mActivity.getDeviceProfile(), outRect,
mOrientationHandler);
mLastComputedTaskSize.set(outRect); mLastComputedTaskSize.set(outRect);
} }
@@ -2032,7 +2033,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
/** Gets the task size for modal state. */ /** Gets the task size for modal state. */
public void getModalTaskSize(Rect outRect) { public void getModalTaskSize(Rect outRect) {
mSizeStrategy.calculateModalTaskSize(mActivity, mActivity.getDeviceProfile(), outRect); mSizeStrategy.calculateModalTaskSize(mActivity, mActivity.getDeviceProfile(), outRect,
mOrientationHandler);
} }
@Override @Override
@@ -2574,7 +2576,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
boolean runningTaskTileHidden = mRunningTaskTileHidden; boolean runningTaskTileHidden = mRunningTaskTileHidden;
setCurrentTask(runningTaskViewId); setCurrentTask(runningTaskViewId);
mFocusedTaskViewId = runningTaskViewId; mFocusedTaskViewId = ENABLE_GRID_ONLY_OVERVIEW.get() ? INVALID_TASK_ID : runningTaskViewId;
runOnPageScrollsInitialized(() -> setCurrentPage(getRunningTaskIndex())); runOnPageScrollsInitialized(() -> setCurrentPage(getRunningTaskIndex()));
setRunningTaskViewShowScreenshot(false); setRunningTaskViewShowScreenshot(false);
setRunningTaskHidden(runningTaskTileHidden); setRunningTaskHidden(runningTaskTileHidden);
@@ -3263,7 +3265,8 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
float longGridRowWidthDiff = 0; float longGridRowWidthDiff = 0;
int topGridRowSize = mTopRowIdSet.size(); int topGridRowSize = mTopRowIdSet.size();
int bottomGridRowSize = taskCount - mTopRowIdSet.size() - 1; int bottomGridRowSize = taskCount - mTopRowIdSet.size()
- (ENABLE_GRID_ONLY_OVERVIEW.get() ? 0 : 1);
boolean topRowLonger = topGridRowSize > bottomGridRowSize; boolean topRowLonger = topGridRowSize > bottomGridRowSize;
boolean bottomRowLonger = bottomGridRowSize > topGridRowSize; boolean bottomRowLonger = bottomGridRowSize > topGridRowSize;
boolean dismissedTaskFromTop = mTopRowIdSet.contains(dismissedTaskViewId); boolean dismissedTaskFromTop = mTopRowIdSet.contains(dismissedTaskViewId);
@@ -3275,8 +3278,10 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
bottomGridRowSize--; bottomGridRowSize--;
} }
int longRowWidth = Math.max(topGridRowSize, bottomGridRowSize) int longRowWidth = Math.max(topGridRowSize, bottomGridRowSize)
* (mLastComputedGridTaskSize.width() + mPageSpacing) * (mLastComputedGridTaskSize.width() + mPageSpacing);
+ (isStagingFocusedTask ? 0 : mLastComputedTaskSize.width() + mPageSpacing); if (!ENABLE_GRID_ONLY_OVERVIEW.get() && !isStagingFocusedTask) {
longRowWidth += mLastComputedTaskSize.width() + mPageSpacing;
}
float gapWidth = 0; float gapWidth = 0;
if ((topRowLonger && dismissedTaskFromTop) if ((topRowLonger && dismissedTaskFromTop)
@@ -3683,7 +3688,9 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
} else { } else {
// Update focus task and its size. // Update focus task and its size.
if (finalIsFocusedTaskDismissed && finalNextFocusedTaskView != null) { if (finalIsFocusedTaskDismissed && finalNextFocusedTaskView != null) {
mFocusedTaskViewId = finalNextFocusedTaskView.getTaskViewId(); mFocusedTaskViewId = ENABLE_GRID_ONLY_OVERVIEW.get()
? INVALID_TASK_ID
: finalNextFocusedTaskView.getTaskViewId();
mTopRowIdSet.remove(mFocusedTaskViewId); mTopRowIdSet.remove(mFocusedTaskViewId);
finalNextFocusedTaskView.animateIconScaleAndDimIntoView(); finalNextFocusedTaskView.animateIconScaleAndDimIntoView();
} }