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

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

Merge "Fix a couple issues related to drag and drop in Touch Exploration mode"...

Merge "Fix a couple issues related to drag and drop in Touch Exploration mode" into ub-launcher3-master
parents ed6aa189 732b1d46
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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;
+13 −4
Original line number Diff line number Diff line
@@ -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)) {
        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) {
+3 −1
Original line number Diff line number Diff line
@@ -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;
    }

    /**