Merge "Update home screen trackpad gesture behaviors" into udc-dev am: 8e9db80dac

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/22079204

Change-Id: I9d0b816e20783b30052c826ca6937f19f0521007
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Tracy Zhou
2023-03-23 19:54:19 +00:00
committed by Automerger Merge Worker
2 changed files with 6 additions and 3 deletions
@@ -20,6 +20,7 @@ import static com.android.launcher3.LauncherState.NORMAL;
import static com.android.launcher3.LauncherState.OVERVIEW; import static com.android.launcher3.LauncherState.OVERVIEW;
import static com.android.launcher3.LauncherState.OVERVIEW_ACTIONS; import static com.android.launcher3.LauncherState.OVERVIEW_ACTIONS;
import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME; import static com.android.launcher3.LauncherState.QUICK_SWITCH_FROM_HOME;
import static com.android.launcher3.MotionEventsUtils.isTrackpadMultiFingerSwipe;
import static com.android.launcher3.anim.AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD; import static com.android.launcher3.anim.AlphaUpdateListener.ALPHA_CUTOFF_THRESHOLD;
import static com.android.launcher3.anim.AnimatorListeners.forEndCallback; import static com.android.launcher3.anim.AnimatorListeners.forEndCallback;
import static com.android.launcher3.anim.Interpolators.ACCEL_0_75; import static com.android.launcher3.anim.Interpolators.ACCEL_0_75;
@@ -161,6 +162,9 @@ public class NoButtonQuickSwitchTouchController implements TouchController,
if ((ev.getEdgeFlags() & Utilities.EDGE_NAV_BAR) == 0) { if ((ev.getEdgeFlags() & Utilities.EDGE_NAV_BAR) == 0) {
return false; return false;
} }
if (isTrackpadMultiFingerSwipe(ev)) {
return false;
}
int stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags(); int stateFlags = SystemUiProxy.INSTANCE.get(mLauncher).getLastSystemUiStateFlags();
if ((stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0) { if ((stateFlags & SYSUI_STATE_OVERVIEW_DISABLED) != 0) {
return false; return false;
@@ -18,7 +18,6 @@ package com.android.quickstep;
import static android.view.Display.DEFAULT_DISPLAY; import static android.view.Display.DEFAULT_DISPLAY;
import static android.view.Surface.ROTATION_0; 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.MotionEventsUtils.isTrackpadMultiFingerSwipe;
import static com.android.launcher3.util.DisplayController.CHANGE_ACTIVE_SCREEN; 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_ALL;
@@ -243,8 +242,8 @@ public class RotationTouchHelper implements DisplayInfoChangeListener {
*/ */
public boolean isInSwipeUpTouchRegion(MotionEvent event, int pointerIndex, public boolean isInSwipeUpTouchRegion(MotionEvent event, int pointerIndex,
BaseActivityInterface activity) { BaseActivityInterface activity) {
if (isTrackpadMotionEvent(event)) { if (isTrackpadMultiFingerSwipe(event)) {
return isTrackpadMultiFingerSwipe(event) && !activity.isResumed(); return true;
} }
return mOrientationTouchTransformer.touchInValidSwipeRegions(event.getX(pointerIndex), return mOrientationTouchTransformer.touchInValidSwipeRegions(event.getX(pointerIndex),
event.getY(pointerIndex)); event.getY(pointerIndex));