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

Commit dd2bea9e authored by Tracy Zhou's avatar Tracy Zhou
Browse files

Fix wrong initial staged split position

This is caused by having set a wrong animation duration in the 3 button case. Before this change we have a fixed duration of 370ms which happens to be almost match the Overview transtion duration in gesture nav. However the transition duration in 3-button is set to 250ms. After the transition duration, any unfinished animation is cancelled including this one, resulting in the wrong staged split position. Instead this change pulls the transition duration of toState from the caller = RecentsViewStateController.

Fixes: 222210349
Test: manual
Change-Id: Ie2f3dbe38bb6df33961e2ee78b8a55d0e925501f
parent 3c8277d1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -118,8 +118,8 @@ public final class RecentsViewStateController extends

        if (isSplitSelectionState(currentState, toState)) {
            // Animation to "dismiss" selected taskView
            PendingAnimation splitSelectInitAnimation =
                    mRecentsView.createSplitSelectInitAnimation();
            PendingAnimation splitSelectInitAnimation = mRecentsView.createSplitSelectInitAnimation(
                    toState.getTransitionDuration(mLauncher));
            // Add properties to shift remaining taskViews to get out of placeholder view
            splitSelectInitAnimation.setFloat(mRecentsView, taskViewsFloat.first,
                    toState.getSplitSelectTranslation(mLauncher), LINEAR);
+2 −1
Original line number Diff line number Diff line
@@ -111,7 +111,8 @@ public class FallbackRecentsStateController implements StateHandler<RecentsState

        RecentsState currentState = mActivity.getStateManager().getState();
        if (isSplitSelectionState(state) && !isSplitSelectionState(currentState)) {
            setter.add(mRecentsView.createSplitSelectInitAnimation().buildAnim());
            setter.add(mRecentsView.createSplitSelectInitAnimation(
                    state.getTransitionDuration(mActivity)).buildAnim());
        }

        Pair<FloatProperty, FloatProperty> taskViewsFloat =
+2 −5
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import static com.android.launcher3.LauncherAnimUtils.SUCCESS_TRANSITION_PROGRES
import static com.android.launcher3.LauncherAnimUtils.VIEW_ALPHA;
import static com.android.launcher3.LauncherState.BACKGROUND_APP;
import static com.android.launcher3.QuickstepTransitionManager.RECENTS_LAUNCH_DURATION;
import static com.android.launcher3.QuickstepTransitionManager.SPLIT_LAUNCH_DURATION;
import static com.android.launcher3.Utilities.EDGE_NAV_BAR;
import static com.android.launcher3.Utilities.mapToRange;
import static com.android.launcher3.Utilities.squaredHypot;
@@ -3987,14 +3986,12 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
                splitSelectSource.position.stagePosition);
    }

    public PendingAnimation createSplitSelectInitAnimation() {
    public PendingAnimation createSplitSelectInitAnimation(int duration) {
        if (mSplitHiddenTaskView != null) {
            int duration = mActivity.getStateManager().getState().getTransitionDuration(
                    getContext());
            return createTaskDismissAnimation(mSplitHiddenTaskView, true, false, duration,
                    true /* dismissingForSplitSelection*/);
        } else {
            PendingAnimation anim = new PendingAnimation(SPLIT_LAUNCH_DURATION);
            PendingAnimation anim = new PendingAnimation(duration);
            createInitialSplitSelectAnimation(anim);
            return anim;
        }