Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c58900ca authored by Winson Chung's avatar Winson Chung Committed by Android (Google) Code Review
Browse files

Merge changes from topic "same_shared_lib" into ub-launcher3-master

* changes:
  Update dock divider during recents animation.
  Update api for canceling recents animation.
parents b6eadfd6 dbff75e3
Loading
Loading
Loading
Loading
+969 B (117 KiB)

File changed.

No diff preview for this file type.

+2 −1
Original line number Diff line number Diff line
@@ -285,7 +285,8 @@ public class OtherActivityTouchConsumer extends ContextWrapper implements TouchC

            // Also clean up in case the system has handled the UP and canceled the animation before
            // we had a chance to start the recents animation. In such a case, we will not receive
            ActivityManagerWrapper.getInstance().cancelRecentsAnimation();
            ActivityManagerWrapper.getInstance().cancelRecentsAnimation(
                    true /* restoreHomeStackPosition */);
        }
        mVelocityTracker.recycle();
        mVelocityTracker = null;
+41 −1
Original line number Diff line number Diff line
@@ -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);
                }
            }
        });
    }
}
+4 −3
Original line number Diff line number Diff line
@@ -497,6 +497,7 @@ public class WindowTransformSwipeHandler<T extends BaseDraggingActivity> {
                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<T extends BaseDraggingActivity> {
                    }
                }
                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()) {