Merge "Update dismiss length for tasks to bring them off screen." into main
This commit is contained in:
commit
059bba075b
4 files changed
+28
-4
No files matched your search
+5
-1
@@ -16,6 +16,7 @@
|
||||
package com.android.launcher3.uioverrides.touchcontrollers
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Rect
|
||||
import android.view.MotionEvent
|
||||
import androidx.dynamicanimation.animation.SpringAnimation
|
||||
import com.android.app.animation.Interpolators.DECELERATE
|
||||
@@ -52,6 +53,7 @@ CONTAINER : RecentsViewContainer {
|
||||
recentsView.pagedOrientationHandler.upDownSwipeDirection,
|
||||
)
|
||||
private val isRtl = isRtl(container.resources)
|
||||
private val tempTaskThumbnailBounds = Rect()
|
||||
|
||||
private var taskBeingDragged: TaskView? = null
|
||||
private var springAnimation: SpringAnimation? = null
|
||||
@@ -112,7 +114,9 @@ CONTAINER : RecentsViewContainer {
|
||||
recentsView.isTaskViewVisible(it) && container.dragLayer.isEventOverView(it, ev)
|
||||
}
|
||||
?.also {
|
||||
dismissLength = recentsView.pagedOrientationHandler.getSecondaryDimension(it)
|
||||
// Dismiss length as bottom of task so it is fully off screen when dismissed.
|
||||
it.getThumbnailBounds(tempTaskThumbnailBounds, relativeToDragLayer = true)
|
||||
dismissLength = tempTaskThumbnailBounds.bottom
|
||||
verticalFactor =
|
||||
recentsView.pagedOrientationHandler.secondaryTranslationDirectionFactor
|
||||
}
|
||||
|
||||
@@ -336,8 +336,6 @@ class RecentsViewUtils(private val recentsView: RecentsView<*, *>) {
|
||||
.setStartVelocity(if (detector.isFling(velocity)) velocity else 0f)
|
||||
.addUpdateListener { animation, value, _ ->
|
||||
if (isDismissing && abs(value) >= abs(dismissLength)) {
|
||||
// TODO(b/393553524): Remove 0 alpha, instead animate task fully off screen.
|
||||
draggedTaskView.alpha = 0f
|
||||
animation.cancel()
|
||||
} else if (draggedTaskView.isRunningTask && recentsView.enableDrawingLiveTile) {
|
||||
recentsView.runActionOnRemoteHandles { remoteTargetHandle ->
|
||||
|
||||
Reference in new issue
Block a user