Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a2586db authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove accessibility long click option if no long click action occurs."...

Merge "Remove accessibility long click option if no long click action occurs." into ub-launcher3-master
parents 2d652c1d ff65674a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -157,8 +157,8 @@ public class LauncherAccessibilityDelegate extends AccessibilityDelegate impleme
    }

    private boolean itemSupportsLongClick(View host, ItemInfo info) {
        return new CustomActionsPopup(mLauncher, host).canShow()
                || ShortcutUtil.supportsShortcuts(info);
        return PopupContainerWithArrow.canShow(host, info)
                || new CustomActionsPopup(mLauncher, host).canShow();
    }

    private boolean itemSupportsAccessibleDrag(ItemInfo item) {
@@ -181,7 +181,7 @@ public class LauncherAccessibilityDelegate extends AccessibilityDelegate impleme

    public boolean performAction(final View host, final ItemInfo item, int action) {
        if (action == ACTION_LONG_CLICK) {
            if (ShortcutUtil.supportsShortcuts(item)) {
            if (PopupContainerWithArrow.canShow(host, item)) {
                // 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.
+8 −1
Original line number Diff line number Diff line
@@ -184,6 +184,13 @@ public class PopupContainerWithArrow<T extends BaseDraggingActivity> extends Arr
        return false;
    }

    /**
     * Returns true if we can show the container.
     */
    public static boolean canShow(View icon, ItemInfo item) {
        return icon instanceof BubbleTextView && ShortcutUtil.supportsShortcuts(item);
    }

    /**
     * Shows the notifications and deep shortcuts associated with {@param icon}.
     * @return the container if shown or null.
@@ -196,7 +203,7 @@ public class PopupContainerWithArrow<T extends BaseDraggingActivity> extends Arr
            return null;
        }
        ItemInfo item = (ItemInfo) icon.getTag();
        if (!ShortcutUtil.supportsShortcuts(item)) {
        if (!canShow(icon, item)) {
            return null;
        }