Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fc65cb0 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix TaskViewTouchController success progress to match haptic" into...

Merge "Fix TaskViewTouchController success progress to match haptic" into ub-launcher3-rvc-qpr-dev am: b460ff1e

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/12321076

Change-Id: Ic4317b94cca7d760d23da0c1c115d422236586e7
parents c830bef9 b460ff1e
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.view.MotionEvent;
import android.view.View;
import android.view.animation.Interpolator;

import com.android.launcher3.AbstractFloatingView;
import com.android.launcher3.BaseDraggingActivity;
@@ -205,14 +206,19 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity>
        long maxDuration = 2 * secondaryLayerDimension;
        int verticalFactor = orientationHandler.getTaskDragDisplacementFactor(mIsRtl);
        int secondaryTaskDimension = orientationHandler.getSecondaryDimension(mTaskBeingDragged);
        // The interpolator controlling the most prominent visual movement. We use this to determine
        // whether we passed SUCCESS_TRANSITION_PROGRESS.
        final Interpolator currentInterpolator;
        if (goingUp) {
            currentInterpolator = Interpolators.LINEAR;
            mPendingAnimation = mRecentsView.createTaskDismissAnimation(mTaskBeingDragged,
                    true /* animateTaskView */, true /* removeTask */, maxDuration);

            mEndDisplacement = -secondaryTaskDimension;
        } else {
            currentInterpolator = Interpolators.ZOOM_IN;
            mPendingAnimation = mRecentsView.createTaskLaunchAnimation(
                    mTaskBeingDragged, maxDuration, Interpolators.ZOOM_IN);
                    mTaskBeingDragged, maxDuration, currentInterpolator);

            // Since the thumbnail is what is filling the screen, based the end displacement on it.
            View thumbnailView = mTaskBeingDragged.getThumbnail();
@@ -227,6 +233,9 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity>
        }
        mCurrentAnimation = mPendingAnimation.createPlaybackController()
                .setOnCancelRunnable(this::clearState);
        // Setting this interpolator doesn't affect the visual motion, but is used to determine
        // whether we successfully reached the target state in onDragEnd().
        mCurrentAnimation.getTarget().setInterpolator(currentInterpolator);
        onUserControlledAnimationCreated(mCurrentAnimation);
        mCurrentAnimation.getTarget().addListener(this);
        mCurrentAnimation.dispatchOnStart();