Cleaning up some animation states:

> When running one-off animations during quickstep, cancelling prevoisly
  running animations.
> Cancelling such one-off animations when state is reset
> Preventing touch proxied from recent transition to affect quickswitch
  (by affecting pagedView)

Bug: 135686388
Bug: 135571566
Change-Id: Id647015a583761d8fd46a02e3e2d88027e282a79
This commit is contained in:
Sunny Goyal
2019-06-20 11:34:14 -07:00
parent 06954c18fa
commit c4bb3739b1
10 changed files with 161 additions and 77 deletions

View File

@@ -47,8 +47,8 @@ import com.android.launcher3.views.ScrimView;
*/
public class AllAppsTransitionController implements StateHandler, OnDeviceProfileChangeListener {
public static final float SPRING_DAMPING_RATIO = 0.9f;
public static final float SPRING_STIFFNESS = 600f;
private static final float SPRING_DAMPING_RATIO = 0.9f;
private static final float SPRING_STIFFNESS = 600f;
public static final FloatProperty<AllAppsTransitionController> ALL_APPS_PROGRESS =
new FloatProperty<AllAppsTransitionController>("allAppsProgress") {
@@ -188,8 +188,7 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
Interpolator interpolator = config.userControlled ? LINEAR : toState == OVERVIEW
? builder.getInterpolator(ANIM_OVERVIEW_SCALE, FAST_OUT_SLOW_IN)
: FAST_OUT_SLOW_IN;
Animator anim = new SpringObjectAnimator<>(this, ALL_APPS_PROGRESS, 1f / mShiftRange,
SPRING_DAMPING_RATIO, SPRING_STIFFNESS, mProgress, targetProgress);
Animator anim = createSpringAnimation(mProgress, targetProgress);
anim.setDuration(config.duration);
anim.setInterpolator(builder.getInterpolator(ANIM_VERTICAL_PROGRESS, interpolator));
anim.addListener(getProgressAnimatorListener());
@@ -199,6 +198,11 @@ public class AllAppsTransitionController implements StateHandler, OnDeviceProfil
setAlphas(toState, config, builder);
}
public Animator createSpringAnimation(float... progressValues) {
return new SpringObjectAnimator<>(this, ALL_APPS_PROGRESS, 1f / mShiftRange,
SPRING_DAMPING_RATIO, SPRING_STIFFNESS, progressValues);
}
private void setAlphas(LauncherState toState, AnimationConfig config,
AnimatorSetBuilder builder) {
setAlphas(toState.getVisibleElements(mLauncher), config, builder);