Removing some properties out of AnimationBuilder

AnimationBuilder and PendingAnimation have similar logic. This will
allow to unify the two classes

Change-Id: Id8c1d8a7020d132adbccdc6c80538ed6556cb75e
This commit is contained in:
Sunny Goyal
2020-03-06 14:52:17 -08:00
parent 8780065fdb
commit 003782f93c
14 changed files with 85 additions and 106 deletions

View File

@@ -19,9 +19,9 @@ import static com.android.launcher3.LauncherAnimUtils.MIN_PROGRESS_TO_ALL_APPS;
import static com.android.launcher3.LauncherState.ALL_APPS;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherStateManager.ANIM_ALL;
import static com.android.launcher3.LauncherStateManager.ATOMIC_OVERVIEW_SCALE_COMPONENT;
import static com.android.launcher3.LauncherStateManager.NON_ATOMIC_COMPONENT;
import static com.android.launcher3.LauncherStateManager.ANIM_ALL_COMPONENTS;
import static com.android.launcher3.LauncherStateManager.PLAY_ATOMIC_OVERVIEW_SCALE;
import static com.android.launcher3.LauncherStateManager.PLAY_NON_ATOMIC;
import static com.android.launcher3.anim.Interpolators.scrollInterpolatorForVelocity;
import static com.android.launcher3.config.FeatureFlags.UNSTABLE_SPRINGS;
import static com.android.launcher3.util.DefaultDisplay.getSingleFrameMs;
@@ -37,7 +37,7 @@ import android.view.MotionEvent;
import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherAnimUtils;
import com.android.launcher3.LauncherState;
import com.android.launcher3.LauncherStateManager.AnimationComponents;
import com.android.launcher3.LauncherStateManager.AnimationFlags;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
@@ -176,7 +176,7 @@ public abstract class AbstractStateChangeTouchController
protected abstract LauncherState getTargetState(LauncherState fromState,
boolean isDragTowardPositive);
protected abstract float initCurrentAnimation(@AnimationComponents int animComponents);
protected abstract float initCurrentAnimation(@AnimationFlags int animComponents);
/**
* Returns the container that the touch started from when leaving NORMAL state.
@@ -201,10 +201,10 @@ public abstract class AbstractStateChangeTouchController
mCurrentAnimation.setOnCancelRunnable(null);
}
int animComponents = goingBetweenNormalAndOverview(mFromState, mToState)
? NON_ATOMIC_COMPONENT : ANIM_ALL;
? PLAY_NON_ATOMIC : ANIM_ALL_COMPONENTS;
mScheduleResumeAtomicComponent = false;
if (mAtomicAnim != null) {
animComponents = NON_ATOMIC_COMPONENT;
animComponents = PLAY_NON_ATOMIC;
// Control the non-atomic components until the atomic animation finishes, then control
// the atomic components as well.
mScheduleResumeAtomicComponent = true;
@@ -215,7 +215,7 @@ public abstract class AbstractStateChangeTouchController
}
if (mAtomicComponentsController != null) {
animComponents &= ~ATOMIC_OVERVIEW_SCALE_COMPONENT;
animComponents &= ~PLAY_ATOMIC_OVERVIEW_SCALE;
}
mProgressMultiplier = initCurrentAnimation(animComponents);
mCurrentAnimation.dispatchOnStart();
@@ -360,7 +360,7 @@ public abstract class AbstractStateChangeTouchController
long duration) {
AnimatorSetBuilder builder = getAnimatorSetBuilderForStates(fromState, targetState);
return mLauncher.getStateManager().createAtomicAnimation(fromState, targetState, builder,
ATOMIC_OVERVIEW_SCALE_COMPONENT, duration);
PLAY_ATOMIC_OVERVIEW_SCALE, duration);
}
protected AnimatorSetBuilder getAnimatorSetBuilderForStates(LauncherState fromState,