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

Commit b5565fb6 authored by Becky Qiu's avatar Becky Qiu Committed by Android (Google) Code Review
Browse files

Merge "[Overview Actions] Disable swiping for TaskView if it's in select...

Merge "[Overview Actions] Disable swiping for TaskView if it's in select mode." into ub-launcher3-master
parents 39c61019 0499fb20
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -105,6 +105,10 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity>

    @Override
    public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
        if ((ev.getAction() == MotionEvent.ACTION_UP || ev.getAction() == MotionEvent.ACTION_CANCEL)
                && mCurrentAnimation == null) {
            clearState();
        }
        if (ev.getAction() == MotionEvent.ACTION_DOWN) {
            mNoIntercept = !canInterceptTouch();
            if (mNoIntercept) {
@@ -125,6 +129,11 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity>
                    TaskView view = mRecentsView.getTaskViewAt(i);
                    if (mRecentsView.isTaskViewVisible(view) && mActivity.getDragLayer()
                            .isEventOverView(view, ev)) {
                        // Disable swiping up and down if the task overlay is modal.
                        if (view.isTaskOverlayModal()) {
                            mTaskBeingDragged = null;
                            break;
                        }
                        mTaskBeingDragged = view;
                        if (!SysUINavigationMode.getMode(mActivity).hasGestures) {
                            // Don't allow swipe down to open if we don't support swipe up
+7 −0
Original line number Diff line number Diff line
@@ -87,5 +87,12 @@ public class TaskOverlayFactory implements ResourceBasedOverride {
         * Called when the overlay is no longer used.
         */
        public void reset() { }

        /**
         * Whether the overlay is modal, which means only tapping is enabled, but no swiping.
         */
        public boolean isOverlayModal() {
            return false;
        }
    }
}
+7 −0
Original line number Diff line number Diff line
@@ -565,6 +565,13 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
        return isHandlingTouch() || shouldStealTouchFromSiblingsBelow(ev);
    }

    @Override
    protected void determineScrollingStart(MotionEvent ev, float touchSlopScale) {
        // If the task overlay is modal, should disable left and right swiping.
        if (getCurrentPageTaskView() != null && !getCurrentPageTaskView().isTaskOverlayModal()) {
            super.determineScrollingStart(ev, touchSlopScale);
        }
    }
    protected boolean shouldStealTouchFromSiblingsBelow(MotionEvent ev) {
        return true;
    }
+4 −0
Original line number Diff line number Diff line
@@ -251,6 +251,10 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
        }
    }

    public boolean isTaskOverlayModal() {
        return mSnapshotView.getTaskOverlay().isOverlayModal();
    }

    public TaskMenuView getMenuView() {
        return mMenuView;
    }