Simplifying workspace layout

Instead of creating workspace view larger than the screen size (so that it can be
zoomed out), restricting the size to the parent size and bypassing the drag events
directly to Workspace (since the workspace is smaller when zoomed out, it might not
qualify for all events otherwise).

Change-Id: I45e213dd6d16bec5feb6e7cf90bc6f7de4c6d305
This commit is contained in:
Sunny Goyal
2017-11-13 15:58:01 -08:00
parent 96f4961d97
commit ac00cba35c
7 changed files with 33 additions and 189 deletions

View File

@@ -53,6 +53,7 @@ import com.android.launcher3.util.Thunk;
public abstract class ButtonDropTarget extends TextView
implements DropTarget, DragController.DragListener, OnClickListener {
private static final int[] sTempCords = new int[2];
private static final int DRAG_VIEW_DROP_DURATION = 285;
private final boolean mHideParentOnDisable;
@@ -257,9 +258,9 @@ public abstract class ButtonDropTarget extends TextView
super.getHitRect(outRect);
outRect.bottom += mBottomDragPadding;
int[] coords = new int[2];
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, coords);
outRect.offsetTo(coords[0], coords[1]);
sTempCords[0] = sTempCords[1] = 0;
mLauncher.getDragLayer().getDescendantCoordRelativeToSelf(this, sTempCords);
outRect.offsetTo(sTempCords[0], sTempCords[1]);
}
public Rect getIconRect(DragObject dragObject) {