diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java index ce1795aa11..2b2224a600 100644 --- a/src/com/android/launcher3/LauncherRootView.java +++ b/src/com/android/launcher3/LauncherRootView.java @@ -8,7 +8,6 @@ import android.app.ActivityManager; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; -import android.graphics.Insets; import android.graphics.Paint; import android.graphics.Rect; import android.os.Build; diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java index a7ef9ef2a8..ed869bb09a 100644 --- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java +++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java @@ -166,13 +166,22 @@ public class LauncherAccessibilityDelegate extends AccessibilityDelegate impleme } public boolean performAction(final View host, final ItemInfo item, int action) { - if (action == ACTION_LONG_CLICK && ShortcutUtil.isDeepShortcut(item)) { - CustomActionsPopup popup = new CustomActionsPopup(mLauncher, host); - if (popup.canShow()) { - popup.show(); + if (action == ACTION_LONG_CLICK) { + if (ShortcutUtil.isDeepShortcut(item)) { + CustomActionsPopup popup = new CustomActionsPopup(mLauncher, host); + if (popup.canShow()) { + popup.show(); + return true; + } + } else if (host instanceof BubbleTextView) { + // Long press should be consumed for workspace items, and it should invoke the + // Shortcuts / Notifications / Actions pop-up menu, and not start a drag as the + // standard long press path does. + PopupContainerWithArrow.showForIcon((BubbleTextView) host); return true; } } + if (action == MOVE) { beginAccessibleDrag(host, item); } else if (action == ADD_TO_WORKSPACE) { diff --git a/src/com/android/launcher3/dragndrop/DragController.java b/src/com/android/launcher3/dragndrop/DragController.java index 54a44eed30..1b7b01575e 100644 --- a/src/com/android/launcher3/dragndrop/DragController.java +++ b/src/com/android/launcher3/dragndrop/DragController.java @@ -565,11 +565,13 @@ public class DragController implements DragDriver.EventListener, TouchController /** * Since accessible drag and drop won't cause the same sequence of touch events, we manually - * inject the appropriate state. + * inject the appropriate state which would have been otherwise initiated via touch events. */ public void prepareAccessibleDrag(int x, int y) { mMotionDownX = x; mMotionDownY = y; + mLastTouch[0] = x; + mLastTouch[1] = y; } /**