diff options
author | Winson Chung <winsonc@google.com> | 2012-02-10 15:43:22 -0800 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2012-02-17 11:14:29 -0800 |
commit | 7044272f180d34ab29866f6c59ee75376e8a1df5 (patch) | |
tree | 11347a033b082e5f4a035e4c35b33f4dd8c28452 /src/com/android/launcher2/Launcher.java | |
parent | a900bd5a434a3a8ce9de77d6a1abb2c3798399de (diff) | |
download | android_packages_apps_Trebuchet-7044272f180d34ab29866f6c59ee75376e8a1df5.tar.gz android_packages_apps_Trebuchet-7044272f180d34ab29866f6c59ee75376e8a1df5.tar.bz2 android_packages_apps_Trebuchet-7044272f180d34ab29866f6c59ee75376e8a1df5.zip |
Allow touches to fall through AllApps nearing end of transition (Bug: 5991846, 6016062, 5991846)
- Also updating mTransitionProgress so control when drops succeed
Change-Id: I2f672c64f0a87249dcf7d254f963b8b2710c849f
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index 92a3d08a0..1a6691db0 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -23,6 +23,7 @@ import android.animation.AnimatorSet; import android.animation.ObjectAnimator; import android.animation.PropertyValuesHolder; import android.animation.ValueAnimator; +import android.animation.ValueAnimator.AnimatorUpdateListener; import android.app.Activity; import android.app.ActivityManager; import android.app.AlertDialog; @@ -2224,12 +2225,24 @@ public final class Launcher extends Activity if (v instanceof LauncherTransitionable) { ((LauncherTransitionable) v).onLauncherTransitionStart(this, animated, toWorkspace); } + + // Update the workspace transition step as well + dispatchOnLauncherTransitionStep(v, 0f); + } + + private void dispatchOnLauncherTransitionStep(View v, float t) { + if (v instanceof LauncherTransitionable) { + ((LauncherTransitionable) v).onLauncherTransitionStep(this, t); + } } private void dispatchOnLauncherTransitionEnd(View v, boolean animated, boolean toWorkspace) { if (v instanceof LauncherTransitionable) { ((LauncherTransitionable) v).onLauncherTransitionEnd(this, animated, toWorkspace); } + + // Update the workspace transition step as well + dispatchOnLauncherTransitionStep(v, 1f); } /** @@ -2314,6 +2327,14 @@ public final class Launcher extends Activity .ofFloat(toView, "alpha", 0f, 1f) .setDuration(fadeDuration); alphaAnim.setInterpolator(new DecelerateInterpolator(1.5f)); + alphaAnim.addUpdateListener(new AnimatorUpdateListener() { + @Override + public void onAnimationUpdate(ValueAnimator animation) { + float t = (Float) animation.getAnimatedValue(); + dispatchOnLauncherTransitionStep(fromView, t); + dispatchOnLauncherTransitionStep(toView, t); + } + }); // toView should appear right at the end of the workspace shrink // animation @@ -2469,6 +2490,14 @@ public final class Launcher extends Activity .ofFloat(fromView, "alpha", 1f, 0f) .setDuration(fadeOutDuration); alphaAnim.setInterpolator(new AccelerateDecelerateInterpolator()); + alphaAnim.addUpdateListener(new AnimatorUpdateListener() { + @Override + public void onAnimationUpdate(ValueAnimator animation) { + float t = 1f - (Float) animation.getAnimatedValue(); + dispatchOnLauncherTransitionStep(fromView, t); + dispatchOnLauncherTransitionStep(toView, t); + } + }); mStateAnimation = new AnimatorSet(); @@ -3447,5 +3476,6 @@ public final class Launcher extends Activity interface LauncherTransitionable { View getContent(); void onLauncherTransitionStart(Launcher l, boolean animated, boolean toWorkspace); + void onLauncherTransitionStep(Launcher l, float t); void onLauncherTransitionEnd(Launcher l, boolean animated, boolean toWorkspace); } |