mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 03:08:19 +00:00
Decoupling finding the solution and animation of a reorder in CellLayout
Adding new functions to CellLayout, two of them return a solution (calculateReorder, getSimpleReorder) and the other one takes a solution and animates that solution (void performReorder) and it can either submit the solution or just show it for a preview. Right now this two things are done under the same function: int[] performReorder. The need to separate this two functions is because to add this functionality b/188081026 which needs to find soluion without animation and animation solutions that can be calculated in another place. Bug: 188081026 Test: atest ReorderWidgets Change-Id: Ib519d4346f58f9b55aff5008cd3ccbcfe8443d2d
This commit is contained in:
@@ -2439,6 +2439,9 @@ public class Workspace<T extends View & PageIndicator> extends PagedView<T>
|
||||
int reorderX = mTargetCell[0];
|
||||
int reorderY = mTargetCell[1];
|
||||
if (!nearestDropOccupied) {
|
||||
mDragTargetLayout.performReorder((int) mDragViewVisualCenter[0],
|
||||
(int) mDragViewVisualCenter[1], minSpanX, minSpanY, item.spanX, item.spanY,
|
||||
child, mTargetCell, new int[2], CellLayout.MODE_SHOW_REORDER_HINT);
|
||||
mDragTargetLayout.visualizeDropLocation(mTargetCell[0], mTargetCell[1],
|
||||
item.spanX, item.spanY, d);
|
||||
} else if ((mDragMode == DRAG_MODE_NONE || mDragMode == DRAG_MODE_REORDER)
|
||||
|
||||
Reference in New Issue
Block a user