Add FeatureFlags.LAUNCHER3_DISABLE_PINCH_TO_OVERVIEW
am: 9c43182
* commit '9c43182ff1d095b1bbaacedefe6e0f4c2deb17e3':
Add FeatureFlags.LAUNCHER3_DISABLE_PINCH_TO_OVERVIEW
This commit is contained in:
@@ -37,6 +37,7 @@ public final class FeatureFlags {
|
||||
public static boolean LAUNCHER3_LEGACY_FOLDER_ICON = false;
|
||||
public static boolean LAUNCHER3_LEGACY_LOGGING = false;
|
||||
public static boolean LAUNCHER3_USE_SYSTEM_DRAG_DRIVER = false;
|
||||
public static boolean LAUNCHER3_DISABLE_PINCH_TO_OVERVIEW = false;
|
||||
|
||||
// This flags is only defined to resolve some build issues.
|
||||
public static boolean LAUNCHER3_ICON_NORMALIZATION = false;
|
||||
|
||||
@@ -56,6 +56,7 @@ import com.android.launcher3.ShortcutAndWidgetContainer;
|
||||
import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.Workspace;
|
||||
import com.android.launcher3.accessibility.LauncherAccessibilityDelegate;
|
||||
import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.folder.Folder;
|
||||
import com.android.launcher3.folder.FolderIcon;
|
||||
import com.android.launcher3.util.Thunk;
|
||||
@@ -115,7 +116,7 @@ public class DragLayer extends InsettableFrameLayout {
|
||||
private Drawable mRightHoverDrawableActive;
|
||||
|
||||
// Related to pinch-to-go-to-overview gesture.
|
||||
private PinchToOverviewListener mPinchListener;
|
||||
private PinchToOverviewListener mPinchListener = null;
|
||||
/**
|
||||
* Used to create a new DragLayer from XML.
|
||||
*
|
||||
@@ -141,7 +142,9 @@ public class DragLayer extends InsettableFrameLayout {
|
||||
mLauncher = launcher;
|
||||
mDragController = controller;
|
||||
|
||||
mPinchListener = new PinchToOverviewListener(mLauncher);
|
||||
if (!FeatureFlags.LAUNCHER3_DISABLE_PINCH_TO_OVERVIEW) {
|
||||
mPinchListener = new PinchToOverviewListener(mLauncher);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -250,7 +253,7 @@ public class DragLayer extends InsettableFrameLayout {
|
||||
}
|
||||
clearAllResizeFrames();
|
||||
|
||||
if (mPinchListener.onInterceptTouchEvent(ev)) {
|
||||
if (mPinchListener != null && mPinchListener.onInterceptTouchEvent(ev)) {
|
||||
// Stop listening for scrolling etc. (onTouchEvent() handles the rest of the pinch.)
|
||||
return true;
|
||||
}
|
||||
@@ -369,7 +372,9 @@ public class DragLayer extends InsettableFrameLayout {
|
||||
|
||||
// This is only reached if a pinch was started from onInterceptTouchEvent();
|
||||
// this continues sending events for it.
|
||||
mPinchListener.onTouchEvent(ev);
|
||||
if (mPinchListener != null) {
|
||||
mPinchListener.onTouchEvent(ev);
|
||||
}
|
||||
|
||||
if (action == MotionEvent.ACTION_DOWN) {
|
||||
if (handleTouchDown(ev, false)) {
|
||||
|
||||
Reference in New Issue
Block a user