Removing separate Cancel and End callbacks and using AnimationListener instead

This removes the additional step of invoking these callbacks separately

Change-Id: I0b60047a44f179ba725f15b1e791e336884869c9
This commit is contained in:
Sunny Goyal
2020-10-21 15:42:05 -07:00
parent b0588f1172
commit ff9e7d6aa9
13 changed files with 141 additions and 173 deletions

View File

@@ -106,8 +106,8 @@ public class QuickSwitchTouchController extends AbstractStateChangeTouchControll
setupInterpolators(config);
config.duration = (long) (getShiftRange() * 2);
mCurrentAnimation = mLauncher.getStateManager()
.createAnimationToNewWorkspace(mToState, config)
.setOnCancelRunnable(this::clearState);
.createAnimationToNewWorkspace(mToState, config);
mCurrentAnimation.getTarget().addListener(mClearStateOnCancelListener);
mCurrentAnimation.getAnimationPlayer().addUpdateListener(valueAnimator ->
updateFullscreenProgress((Float) valueAnimator.getAnimatedValue()));
return 1 / getShiftRange();