Cleaning up some reordering issues:
-> Reorder solution should never change unless target cell changes -> Simplified code and improved the behaviour when items' jiggle animations switch from one direction to another. These transitions are now seamless and have no more strange delays. Change-Id: I35d70f275d622501851328584bfcb46eec91ff3b
This commit is contained in:
@@ -2770,7 +2770,8 @@ public class Workspace extends SmoothPagedView
|
||||
ItemInfo info = (ItemInfo) d.dragInfo;
|
||||
|
||||
mTargetCell = findNearestArea((int) mDragViewVisualCenter[0],
|
||||
(int) mDragViewVisualCenter[1], 1, 1, mDragTargetLayout, mTargetCell);
|
||||
(int) mDragViewVisualCenter[1], item.spanX, item.spanY,
|
||||
mDragTargetLayout, mTargetCell);
|
||||
|
||||
setCurrentDropOverCell(mTargetCell[0], mTargetCell[1]);
|
||||
|
||||
@@ -2790,11 +2791,6 @@ public class Workspace extends SmoothPagedView
|
||||
minSpanY = item.minSpanY;
|
||||
}
|
||||
|
||||
int[] reorderPosition = new int[2];
|
||||
reorderPosition = findNearestArea((int) mDragViewVisualCenter[0],
|
||||
(int) mDragViewVisualCenter[1], item.spanX, item.spanY, mDragTargetLayout,
|
||||
reorderPosition);
|
||||
|
||||
boolean nearestDropOccupied = mDragTargetLayout.isNearestDropLocationOccupied((int)
|
||||
mDragViewVisualCenter[0], (int) mDragViewVisualCenter[1], item.spanX,
|
||||
item.spanY, child, mTargetCell);
|
||||
@@ -2805,8 +2801,9 @@ public class Workspace extends SmoothPagedView
|
||||
mTargetCell[0], mTargetCell[1], item.spanX, item.spanY, false,
|
||||
d.dragView.getDragVisualizeOffset(), d.dragView.getDragRegion());
|
||||
} else if ((mDragMode == DRAG_MODE_NONE || mDragMode == DRAG_MODE_REORDER)
|
||||
&& !mReorderAlarm.alarmPending() && (mLastReorderX != reorderPosition[0] ||
|
||||
mLastReorderY != reorderPosition[1])) {
|
||||
&& !mReorderAlarm.alarmPending() && (mLastReorderX != mTargetCell[0] ||
|
||||
mLastReorderY != mTargetCell[1])) {
|
||||
|
||||
// Otherwise, if we aren't adding to or creating a folder and there's no pending
|
||||
// reorder, then we schedule a reorder
|
||||
ReorderAlarmListener listener = new ReorderAlarmListener(mDragViewVisualCenter,
|
||||
|
||||
Reference in New Issue
Block a user