Several app transition fixes:

> If launcher already started, creating the state transition only after threshold crossed, so that previous animations are not cancelled
> Not posting animaiton callbacks at the front of the queue, as that sometimes causes it get executed before onNewIntent
> Farking the activity as forceInvisible while launching an opaque app, so that quickly pressing home/back runs the reverse animation
> Not running state animations when force-invisible is true

Bug: 77830325
Bug: 77898806
Change-Id: I50a7e915ca35fd6aeb284c8f321ecca74396fe98
This commit is contained in:
Sunny Goyal
2018-04-11 15:30:46 -07:00
parent e9f31c1014
commit 7eff40ff2d
5 changed files with 104 additions and 62 deletions

View File

@@ -15,9 +15,6 @@
*/
package com.android.launcher3;
import static com.android.systemui.shared.recents.utilities.Utilities
.postAtFrontOfQueueAsynchronously;
import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
@@ -49,7 +46,7 @@ public abstract class LauncherAnimationRunner extends AnimatorListenerAdapter
@BinderThread
@Override
public void onAnimationStart(RemoteAnimationTargetCompat[] targetCompats, Runnable runnable) {
postAtFrontOfQueueAsynchronously(mHandler, () -> {
mHandler.post(() -> {
// Finish any previous animation
finishSystemAnimation();
@@ -68,7 +65,6 @@ public abstract class LauncherAnimationRunner extends AnimatorListenerAdapter
});
}
@UiThread
public abstract AnimatorSet getAnimator(RemoteAnimationTargetCompat[] targetCompats);
@@ -87,7 +83,7 @@ public abstract class LauncherAnimationRunner extends AnimatorListenerAdapter
@BinderThread
@Override
public void onAnimationCancelled() {
postAtFrontOfQueueAsynchronously(mHandler, () -> {
mHandler.post(() -> {
if (mAnimator != null) {
mAnimator.removeListener(this);
mAnimator.end();