Fix animations home

- To prevent surface thrashing, we no longer hide the home activity before
  starting the transition home. This prevents the launcher from being added
  to the remote animation target list, which means that we default to
  skipping the launcher animation. As a workaround, we special case the
  flow and force the animation to run when starting the recents animation.

Bug: 74405472
Test: Go home from an app, ensure there is an animation.
Change-Id: Ifd2b39444fdeab323ee79a368b580a6264c3e5b9
This commit is contained in:
Winson Chung
2018-04-04 13:33:23 -07:00
parent bc5bfc1119
commit 9800e730a2
3 changed files with 36 additions and 1 deletions

View File

@@ -709,11 +709,20 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
AnimatorSet anim = new AnimatorSet();
anim.play(getClosingWindowAnimators(targetCompats));
if (launcherIsATargetWithMode(targetCompats, MODE_OPENING)) {
// Normally, we run the launcher content animation when we are transitioning home,
// but if home is already visible, then we don't want to animate the contents of
// launcher unless we know that we are animating home as a result of the home button
// press with quickstep, which will result in launcher being started on touch down,
// prior to the animation home (and won't be in the targets list because it is
// already visible). In that case, we force invisibility on touch down, and only
// reset it after the animation to home is initialized.
if (launcherIsATargetWithMode(targetCompats, MODE_OPENING)
|| mLauncher.isForceInvisible()) {
// Only register the content animation for cancellation when state changes
mLauncher.getStateManager().setCurrentAnimation(anim);
createLauncherResumeAnimation(anim);
}
mLauncher.setForceInvisible(false);
return anim;
}
};