Merge "Disable 3-finger workspace scroll" into udc-dev

This commit is contained in:
Tracy Zhou
2023-03-22 05:53:20 +00:00
committed by Android (Google) Code Review
6 changed files with 30 additions and 6 deletions
@@ -21,8 +21,8 @@ import static android.view.MotionEvent.ACTION_MOVE;
import static android.view.MotionEvent.ACTION_UP;
import static android.view.WindowManager.LayoutParams.FLAG_SLIPPERY;
import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_SWIPE_DOWN_WORKSPACE_NOTISHADE_OPEN;
import static com.android.quickstep.MotionEventsUtils.isTrackpadMotionEvent;
import android.graphics.PointF;
import android.util.SparseArray;
@@ -18,6 +18,8 @@ package com.android.quickstep;
import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Surface.ROTATION_0;
import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent;
import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe;
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN;
import static com.android.launcher3.util.DisplayController.CHANGE_ALL;
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
@@ -25,8 +27,6 @@ import static com.android.launcher3.util.DisplayController.CHANGE_ROTATION;
import static com.android.launcher3.util.DisplayController.CHANGE_SUPPORTED_BOUNDS;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import static com.android.launcher3.util.NavigationMode.THREE_BUTTONS;
import static com.android.quickstep.MotionEventsUtils.isTrackpadMotionEvent;
import static com.android.quickstep.MotionEventsUtils.isTrackpadMultiFingerSwipe;
import android.content.Context;
import android.content.res.Resources;
@@ -22,10 +22,10 @@ import static android.view.MotionEvent.ACTION_POINTER_DOWN;
import static android.view.MotionEvent.ACTION_POINTER_UP;
import static android.view.MotionEvent.ACTION_UP;
import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe;
import static com.android.launcher3.config.FeatureFlags.ASSISTANT_GIVES_LAUNCHER_FOCUS;
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
import static com.android.quickstep.GestureState.DEFAULT_STATE;
import static com.android.quickstep.MotionEventsUtils.isTrackpadMultiFingerSwipe;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.FLAG_USING_OTHER_ACTIVITY_INPUT_CONSUMER;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_DOWN;
import static com.android.quickstep.util.ActiveGestureErrorDetector.GestureEvent.MOTION_UP;
@@ -17,9 +17,9 @@ package com.android.quickstep.inputconsumers;
import static android.view.MotionEvent.INVALID_POINTER_ID;
import static com.android.launcher3.MotionEventsUtils.isTrackpadMotionEvent;
import static com.android.launcher3.Utilities.squaredHypot;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_TOUCHING;
import static com.android.quickstep.MotionEventsUtils.isTrackpadMotionEvent;
import android.content.Context;
import android.content.res.Resources;
@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.android.quickstep;
package com.android.launcher3;
import static android.view.MotionEvent.CLASSIFICATION_TWO_FINGER_SWIPE;
+24
View File
@@ -25,6 +25,7 @@ import static com.android.launcher3.LauncherState.FLAG_WORKSPACE_INACCESSIBLE;
import static com.android.launcher3.LauncherState.HINT_STATE;
import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.SPRING_LOADED;
import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe;
import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback;
import static com.android.launcher3.config.FeatureFlags.FOLDABLE_SINGLE_PAGE;
import static com.android.launcher3.logging.StatsLogManager.LAUNCHER_STATE_HOME;
@@ -1064,6 +1065,29 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
}
}
/**
* Needed here because launcher has a fullscreen exclusion rect and doesn't pilfer the pointers.
*/
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
if (isTrackpadMultiFingerSwipe(ev)) {
return false;
}
return super.onInterceptTouchEvent(ev);
}
/**
* Needed here because launcher has a fullscreen exclusion rect and doesn't pilfer the pointers.
*/
@SuppressLint("ClickableViewAccessibility")
@Override
public boolean onTouchEvent(MotionEvent ev) {
if (isTrackpadMultiFingerSwipe(ev)) {
return false;
}
return super.onTouchEvent(ev);
}
/**
* Called directly from a CellLayout (not by the framework), after we've been added as a
* listener via setOnInterceptTouchEventListener(). This allows us to tell the CellLayout