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

Commit 0de0ad15 authored by Steve McKay's avatar Steve McKay
Browse files

Fix exception on event action == CANCEL.

+add New folder shortcut to shortcut display.

Bug: 31857258
Change-Id: Iac542baa418a1c15f66e7034f1a8262dab969921
parent c9628f4c
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -132,6 +132,9 @@ public final class Events {
         * or touch. */
        boolean isActionMove();

        /** Returns true if the action is cancel. */
        boolean isActionCancel();

        // Eliminate the checked Exception from Autoclosable.
        @Override
        public void close();
@@ -253,6 +256,11 @@ public final class Events {
            return mEvent.getActionMasked() == MotionEvent.ACTION_MOVE;
        }

        @Override
        public boolean isActionCancel() {
            return mEvent.getActionMasked() == MotionEvent.ACTION_CANCEL;
        }

        @Override
        public Point getOrigin() {
            return new Point((int) mEvent.getX(), (int) mEvent.getY());
@@ -326,8 +334,8 @@ public final class Events {
                    .append(" isPrimaryButtonPressed=").append(isPrimaryButtonPressed())
                    .append(" isSecondaryButtonPressed=").append(isSecondaryButtonPressed())
                    .append(" isShiftKeyDown=").append(isShiftKeyDown())
                    .append(" isActionDown=").append(isActionDown())
                    .append(" isActionUp=").append(isActionUp())
                    .append(" action(decoded)=").append(
                            MotionEvent.actionToString(mEvent.getActionMasked()))
                    .append(" getOrigin=").append(getOrigin())
                    .append(" isOverItem=").append(isOverItem())
                    .append(" getItemPosition=").append(getItemPosition())
+1 −1
Original line number Diff line number Diff line
@@ -230,7 +230,7 @@ public class BandController extends OnScrollListener {
    public boolean shouldStop(InputEvent input) {
        return isActive()
                && input.isMouseEvent()
                && input.isActionUp();
                && (input.isActionUp() || input.isActionCancel());
    }

    /**
+3 −0
Original line number Diff line number Diff line
@@ -68,6 +68,9 @@ public final class MenuManager extends com.android.documentsui.MenuManager {
        group.addItem(new KeyboardShortcutInfo(
                stringSupplier.apply(R.string.menu_paste_from_clipboard), KeyEvent.KEYCODE_V,
                KeyEvent.META_CTRL_ON));
        group.addItem(new KeyboardShortcutInfo(
                stringSupplier.apply(R.string.menu_create_dir), KeyEvent.KEYCODE_E,
                KeyEvent.META_CTRL_ON));
        group.addItem(new KeyboardShortcutInfo(
                stringSupplier.apply(R.string.menu_select_all), KeyEvent.KEYCODE_A,
                KeyEvent.META_CTRL_ON));
+5 −0
Original line number Diff line number Diff line
@@ -165,6 +165,11 @@ public class TestEvent implements InputEvent {
        return mAction == MotionEvent.ACTION_MOVE;
    }

    @Override
    public boolean isActionCancel() {
        return mAction == MotionEvent.ACTION_CANCEL;
    }

    @Override
    public boolean isOverItem() {
        return mDetails.isOverItem();