All apps pull up work

b/28917826
b/29469966
b/29542376

- Move state transition to when the finger is lifted and not when
the view settles.
- Refactor the vertical pull detector to use bit operation to define
which direction scroll to allow.
- Fixed many issues regarding screen rotation
- Fixes issue where slowly sliding the all apps goes into overview mode
- Fixes issue where quick slide up leads to animation starting from middle

Change-Id: I2384a0fcc5550e17359a044ef506bcc66507da5f
This commit is contained in:
Hyunyoung Song
2016-06-21 16:37:13 -07:00
parent 314d53fbaf
commit eac1dac239
5 changed files with 247 additions and 171 deletions

View File

@@ -420,7 +420,7 @@ public class LauncherStateTransitionAnimation {
pCb.onTransitionComplete();
}
});
mAllAppsController.animateToAllApps(animation, revealDuration);
mAllAppsController.animateToAllApps(animation, revealDuration, false);
dispatchOnLauncherTransitionPrepare(fromView, animated, false);
dispatchOnLauncherTransitionPrepare(toView, animated, false);
@@ -861,37 +861,31 @@ public class LauncherStateTransitionAnimation {
return animation;
} else if (animType == PULLUP) {
animation.addListener(new AnimatorListenerAdapter() {
boolean canceled = false;
@Override
public void onAnimationEnd(Animator animation) {
dispatchOnLauncherTransitionEnd(fromView, animated, false);
dispatchOnLauncherTransitionEnd(toView, animated, false);
cleanupAnimation();
pCb.onTransitionComplete();
public void onAnimationCancel(Animator animation) {
canceled = true;
}
});
mAllAppsController.animateToWorkspace(animation, revealDuration);
// Dispatch the prepare transition signal
dispatchOnLauncherTransitionPrepare(fromView, animated, false);
dispatchOnLauncherTransitionPrepare(toView, animated, false);
animation.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
dispatchOnLauncherTransitionEnd(fromView, animated, true);
dispatchOnLauncherTransitionEnd(toView, animated, true);
if (canceled) return;
dispatchOnLauncherTransitionEnd(fromView, animated, false);
dispatchOnLauncherTransitionEnd(toView, animated, false);
// Run any queued runnables
if (onCompleteRunnable != null) {
onCompleteRunnable.run();
}
// This can hold unnecessary references to views.
cleanupAnimation();
pCb.onTransitionComplete();
}
});
mAllAppsController.animateToWorkspace(animation, revealDuration, false);
// Dispatch the prepare transition signal
dispatchOnLauncherTransitionPrepare(fromView, animated, false);
dispatchOnLauncherTransitionPrepare(toView, animated, false);
final AnimatorSet stateAnimation = animation;
final Runnable startAnimRunnable = new Runnable() {