Disable 3-finger workspace scroll

Fixes: 274474023
Test: 3-finger horizontal scroll on the workspace doesn't do anything
Change-Id: I32ade8a5c26eae43f5ce9c8c71d47ed0d1abd5a2
This commit is contained in:
Tracy Zhou
2023-03-20 10:57:02 -07:00
parent d3eadb74d3
commit a33fb69603
6 changed files with 30 additions and 6 deletions

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