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

Commit 061e6f5d authored by Vinit Nayak's avatar Vinit Nayak Committed by Android (Google) Code Review
Browse files

Merge "Prevent taps on initial TaskView animated into split select" into tm-qpr-dev

parents 0f7b01c7 5144be39
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -895,7 +895,7 @@ public class QuickstepLauncher extends Launcher {
        // load in, and then proceed to OverviewSplitSelect.
        if (isInState(OVERVIEW_SPLIT_SELECT)) {
            SplitSelectStateController splitSelectStateController =
                    ((RecentsView) getOverviewPanel()).getSplitPlaceholder();
                    ((RecentsView) getOverviewPanel()).getSplitSelectController();
            // Launcher will restart in Overview and then transition to OverviewSplitSelect.
            outState.putIBinder(PENDING_SPLIT_SELECT_INFO, ObjectWrapper.wrap(
                    new PendingSplitSelectInfo(
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ public class FloatingTaskView extends FrameLayout {

        RecentsView recentsView = launcher.getOverviewPanel();
        mOrientationHandler = recentsView.getPagedOrientationHandler();
        mStagePosition = recentsView.getSplitPlaceholder().getActiveSplitStagePosition();
        mStagePosition = recentsView.getSplitSelectController().getActiveSplitStagePosition();
        mSplitPlaceholderView.setIcon(icon,
                mContext.getResources().getDimensionPixelSize(R.dimen.split_placeholder_icon_size));
        mSplitPlaceholderView.getIconView().setRotation(mOrientationHandler.getDegreesRotated());
+2 −2
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ public class GroupedTaskView extends TaskView {
        // Callbacks run from remote animation when recents animation not currently running
        InteractionJankMonitorWrapper.begin(this,
                InteractionJankMonitorWrapper.CUJ_SPLIT_SCREEN_ENTER, "Enter form GroupedTaskView");
        recentsView.getSplitPlaceholder().launchTasks(this /*groupedTaskView*/,
        recentsView.getSplitSelectController().launchTasks(this /*groupedTaskView*/,
                success -> {
                    endCallback.executeAllAndDestroy();
                    InteractionJankMonitorWrapper.end(
@@ -206,7 +206,7 @@ public class GroupedTaskView extends TaskView {

    @Override
    public void launchTask(@NonNull Consumer<Boolean> callback, boolean freezeTaskList) {
        getRecentsView().getSplitPlaceholder().launchTasks(mTask.key.id, mSecondaryTask.key.id,
        getRecentsView().getSplitSelectController().launchTasks(mTask.key.id, mSecondaryTask.key.id,
                STAGE_POSITION_TOP_OR_LEFT, callback, freezeTaskList, getSplitRatio());
    }

+2 −2
Original line number Diff line number Diff line
@@ -912,7 +912,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
        mSplitSelectStateController = splitController;
    }

    public SplitSelectStateController getSplitPlaceholder() {
    public SplitSelectStateController getSplitSelectController() {
        return mSplitSelectStateController;
    }

@@ -4272,7 +4272,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
     * Note that the translation can be its primary or secondary dimension.
     */
    public float getSplitSelectTranslation() {
        int splitPosition = getSplitPlaceholder().getActiveSplitStagePosition();
        int splitPosition = getSplitSelectController().getActiveSplitStagePosition();
        if (!shouldShiftThumbnailsForSplitSelect()) {
            return 0f;
        }
+13 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ import com.android.quickstep.TaskUtils;
import com.android.quickstep.TaskViewUtils;
import com.android.quickstep.util.CancellableTask;
import com.android.quickstep.util.RecentsOrientedState;
import com.android.quickstep.util.SplitSelectStateController;
import com.android.quickstep.util.TaskCornerRadius;
import com.android.quickstep.util.TransformParams;
import com.android.quickstep.views.TaskThumbnailView.PreviewPositionHelper;
@@ -561,6 +562,18 @@ public class TaskView extends FrameLayout implements Reusable {

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        RecentsView recentsView = getRecentsView();
        if (recentsView == null || mTask == null) {
            return false;
        }
        SplitSelectStateController splitSelectStateController =
                recentsView.getSplitSelectController();
        if (splitSelectStateController.isSplitSelectActive() &&
                splitSelectStateController.getInitialTaskId() == mTask.key.id) {
            // Prevent taps on the this taskview if it's being animated into split select state
            return false;
        }

        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            mLastTouchDownPosition.set(ev.getX(), ev.getY());
        }