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

Commit 0270039b authored by Tony Wickham's avatar Tony Wickham
Browse files

Accessibility fixes for moving items

- Don't open popup when using "move item" action
- Don't announce "Item moved" if dropping on original cell

Bug: 33501751
Change-Id: I7236cd51fc00c357a1d7597e2fcb68c3a7c16b0b
parent 5cfde85c
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -2272,7 +2272,7 @@ public class Workspace extends PagedView
            mDragSourceInternal = (ShortcutAndWidgetContainer) child.getParent();
        }

        if (child instanceof BubbleTextView) {
        if (child instanceof BubbleTextView && !dragOptions.isAccessibleDrag) {
            PopupContainerWithArrow popupContainer = PopupContainerWithArrow
                    .showForIcon((BubbleTextView) child);
            if (popupContainer != null) {
@@ -2524,6 +2524,8 @@ public class Workspace extends PagedView
            }
        }

        boolean droppedOnOriginalCell = false;

        int snapScreen = -1;
        boolean resizeOnDrop = false;
        if (d.dragSource != this) {
@@ -2575,9 +2577,9 @@ public class Workspace extends PagedView
                    minSpanY = item.minSpanY;
                }

                droppedOnOriginalCellDuringTransition = mIsSwitchingState
                        && item.screenId == screenId && item.container == container
                droppedOnOriginalCell = item.screenId == screenId && item.container == container
                        && item.cellX == mTargetCell[0] && item.cellY == mTargetCell[1];
                droppedOnOriginalCellDuringTransition = droppedOnOriginalCell && mIsSwitchingState;

                // When quickly moving an item, a user may accidentally rearrange their
                // workspace. So instead we move the icon back safely to its original position.
@@ -2712,7 +2714,7 @@ public class Workspace extends PagedView
            }
            parent.onDropChild(cell);
        }
        if (d.stateAnnouncer != null) {
        if (d.stateAnnouncer != null && !droppedOnOriginalCell) {
            d.stateAnnouncer.completeAction(R.string.item_moved);
        }
    }