diff options
author | Tony Wickham <twickham@google.com> | 2015-10-12 13:34:28 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2015-10-12 13:34:28 -0700 |
commit | 1636cddbb48d0ad45028efa8756f205e78936261 (patch) | |
tree | bcf942a39972f5bab3d5fef6c824f6ee9d30ec0e /src/com/android/launcher3/LauncherStateTransitionAnimation.java | |
parent | 3abe12e9330cbaab531369a03b40a4ac0c9c2478 (diff) | |
parent | f685c7e5f7750ddb1ca3d5f52343b92cb99fc130 (diff) | |
download | android_packages_apps_Trebuchet-1636cddbb48d0ad45028efa8756f205e78936261.tar.gz android_packages_apps_Trebuchet-1636cddbb48d0ad45028efa8756f205e78936261.tar.bz2 android_packages_apps_Trebuchet-1636cddbb48d0ad45028efa8756f205e78936261.zip |
resolved conflicts for f685c7e5 to ub-launcher3-master
Change-Id: Iddf78c166f9ab89ffae2ddc819c9ba5cf5e988be
Diffstat (limited to 'src/com/android/launcher3/LauncherStateTransitionAnimation.java')
-rw-r--r-- | src/com/android/launcher3/LauncherStateTransitionAnimation.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java index a8445f384..aa56f9db2 100644 --- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java +++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java @@ -22,6 +22,7 @@ import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.animation.TimeInterpolator; +import android.animation.ValueAnimator; import android.annotation.SuppressLint; import android.annotation.TargetApi; import android.content.res.Resources; @@ -234,6 +235,8 @@ public class LauncherStateTransitionAnimation { startWorkspaceSearchBarAnimation(animation, fromWorkspaceState, toWorkspaceState, animated ? revealDuration : 0, overlaySearchBarView); + Animator updateTransitionStepAnim = dispatchOnLauncherTransitionStepAnim(fromView, toView); + if (animated && initialized) { // Setup the reveal view animation int width = revealView.getMeasuredWidth(); @@ -347,11 +350,12 @@ public class LauncherStateTransitionAnimation { animation.play(workspaceAnim); } + animation.play(updateTransitionStepAnim); + // Dispatch the prepare transition signal dispatchOnLauncherTransitionPrepare(fromView, animated, false); dispatchOnLauncherTransitionPrepare(toView, animated, false); - final AnimatorSet stateAnimation = animation; final Runnable startAnimRunnable = new Runnable() { public void run() { @@ -407,6 +411,24 @@ public class LauncherStateTransitionAnimation { } /** + * Returns an Animator that calls {@link #dispatchOnLauncherTransitionStep(View, float)} on + * {@param fromView} and {@param toView} as the animation interpolates. + * + * This is a bit hacky: we create a dummy ValueAnimator just for the AnimatorUpdateListener. + */ + private Animator dispatchOnLauncherTransitionStepAnim(final View fromView, final View toView) { + ValueAnimator updateAnimator = ValueAnimator.ofFloat(0, 1); + updateAnimator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { + @Override + public void onAnimationUpdate(ValueAnimator animation) { + dispatchOnLauncherTransitionStep(fromView, animation.getAnimatedFraction()); + dispatchOnLauncherTransitionStep(toView, animation.getAnimatedFraction()); + } + }); + return updateAnimator; + } + + /** * Starts an animation to the workspace from the apps view. */ private void startAnimationToWorkspaceFromAllApps(final Workspace.State fromWorkspaceState, @@ -603,12 +625,16 @@ public class LauncherStateTransitionAnimation { startWorkspaceSearchBarAnimation(animation, fromWorkspaceState, toWorkspaceState, animated ? revealDuration : 0, overlaySearchBarView); + Animator updateTransitionStepAnim = dispatchOnLauncherTransitionStepAnim(fromView, toView); + if (animated && initialized) { // Play the workspace animation if (workspaceAnim != null) { animation.play(workspaceAnim); } + animation.play(updateTransitionStepAnim); + // hideAppsCustomizeHelper is called in some cases when it is already hidden // don't perform all these no-op animations. In particularly, this was causing // the all-apps button to pop in and out. |