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
This commit is contained in:
parent
5cfde85cb6
commit
0270039b98
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue