summaryrefslogtreecommitdiffstats
path: root/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
diff options
context:
space:
mode:
authorTony <twickham@google.com>2019-07-31 18:53:40 -0700
committerTony <twickham@google.com>2019-08-01 13:28:43 -0700
commit03c548901fb77d0a47bb46036d559968b65b2293 (patch)
tree3727a664cb199c65feddf8f3963fda18546051e6 /quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
parent7af5bede6d6e1148d988d298a4b20336357b0266 (diff)
downloadandroid_packages_apps_Trebuchet-03c548901fb77d0a47bb46036d559968b65b2293.tar.gz
android_packages_apps_Trebuchet-03c548901fb77d0a47bb46036d559968b65b2293.tar.bz2
android_packages_apps_Trebuchet-03c548901fb77d0a47bb46036d559968b65b2293.zip
Don't end launcher components anim early even if it does nothing
The janky animation that ends on the home screen with an invisible task on top is caused by the following scenario (for example): - Quick switch from task A to task B - After landing on B, but before we get the callback that it was successfully launched, switch back to A (or you could go to C) Now we are animating back to A, but we are still waiting to hear whether B was successfully launched. If we hear that the launch was indeed successful, we dutifully clean up after ourselves by returning launcher to its default state. Unfortunately, that clobbers the current animation that is scrolling back to A, and we end up in the bad state where we are showing the default launcher state even though we just launched task B and were about to launch task A. Normally we avoid cleaning up the state animation if the user is still controlling it. The reason we weren't doing that here is because we ended the launcher animation early even though the window animation was still running. Instead, we should keep the launcher animation running for the full duration, so that it prevents a cleanup from occurring in the middle. Bug: 138620399 Change-Id: I959e62a52638a5b974ef9b406555078c928b91f1
Diffstat (limited to 'quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java')
-rw-r--r--quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java11
1 files changed, 5 insertions, 6 deletions
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
index f1d1141bc..af18bbf80 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -1132,17 +1132,16 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity>
}
if (start == end || duration <= 0) {
mLauncherTransitionController.dispatchSetInterpolator(t -> end);
- mLauncherTransitionController.getAnimationPlayer().end();
} else {
mLauncherTransitionController.dispatchSetInterpolator(adjustedInterpolator);
mAnimationFactory.adjustActivityControllerInterpolators();
- mLauncherTransitionController.getAnimationPlayer().setDuration(duration);
+ }
+ mLauncherTransitionController.getAnimationPlayer().setDuration(Math.max(0, duration));
- if (QUICKSTEP_SPRINGS.get()) {
- mLauncherTransitionController.dispatchOnStartWithVelocity(end, velocityPxPerMs.y);
- }
- mLauncherTransitionController.getAnimationPlayer().start();
+ if (QUICKSTEP_SPRINGS.get()) {
+ mLauncherTransitionController.dispatchOnStartWithVelocity(end, velocityPxPerMs.y);
}
+ mLauncherTransitionController.getAnimationPlayer().start();
mHasLauncherTransitionControllerStarted = true;
}