From 28b827b489bf327e47a87037994db6a0f42404d3 Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Wed, 19 Mar 2025 13:41:53 +0000 Subject: [PATCH] Add flag to gate checking last task visibility on dismiss. Bug: 404203362 Test: Manual. Open 9 apps, dismiss all bottom grid tasks, dismiss first top task, observe no jump. Flag: com.android.launcher3.enable_expressive_dismiss_task_motion Change-Id: Ie21d234f6a44c4566c4f73d4cc3c32f6a8375e6d --- quickstep/src/com/android/quickstep/views/RecentsView.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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.