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

Commit a64b41ea authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't allow swiping down on task to launch when swipe up is disabled"...

Merge "Don't allow swiping down on task to launch when swipe up is disabled" into ub-launcher3-master
parents ffbb5444 6c4eced6
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
import com.android.launcher3.util.PendingAnimation;
import com.android.launcher3.util.TouchController;
import com.android.launcher3.views.BaseDragLayer;
import com.android.quickstep.OverviewInteractionState;
import com.android.quickstep.views.RecentsView;
import com.android.quickstep.views.TaskView;

@@ -117,11 +118,18 @@ public abstract class TaskViewTouchController<T extends BaseDraggingActivity>
                    TaskView view = mRecentsView.getPageAt(i);
                    if (mRecentsView.isTaskViewVisible(view) && mActivity.getDragLayer()
                            .isEventOverView(view, ev)) {
                        mTaskBeingDragged = view;
                        if (!OverviewInteractionState.getInstance(mActivity)
                                .isSwipeUpGestureEnabled()) {
                            // Don't allow swipe down to open if we don't support swipe up
                            // to enter overview.
                            directionsToDetectScroll = SwipeDetector.DIRECTION_POSITIVE;
                        } else {
                            // The task can be dragged up to dismiss it,
                            // and down to open if it's the current page.
                        mTaskBeingDragged = view;
                            directionsToDetectScroll = i == mRecentsView.getCurrentPage()
                                    ? SwipeDetector.DIRECTION_BOTH : SwipeDetector.DIRECTION_POSITIVE;
                        }
                        break;
                    }
                }