Handle cancelled All Apps transitions.

Previously if this was cancelled mid-animation, the background
panel could get stuck on the screen.

To reproduce this consistently, I automatically cancelled the
animation 50ms after it started. Here's how that looked:
 - Before: https://drive.google.com/file/d/1tiW7mFehk3of-qYe1_HBZSmJLjU4VVmv/view?usp=drive_link&resourcekey=0-tH7YccjcNuXe8qKaL_8H2w
 - After: https://drive.google.com/file/d/1XpRy8FusaSZkJTGa7FHhUuqMUHkeI_UA/view?usp=drive_link&resourcekey=0-gvoyXE3puv7lW78kgKLEng

Fix: 383731295
Test: Manual
Flag: EXEMPT bugfix
Change-Id: I9423b75800a002419a56a3fe3f93b2e7350aeaa0
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index 8554de5..4cc31d2 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -34,6 +34,7 @@
 import static com.android.launcher3.util.SystemUiController.UI_STATE_ALL_APPS;
 
 import android.animation.Animator;
+import android.animation.AnimatorListenerAdapter;
 import android.animation.ObjectAnimator;
 import android.util.FloatProperty;
 import android.view.HapticFeedbackConstants;
@@ -365,6 +366,12 @@
         Interpolator verticalProgressInterpolator = config.getInterpolator(ANIM_VERTICAL_PROGRESS,
                 config.isUserControlled() ? LINEAR : DECELERATE_1_7);
         Animator anim = createSpringAnimation(mProgress, targetProgress);
+        anim.addListener(new AnimatorListenerAdapter() {
+            @Override
+            public void onAnimationCancel(Animator animation) {
+                setProgress(targetProgress);
+            }
+        });
         anim.setInterpolator(verticalProgressInterpolator);
         builder.add(anim);