Loading src/com/android/launcher3/CellLayout.java +23 −7 Original line number Diff line number Diff line Loading @@ -2476,8 +2476,12 @@ public class CellLayout extends ViewGroup { } public void reArrangeIcons(int x, int y) { ItemConfiguration solution = new ItemConfiguration(); copyCurrentStateToSolution(solution, false); solution.save(); int[] intersecting = new int[2]; ArrayList<View> views = new ArrayList<>(); Loading Loading @@ -2527,21 +2531,33 @@ public class CellLayout extends ViewGroup { } cluster.shift(ViewCluster.LEFT, 1); Rect clusterRect = cluster.getBoundingRect(); boolean isSolution = false; if (clusterRect.left >= 0 && clusterRect.right <= mCountX && clusterRect.top >= 0 && clusterRect.bottom <= mCountY) { isSolution = true; } else { solution.restore(); } for (View v: cluster.views) { CellAndSpan c = solution.map.get(v); mTmpOccupied.markCells(c, true); } if (isSolution) { solution.cellX = intersecting[0]; solution.cellY = intersecting[1]; solution.spanX = 1; solution.spanY = 1; solution.isSolution = true; for (View v: cluster.views) { CellAndSpan c = solution.map.get(v); mTmpOccupied.markCells(c, true); } if (views.size() > 0 && views.get(0) != null) { performReorder(solution, views.get(0), MODE_ON_DROP); } } } public ReorderAlgorithm createReorderAlgorithm() { return new ReorderAlgorithm(this); Loading Loading
src/com/android/launcher3/CellLayout.java +23 −7 Original line number Diff line number Diff line Loading @@ -2476,8 +2476,12 @@ public class CellLayout extends ViewGroup { } public void reArrangeIcons(int x, int y) { ItemConfiguration solution = new ItemConfiguration(); copyCurrentStateToSolution(solution, false); solution.save(); int[] intersecting = new int[2]; ArrayList<View> views = new ArrayList<>(); Loading Loading @@ -2527,21 +2531,33 @@ public class CellLayout extends ViewGroup { } cluster.shift(ViewCluster.LEFT, 1); Rect clusterRect = cluster.getBoundingRect(); boolean isSolution = false; if (clusterRect.left >= 0 && clusterRect.right <= mCountX && clusterRect.top >= 0 && clusterRect.bottom <= mCountY) { isSolution = true; } else { solution.restore(); } for (View v: cluster.views) { CellAndSpan c = solution.map.get(v); mTmpOccupied.markCells(c, true); } if (isSolution) { solution.cellX = intersecting[0]; solution.cellY = intersecting[1]; solution.spanX = 1; solution.spanY = 1; solution.isSolution = true; for (View v: cluster.views) { CellAndSpan c = solution.map.get(v); mTmpOccupied.markCells(c, true); } if (views.size() > 0 && views.get(0) != null) { performReorder(solution, views.get(0), MODE_ON_DROP); } } } public ReorderAlgorithm createReorderAlgorithm() { return new ReorderAlgorithm(this); Loading