From ac5027dbf882ec37977ff20b6361c880caf21e21 Mon Sep 17 00:00:00 2001 From: Pat Manning Date: Tue, 25 Mar 2025 14:01:10 +0000 Subject: [PATCH] Account for Recents Scale when computing dismiss length to take task off screen. Fix: 406213321 Test: Manual. Flag: com.android.launcher3.enable_expressive_dismiss_task_motion Change-Id: If0e79fc58a1f094071b98587e3f57af4af64c524 --- .../TaskViewDismissTouchController.kt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewDismissTouchController.kt b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewDismissTouchController.kt index 06e6734a37..3c22c22ff3 100644 --- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewDismissTouchController.kt +++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewDismissTouchController.kt @@ -37,6 +37,7 @@ import com.android.quickstep.views.RecentsViewContainer import com.android.quickstep.views.TaskView import com.google.android.msdl.data.model.MSDLToken import kotlin.math.abs +import kotlin.math.ceil /** Touch controller for handling task view card dismiss swipes */ class TaskViewDismissTouchController( @@ -135,12 +136,16 @@ CONTAINER : RecentsViewContainer { container.dragLayer ) // Dismiss length as bottom of task so it is fully off screen when dismissed. + // Take into account the recents scale when fully zoomed out on dismiss. it.getThumbnailBounds(tempTaskThumbnailBounds, relativeToDragLayer = true) dismissLength = - recentsView.pagedOrientationHandler.getTaskDismissLength( - secondaryLayerDimension, - tempTaskThumbnailBounds, - ) + ceil( + recentsView.pagedOrientationHandler.getTaskDismissLength( + secondaryLayerDimension, + tempTaskThumbnailBounds, + ) / RECENTS_SCALE_ON_DISMISS_SUCCESS + ) + .toInt() verticalFactor = recentsView.pagedOrientationHandler.getTaskDismissVerticalDirection() }