From 0bbdf3a9fd96c5813a620377c6b640d89b1745dd Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Thu, 16 Apr 2020 22:42:51 -0500 Subject: [PATCH] When dragging down on task, base end displacement on thumbnail TaskView height has a lot of other factors such as icon margin and actions. Since the thumbnail is what we are dragging to fill the screen, use its height to determine the progress factor. Test: swipe down on a task in portrait, landscape, and seascape, and verify that it follows your finger to the bottom of the screen. Swiping up also follows your finger for dimiss. Bug: 151770407 Change-Id: I114a261a06b11f550822178945266cc4a6fd54fe --- .../touchcontrollers/TaskViewTouchController.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java index 1b3610a92d..f6f892b44b 100644 --- a/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java +++ b/quickstep/recents_ui_overrides/src/com/android/launcher3/uioverrides/touchcontrollers/TaskViewTouchController.java @@ -24,6 +24,7 @@ import static com.android.launcher3.touch.SingleAxisSwipeDetector.DIRECTION_POSI import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.view.MotionEvent; +import android.view.View; import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BaseDraggingActivity; @@ -209,9 +210,11 @@ public abstract class TaskViewTouchController mPendingAnimation = mRecentsView.createTaskLaunchAnimation( mTaskBeingDragged, maxDuration, Interpolators.ZOOM_IN); - mTempCords[1] = mTaskBeingDragged.getHeight(); - dl.getDescendantCoordRelativeToSelf(mTaskBeingDragged, mTempCords); - mEndDisplacement = dl.getHeight() - mTempCords[1]; + // Since the thumbnail is what is filling the screen, based the end displacement on it. + View thumbnailView = mTaskBeingDragged.getThumbnail(); + mTempCords[1] = orientationHandler.getSecondaryDimension(thumbnailView); + dl.getDescendantCoordRelativeToSelf(thumbnailView, mTempCords); + mEndDisplacement = secondaryLayerDimension - mTempCords[1]; } mEndDisplacement *= verticalFactor;