Fix issues with drag and drop from All Apps in non-default grids

=> Also fix the widget tray in these non-default grids, and the external shortcut addition flow. The layout was broken as it was scaling with the icon size. Instead keep it fixed which looks much better, similar to how we maintain all apps.
=> This also fixes a small jump when dragging shortcuts external to Launcher.

issue 154169001

Change-Id: Iad1e3859dd6fedccce9b5c6633e64426a4630c31
This commit is contained in:
Adam Cohen
2020-05-07 11:55:19 -07:00
parent 4f51725717
commit c77bc45fa5
8 changed files with 53 additions and 18 deletions

View File

@@ -1441,6 +1441,10 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
mOutlineProvider = previewProvider;
if (draggableView == null && child instanceof DraggableView) {
draggableView = (DraggableView) child;
}
// The drag bitmap follows the touch point around on the screen
final Bitmap b = previewProvider.createDragBitmap();
int halfPadding = previewProvider.previewPadding / 2;
@@ -1451,12 +1455,8 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
Point dragVisualizeOffset = null;
Rect dragRect = new Rect();
if (draggableView == null && child instanceof DraggableView) {
draggableView = (DraggableView) child;
}
if (draggableView != null) {
draggableView.getVisualDragBounds(dragRect);
draggableView.getSourceVisualDragBounds(dragRect);
dragLayerY += dragRect.top;
dragVisualizeOffset = new Point(- halfPadding, halfPadding);
}