summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/dragndrop
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-03-22 16:34:23 -0700
committerTony Wickham <twickham@google.com>2016-04-06 11:52:42 -0700
commite22172537b9235a5ba41b3054677dd7ed6d89f02 (patch)
tree4912a7b85bbad6f87d89eedf2c80cfd1dfa877c0 /src/com/android/launcher3/dragndrop
parentb4c4dceb83e098392930a3daa934dfb8fbf55db8 (diff)
downloadandroid_packages_apps_Trebuchet-e22172537b9235a5ba41b3054677dd7ed6d89f02.tar.gz
android_packages_apps_Trebuchet-e22172537b9235a5ba41b3054677dd7ed6d89f02.tar.bz2
android_packages_apps_Trebuchet-e22172537b9235a5ba41b3054677dd7ed6d89f02.zip
Disable pinch gesture when accessibility is enabled.
Bug: 27676309 Change-Id: Iba0f04693c494f258ef21d740ee933f9c32a7674
Diffstat (limited to 'src/com/android/launcher3/dragndrop')
-rw-r--r--src/com/android/launcher3/dragndrop/DragLayer.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java
index 58f98bfaa..33ce68313 100644
--- a/src/com/android/launcher3/dragndrop/DragLayer.java
+++ b/src/com/android/launcher3/dragndrop/DragLayer.java
@@ -29,6 +29,7 @@ import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
+import android.util.Log;
import android.view.DragEvent;
import android.view.KeyEvent;
import android.view.MotionEvent;
@@ -43,7 +44,6 @@ import android.widget.TextView;
import com.android.launcher3.AppWidgetResizeFrame;
import com.android.launcher3.CellLayout;
-import com.android.launcher3.Hotseat;
import com.android.launcher3.InsettableFrameLayout;
import com.android.launcher3.ItemInfo;
import com.android.launcher3.Launcher;
@@ -142,9 +142,9 @@ public class DragLayer extends InsettableFrameLayout {
mLauncher = launcher;
mDragController = controller;
- if (!FeatureFlags.LAUNCHER3_DISABLE_PINCH_TO_OVERVIEW) {
- mPinchListener = new PinchToOverviewListener(mLauncher);
- }
+ boolean isAccessibilityEnabled = ((AccessibilityManager) mLauncher.getSystemService(
+ Context.ACCESSIBILITY_SERVICE)).isEnabled();
+ onAccessibilityStateChanged(isAccessibilityEnabled);
}
@Override
@@ -152,6 +152,11 @@ public class DragLayer extends InsettableFrameLayout {
return mDragController.dispatchKeyEvent(event) || super.dispatchKeyEvent(event);
}
+ public void onAccessibilityStateChanged(boolean isAccessibilityEnabled) {
+ mPinchListener = FeatureFlags.LAUNCHER3_DISABLE_PINCH_TO_OVERVIEW || isAccessibilityEnabled
+ ? null : new PinchToOverviewListener(mLauncher);
+ }
+
public void showOverlayView(View overlayView) {
LayoutParams lp = new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
mOverlayView = overlayView;