summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony <twickham@google.com>2019-07-31 18:53:40 -0700
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-08-08 21:25:41 +0000
commita50cf9772a57e0058ba36e742beb37da11b27a41 (patch)
tree6426daca6d0ad0ebf7245f5830570bc0922f9c23
parent72b4b224430f50a897bdbc1d2a805243bc032da7 (diff)
downloadandroid_packages_apps_Trebuchet-a50cf9772a57e0058ba36e742beb37da11b27a41.tar.gz
android_packages_apps_Trebuchet-a50cf9772a57e0058ba36e742beb37da11b27a41.tar.bz2
android_packages_apps_Trebuchet-a50cf9772a57e0058ba36e742beb37da11b27a41.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 (cherry picked from commit 03c548901fb77d0a47bb46036d559968b65b2293) (cherry picked from commit c5555c459bd28033257bced610c861e5ff84aec4)
-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 ac7ba3fc3..476bb8f93 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/WindowTransformSwipeHandler.java
@@ -1133,17 +1133,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;
}