Fix jump in app launch when quick switching from Home

This change addresses a recent regression that caused quick switch to not scale up to full screen during the launch animation.

Fix: 326625526
Test: Launch quick switch from home and ensure it is a smooth transition
Flag: N/A
Change-Id: Id94d5d3eae0625225f880897e1e5f3cf9e4fea6c
diff --git a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
index b7a907f..a92e77a 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/touchcontrollers/NoButtonQuickSwitchTouchController.java
@@ -324,12 +324,12 @@
 
     @Override
     public void onDragEnd(PointF velocity) {
+        cancelAnimations();
         boolean horizontalFling = mSwipeDetector.isFling(velocity.x);
         boolean verticalFling = mSwipeDetector.isFling(velocity.y);
         boolean noFling = !horizontalFling && !verticalFling;
         if (mMotionPauseDetector.isPaused() && noFling) {
             // Going to Overview.
-            cancelAnimations();
             InteractionJankMonitorWrapper.cancel(Cuj.CUJ_LAUNCHER_QUICK_SWITCH);
 
             StateAnimationConfig config = new StateAnimationConfig();
@@ -455,7 +455,6 @@
         nonOverviewAnim.setDuration(Math.max(xDuration, yDuration));
         mNonOverviewAnim.setEndAction(() -> onAnimationToStateCompleted(targetState));
 
-        cancelAnimations();
         xOverviewAnim.start();
         yOverviewAnim.start();
         nonOverviewAnim.start();