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

Commit 9f02cdcb authored by Maryam Dehaini's avatar Maryam Dehaini Committed by Automerger Merge Worker
Browse files

Merge "Rename two part drag to freeform transitions" into udc-qpr-dev am: 990069ff am: b5207e55

parents de86ba2d b5207e55
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -88,7 +88,7 @@ public class EnterDesktopTaskTransitionHandler implements Transitions.Transition
    }

    /**
     * Starts Transition of type TRANSIT_START_MOVE_TO_DESKTOP_MODE
     * Starts Transition of type TRANSIT_START_DRAG_TO_DESKTOP_MODE
     * @param wct WindowContainerTransaction for transition
     * @param moveToDesktopAnimator Animator that shrinks and positions task during two part move
     *                              to desktop animation
@@ -98,18 +98,18 @@ public class EnterDesktopTaskTransitionHandler implements Transitions.Transition
            @NonNull MoveToDesktopAnimator moveToDesktopAnimator,
            Consumer<SurfaceControl.Transaction> onAnimationEndCallback) {
        mMoveToDesktopAnimator = moveToDesktopAnimator;
        startTransition(Transitions.TRANSIT_START_MOVE_TO_DESKTOP_MODE, wct,
        startTransition(Transitions.TRANSIT_START_DRAG_TO_DESKTOP_MODE, wct,
                onAnimationEndCallback);
    }

    /**
     * Starts Transition of type TRANSIT_FINALIZE_MOVE_TO_DESKTOP_MODE
     * Starts Transition of type TRANSIT_FINALIZE_DRAG_TO_DESKTOP_MODE
     * @param wct WindowContainerTransaction for transition
     * @param onAnimationEndCallback to be called after animation
     */
    public void finalizeMoveToDesktop(@NonNull WindowContainerTransaction wct,
            Consumer<SurfaceControl.Transaction> onAnimationEndCallback) {
        startTransition(Transitions.TRANSIT_FINALIZE_MOVE_TO_DESKTOP_MODE, wct,
        startTransition(Transitions.TRANSIT_FINALIZE_DRAG_TO_DESKTOP_MODE, wct,
                onAnimationEndCallback);
    }

@@ -124,7 +124,7 @@ public class EnterDesktopTaskTransitionHandler implements Transitions.Transition
            MoveToDesktopAnimator moveToDesktopAnimator,
            Consumer<SurfaceControl.Transaction> onAnimationEndCallback) {
        mMoveToDesktopAnimator = moveToDesktopAnimator;
        startTransition(Transitions.TRANSIT_CANCEL_ENTERING_DESKTOP_MODE, wct,
        startTransition(Transitions.TRANSIT_CANCEL_DRAG_TO_DESKTOP_MODE, wct,
                onAnimationEndCallback);
    }

@@ -167,7 +167,7 @@ public class EnterDesktopTaskTransitionHandler implements Transitions.Transition
        }

        final ActivityManager.RunningTaskInfo taskInfo = change.getTaskInfo();
        if (type == Transitions.TRANSIT_START_MOVE_TO_DESKTOP_MODE
        if (type == Transitions.TRANSIT_START_DRAG_TO_DESKTOP_MODE
                && taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM) {
            // Transitioning to freeform but keeping fullscreen bounds, so the crop is set
            // to null and we don't require an animation
@@ -194,7 +194,7 @@ public class EnterDesktopTaskTransitionHandler implements Transitions.Transition
        }

        Rect endBounds = change.getEndAbsBounds();
        if (type == Transitions.TRANSIT_FINALIZE_MOVE_TO_DESKTOP_MODE
        if (type == Transitions.TRANSIT_FINALIZE_DRAG_TO_DESKTOP_MODE
                && taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM
                && !endBounds.isEmpty()) {
            // This Transition animates a task to freeform bounds after being dragged into freeform
@@ -246,7 +246,7 @@ public class EnterDesktopTaskTransitionHandler implements Transitions.Transition
            return true;
        }

        if (type == Transitions.TRANSIT_CANCEL_ENTERING_DESKTOP_MODE
        if (type == Transitions.TRANSIT_CANCEL_DRAG_TO_DESKTOP_MODE
                && taskInfo.getWindowingMode() == WINDOWING_MODE_FREEFORM) {
            // This Transition animates a task to fullscreen after being dragged from the status
            // bar and then released back into the status bar area
+3 −3
Original line number Diff line number Diff line
@@ -150,18 +150,18 @@ public class Transitions implements RemoteCallable<Transitions>,
    public static final int TRANSIT_RESTORE_FROM_MAXIMIZE = WindowManager.TRANSIT_FIRST_CUSTOM + 9;

    /** Transition type for starting the move to desktop mode. */
    public static final int TRANSIT_START_MOVE_TO_DESKTOP_MODE =
    public static final int TRANSIT_START_DRAG_TO_DESKTOP_MODE =
            WindowManager.TRANSIT_FIRST_CUSTOM + 10;

    /** Transition type for finalizing the move to desktop mode. */
    public static final int TRANSIT_FINALIZE_MOVE_TO_DESKTOP_MODE =
    public static final int TRANSIT_FINALIZE_DRAG_TO_DESKTOP_MODE =
            WindowManager.TRANSIT_FIRST_CUSTOM + 11;

    /** Transition type to fullscreen from desktop mode. */
    public static final int TRANSIT_EXIT_DESKTOP_MODE = WindowManager.TRANSIT_FIRST_CUSTOM + 12;

    /** Transition type to animate back to fullscreen when drag to freeform is cancelled. */
    public static final int TRANSIT_CANCEL_ENTERING_DESKTOP_MODE =
    public static final int TRANSIT_CANCEL_DRAG_TO_DESKTOP_MODE =
            WindowManager.TRANSIT_FIRST_CUSTOM + 13;

    /** Transition type to animate the toggle resize between the max and default desktop sizes. */
+2 −2
Original line number Diff line number Diff line
@@ -197,8 +197,8 @@ public class DesktopModeWindowDecorViewModel implements WindowDecorViewModel {
            @NonNull TransitionInfo info,
            @NonNull TransitionInfo.Change change) {
        if (change.getMode() == WindowManager.TRANSIT_CHANGE
                && (info.getType() == Transitions.TRANSIT_FINALIZE_MOVE_TO_DESKTOP_MODE
                || info.getType() == Transitions.TRANSIT_CANCEL_ENTERING_DESKTOP_MODE
                && (info.getType() == Transitions.TRANSIT_FINALIZE_DRAG_TO_DESKTOP_MODE
                || info.getType() == Transitions.TRANSIT_CANCEL_DRAG_TO_DESKTOP_MODE
                || info.getType() == Transitions.TRANSIT_EXIT_DESKTOP_MODE
                || info.getType() == Transitions.TRANSIT_DESKTOP_MODE_TOGGLE_RESIZE)) {
            mWindowDecorByTaskId.get(change.getTaskInfo().taskId)
+4 −4
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ public class EnterDesktopTaskTransitionHandlerTest {
        final int taskId = 1;
        WindowContainerTransaction wct = new WindowContainerTransaction();
        doReturn(mToken).when(mTransitions)
                .startTransition(Transitions.TRANSIT_START_MOVE_TO_DESKTOP_MODE, wct,
                .startTransition(Transitions.TRANSIT_START_DRAG_TO_DESKTOP_MODE, wct,
                        mEnterDesktopTaskTransitionHandler);
        doReturn(taskId).when(mMoveToDesktopAnimator).getTaskId();

@@ -108,7 +108,7 @@ public class EnterDesktopTaskTransitionHandlerTest {

        TransitionInfo.Change change =
                createChange(WindowManager.TRANSIT_CHANGE, taskId, WINDOWING_MODE_FREEFORM);
        TransitionInfo info = createTransitionInfo(Transitions.TRANSIT_START_MOVE_TO_DESKTOP_MODE,
        TransitionInfo info = createTransitionInfo(Transitions.TRANSIT_START_DRAG_TO_DESKTOP_MODE,
                change);


@@ -121,7 +121,7 @@ public class EnterDesktopTaskTransitionHandlerTest {

    @Test
    public void testTransitEnterDesktopModeAnimation() throws Throwable {
        final int transitionType = Transitions.TRANSIT_FINALIZE_MOVE_TO_DESKTOP_MODE;
        final int transitionType = Transitions.TRANSIT_FINALIZE_DRAG_TO_DESKTOP_MODE;
        final int taskId = 1;
        WindowContainerTransaction wct = new WindowContainerTransaction();
        doReturn(mToken).when(mTransitions)
@@ -132,7 +132,7 @@ public class EnterDesktopTaskTransitionHandlerTest {
                createChange(WindowManager.TRANSIT_CHANGE, taskId, WINDOWING_MODE_FREEFORM);
        change.setEndAbsBounds(new Rect(0, 0, 1, 1));
        TransitionInfo info = createTransitionInfo(
                Transitions.TRANSIT_FINALIZE_MOVE_TO_DESKTOP_MODE, change);
                Transitions.TRANSIT_FINALIZE_DRAG_TO_DESKTOP_MODE, change);

        runOnUiThread(() -> {
            try {