Fix app closing transition in multi-window
Previously we attempted to disable the app closing transition
in multi-window. However, that didn't work because the registered
remote animation was still registered on the ActivityRecord, even
if the activity was restarted, leading to passing a null handler
into post, and then the animation never started.
Enable it in multi-window and also fix the transition.
Test: Enter multi-window, go home
Change-Id: I4d5d46688310b61365ba954fb41811efa29e41a5
Fixes: 72525431
diff --git a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
index 7433dfd..f10b574 100644
--- a/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
+++ b/quickstep/src/com/android/launcher3/LauncherAppTransitionManagerImpl.java
@@ -470,14 +470,14 @@
float dX = getValue(0, endX, 0, 350, currentPlayTime,
Interpolators.AGGRESSIVE_EASE_IN_OUT);
+ float dY = (height - height * scale) / 2f;
TransactionCompat t = new TransactionCompat();
for (RemoteAnimationTargetCompat app : targets) {
if (app.mode == RemoteAnimationTargetCompat.MODE_CLOSING) {
t.setAlpha(app.leash, 1f - percent);
-
- float dY = (height - (app.clipRect.height() * scale)) / 2f;
matrix.postTranslate(dX, dY);
+ matrix.postTranslate(app.position.x, app.position.y);
t.setMatrix(app.leash, matrix);
}
// TODO: Layer should be set only once, but there is possibly a race condition
diff --git a/src/com/android/launcher3/Launcher.java b/src/com/android/launcher3/Launcher.java
index c1883b1..85443ed 100644
--- a/src/com/android/launcher3/Launcher.java
+++ b/src/com/android/launcher3/Launcher.java
@@ -408,9 +408,7 @@
mAppTransitionManager = Utilities.getOverrideObject(LauncherAppTransitionManager.class,
this, R.string.app_transition_manager_class);
- if (!isInMultiWindowModeCompat()) {
- mAppTransitionManager.registerRemoteAnimations();
- }
+ mAppTransitionManager.registerRemoteAnimations();
if (mLauncherCallbacks != null) {
mLauncherCallbacks.onCreate(savedInstanceState);