diff --git a/quickstep/src/com/android/quickstep/views/RecentsView.java b/quickstep/src/com/android/quickstep/views/RecentsView.java index aa25738eb2..2d346f2177 100644 --- a/quickstep/src/com/android/quickstep/views/RecentsView.java +++ b/quickstep/src/com/android/quickstep/views/RecentsView.java @@ -3943,8 +3943,10 @@ public abstract class RecentsView< newClearAllShortTotalWidthTranslation = expectedFirstTaskStart - firstTaskStart; } } - if (lastGridTaskView != null && (isTaskViewVisible(lastGridTaskView) || ( - isExpressiveDismiss && lastGridTaskView == dismissedTaskView))) { + if (lastGridTaskView != null && ( + (!isExpressiveDismiss && lastGridTaskView.isVisibleToUser()) || (isExpressiveDismiss + && (isTaskViewVisible(lastGridTaskView) + || lastGridTaskView == dismissedTaskView)))) { // After dismissal, animate translation of the remaining tasks to fill any gap left // between the end of the grid and the clear all button. Only animate if the clear // all button is visible or would become visible after dismissal.