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

@@ -722,11 +722,27 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
}
@Override
public void getVisualDragBounds(Rect bounds) {
public void getWorkspaceVisualDragBounds(Rect bounds) {
DeviceProfile grid = mActivity.getDeviceProfile();
BubbleTextView.getIconBounds(this, bounds, grid.iconSizePx);
}
private int getIconSizeForDisplay(int display) {
DeviceProfile grid = mActivity.getDeviceProfile();
switch (display) {
case DISPLAY_ALL_APPS:
return grid.allAppsIconSizePx;
case DISPLAY_WORKSPACE:
case DISPLAY_FOLDER:
default:
return grid.iconSizePx;
}
}
public void getSourceVisualDragBounds(Rect bounds) {
BubbleTextView.getIconBounds(this, bounds, getIconSizeForDisplay(mDisplay));
}
@Override
public void prepareDrawDragView() {
if (getIcon() instanceof FastBitmapDrawable) {