diff --git a/quickstep/libs/sysui_shared.jar b/quickstep/libs/sysui_shared.jar index 2b9db35bc0..3c5033e554 100644 Binary files a/quickstep/libs/sysui_shared.jar and b/quickstep/libs/sysui_shared.jar differ diff --git a/quickstep/src/com/android/quickstep/RecentsAnimationWrapper.java b/quickstep/src/com/android/quickstep/RecentsAnimationWrapper.java index 4e11220745..12f8d52b82 100644 --- a/quickstep/src/com/android/quickstep/RecentsAnimationWrapper.java +++ b/quickstep/src/com/android/quickstep/RecentsAnimationWrapper.java @@ -28,7 +28,9 @@ public class RecentsAnimationWrapper { public RecentsAnimationControllerCompat controller; public RemoteAnimationTargetCompat[] targets; - private boolean mInputConsumerEnabled; + private boolean mInputConsumerEnabled = false; + private boolean mBehindSystemBars = true; + private boolean mSplitScreenMinimized = false; public synchronized void setController( RecentsAnimationControllerCompat controller, RemoteAnimationTargetCompat[] targets) { @@ -75,4 +77,42 @@ public class RecentsAnimationWrapper { }); } } + + public void setAnimationTargetsBehindSystemBars(boolean behindSystemBars) { + if (mBehindSystemBars == behindSystemBars) { + return; + } + mBehindSystemBars = behindSystemBars; + BackgroundExecutor.get().submit(() -> { + synchronized (this) { + TraceHelper.partitionSection("RecentsController", + "Setting behind system bars on " + controller); + if (controller != null) { + controller.setAnimationTargetsBehindSystemBars(behindSystemBars); + } + } + }); + } + + /** + * NOTE: As a workaround for conflicting animations (Launcher animating the task leash, and + * SystemUI resizing the docked stack, which resizes the task), we currently only set the + * minimized mode, and not the inverse. + * TODO: Synchronize the minimize animation with the launcher animation + */ + public void setSplitScreenMinimizedForTransaction(boolean minimized) { + if (mSplitScreenMinimized || !minimized) { + return; + } + mSplitScreenMinimized = minimized; + BackgroundExecutor.get().submit(() -> { + synchronized (this) { + TraceHelper.partitionSection("RecentsController", + "Setting minimize dock on " + controller); + if (controller != null) { + controller.setSplitScreenMinimized(minimized); + } + } + }); + } } diff --git a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java index 611f7e0156..36a9d56496 100644 --- a/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java +++ b/quickstep/src/com/android/quickstep/WindowTransformSwipeHandler.java @@ -497,6 +497,7 @@ public class WindowTransformSwipeHandler { TransactionCompat transaction = new TransactionCompat(); for (RemoteAnimationTargetCompat app : mRecentsAnimationWrapper.targets) { if (app.mode == MODE_CLOSING) { + mTmpMatrix.postTranslate(app.position.x, app.position.y); transaction.setMatrix(app.leash, mTmpMatrix) .setWindowCrop(app.leash, mClipRect); @@ -534,10 +535,10 @@ public class WindowTransformSwipeHandler { } } if (mRecentsAnimationWrapper.controller != null) { - // TODO: This logic is spartanic! - mRecentsAnimationWrapper.controller.setAnimationTargetsBehindSystemBars( - shift < 0.12f); + boolean passedThreshold = shift > 0.12f; + mRecentsAnimationWrapper.setAnimationTargetsBehindSystemBars(!passedThreshold); + mRecentsAnimationWrapper.setSplitScreenMinimizedForTransaction(passedThreshold); } }; if (Looper.getMainLooper() == Looper.myLooper()) {