Merge "Fix a couple issues with swiping up from home" into ub-launcher3-edmonton
diff --git a/quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java b/quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java
index 54ecb28..987f952 100644
--- a/quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java
+++ b/quickstep/src/com/android/launcher3/uioverrides/PortraitStatesTouchController.java
@@ -189,14 +189,8 @@
             if (isFling && expectedDuration != 0) {
                 // Update all apps interpolator to add a bit of overshoot starting from currFraction
                 final float currFraction = mCurrentAnimation.getProgressFraction();
-                mAllAppsInterpolatorWrapper.baseInterpolator
-                        = new OvershootInterpolator(Math.min(Math.abs(velocity) / 3, 3f)) {
-                    @Override
-                    public float getInterpolation(float t) {
-                        return super.getInterpolation(t) + ((1 - t) * currFraction);
-                    }
-                };
-                animator.setFloatValues(0, 1);
+                mAllAppsInterpolatorWrapper.baseInterpolator = Interpolators.clampToProgress(
+                        new OvershootInterpolator(Math.min(Math.abs(velocity), 3f)), currFraction, 1);
                 animator.setDuration(Math.min(expectedDuration, ATOMIC_DURATION))
                         .setInterpolator(LINEAR);
             }
diff --git a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
index 8ffa628..0e68538 100644
--- a/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
+++ b/src/com/android/launcher3/touch/AbstractStateChangeTouchController.java
@@ -210,11 +210,13 @@
                 @Override
                 public void onAnimationSuccess(Animator animation) {
                     cancelAtomicComponentsController();
-                    mAtomicComponentsStartProgress = mCurrentAnimation.getProgressFraction();
-                    long duration = (long) (getShiftRange() * 2);
-                    mAtomicComponentsController = AnimatorPlaybackController.wrap(
-                            createAtomicAnimForState(mFromState, mToState, duration), duration);
-                    mAtomicComponentsController.dispatchOnStart();
+                    if (mCurrentAnimation != null) {
+                        mAtomicComponentsStartProgress = mCurrentAnimation.getProgressFraction();
+                        long duration = (long) (getShiftRange() * 2);
+                        mAtomicComponentsController = AnimatorPlaybackController.wrap(
+                                createAtomicAnimForState(mFromState, mToState, duration), duration);
+                        mAtomicComponentsController.dispatchOnStart();
+                    }
                 }
             });
         }