Fixes #1844053. Home was accepting all drops, even when there was no room left for a drop. This change fixes this while retaining the 'snap to vacant cell' ability added in Cupcake.
diff --git a/src/com/android/launcher/CellLayout.java b/src/com/android/launcher/CellLayout.java
index 160dd18..058b22c 100644
--- a/src/com/android/launcher/CellLayout.java
+++ b/src/com/android/launcher/CellLayout.java
@@ -939,7 +939,7 @@
int maxVacantSpanYSpanX;
final Rect current = new Rect();
- private void clearVacantCells() {
+ void clearVacantCells() {
final ArrayList<VacantCell> list = vacantCells;
final int count = list.size();
@@ -980,6 +980,10 @@
* @return True if a vacant cell of the specified dimension was found, false otherwise.
*/
boolean findCellForSpan(int[] cellXY, int spanX, int spanY) {
+ return findCellForSpan(cellXY, spanX, spanY, true);
+ }
+
+ boolean findCellForSpan(int[] cellXY, int spanX, int spanY, boolean clear) {
final ArrayList<VacantCell> list = vacantCells;
final int count = list.size();
@@ -1013,7 +1017,7 @@
}
}
- clearVacantCells();
+ if (clear) clearVacantCells();
return found;
}