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() }