diff options
author | Tony Wickham <twickham@google.com> | 2016-04-05 18:36:36 -0700 |
---|---|---|
committer | Tony Wickham <twickham@google.com> | 2016-05-12 16:44:22 -0700 |
commit | f898b970cc9130d629d4bc969222aaa96a8a013a (patch) | |
tree | 1e349031ffe6102fd7cfe69adae5c8fb8bf186b0 /src/com/android/launcher3/LauncherStateTransitionAnimation.java | |
parent | 8f7ead3e94d0550beb85b83a8c1d5e78a9abd69f (diff) | |
download | android_packages_apps_Trebuchet-f898b970cc9130d629d4bc969222aaa96a8a013a.tar.gz android_packages_apps_Trebuchet-f898b970cc9130d629d4bc969222aaa96a8a013a.tar.bz2 android_packages_apps_Trebuchet-f898b970cc9130d629d4bc969222aaa96a8a013a.zip |
Call onLauncherTransitionPrepare() and End() from pinch.
This makes the pinch transition more consistent with other transitions.
One immediate benefit of this is that it updates adjacent overview
panels during pinch, regardless of whether they are completely visible.
Previously the adjacent panels' alphas weren't always reset to 0.
Specifically, if you made a small pinch from workspace, which
canceled and went back to workspace, adjacent pages retained a
slightly visible panel.
Bug: 27676309
Change-Id: I7e79fddec31cd649e0811e4524b9a9a501c627f9
Diffstat (limited to 'src/com/android/launcher3/LauncherStateTransitionAnimation.java')
-rw-r--r-- | src/com/android/launcher3/LauncherStateTransitionAnimation.java | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/com/android/launcher3/LauncherStateTransitionAnimation.java b/src/com/android/launcher3/LauncherStateTransitionAnimation.java index 5692046fb..17a5424a4 100644 --- a/src/com/android/launcher3/LauncherStateTransitionAnimation.java +++ b/src/com/android/launcher3/LauncherStateTransitionAnimation.java @@ -524,11 +524,13 @@ public class LauncherStateTransitionAnimation { // Cancel the current animation cancelAnimation(); + boolean multiplePagesVisible = toWorkspaceState.hasMultipleVisiblePages; + playCommonTransitionAnimations(toWorkspaceState, fromWorkspace, null, animated, animated, animation, revealDuration, layerViews); if (animated) { - dispatchOnLauncherTransitionPrepare(fromWorkspace, animated, true); + dispatchOnLauncherTransitionPrepare(fromWorkspace, animated, multiplePagesVisible); final AnimatorSet stateAnimation = animation; final Runnable startAnimRunnable = new Runnable() { @@ -577,7 +579,7 @@ public class LauncherStateTransitionAnimation { fromWorkspace.post(startAnimRunnable); mCurrentAnimation = animation; } else /* if (!animated) */ { - dispatchOnLauncherTransitionPrepare(fromWorkspace, animated, true); + dispatchOnLauncherTransitionPrepare(fromWorkspace, animated, multiplePagesVisible); dispatchOnLauncherTransitionStart(fromWorkspace, animated, true); dispatchOnLauncherTransitionEnd(fromWorkspace, animated, true); @@ -615,6 +617,8 @@ public class LauncherStateTransitionAnimation { // Cancel the current animation cancelAnimation(); + boolean multiplePagesVisible = toWorkspaceState.hasMultipleVisiblePages; + playCommonTransitionAnimations(toWorkspaceState, fromView, toView, animated, initialized, animation, revealDuration, layerViews); @@ -725,8 +729,8 @@ public class LauncherStateTransitionAnimation { } } - dispatchOnLauncherTransitionPrepare(fromView, animated, true); - dispatchOnLauncherTransitionPrepare(toView, animated, true); + dispatchOnLauncherTransitionPrepare(fromView, animated, multiplePagesVisible); + dispatchOnLauncherTransitionPrepare(toView, animated, multiplePagesVisible); animation.addListener(new AnimatorListenerAdapter() { @Override @@ -789,10 +793,10 @@ public class LauncherStateTransitionAnimation { return animation; } else /* if (!(animated && initialized)) */ { fromView.setVisibility(View.GONE); - dispatchOnLauncherTransitionPrepare(fromView, animated, true); + dispatchOnLauncherTransitionPrepare(fromView, animated, multiplePagesVisible); dispatchOnLauncherTransitionStart(fromView, animated, true); dispatchOnLauncherTransitionEnd(fromView, animated, true); - dispatchOnLauncherTransitionPrepare(toView, animated, true); + dispatchOnLauncherTransitionPrepare(toView, animated, multiplePagesVisible); dispatchOnLauncherTransitionStart(toView, animated, true); dispatchOnLauncherTransitionEnd(toView, animated, true); pCb.onTransitionComplete(); @@ -809,10 +813,11 @@ public class LauncherStateTransitionAnimation { /** * Dispatches the prepare-transition event to suitable views. */ - void dispatchOnLauncherTransitionPrepare(View v, boolean animated, boolean toWorkspace) { + void dispatchOnLauncherTransitionPrepare(View v, boolean animated, + boolean multiplePagesVisible) { if (v instanceof LauncherTransitionable) { ((LauncherTransitionable) v).onLauncherTransitionPrepare(mLauncher, animated, - toWorkspace); + multiplePagesVisible); } } |