mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-01 08:16:49 +00:00
Fix bug that allowed multiple items in one cell
Fixed issue where opening a folder allowed items to be placed on any cell, even if it was occupied. Bug: 3094164 Change-Id: I392e7236f9cd7ea0b09f36e249d2a57c9934dc8e
This commit is contained in:
@@ -456,6 +456,11 @@ public class CellLayout extends ViewGroup implements Dimmable {
|
||||
}
|
||||
|
||||
public boolean addViewToCellLayout(View child, int index, int childId, LayoutParams params) {
|
||||
return addViewToCellLayout(child, index, childId, params, true);
|
||||
}
|
||||
|
||||
public boolean addViewToCellLayout(
|
||||
View child, int index, int childId, LayoutParams params, boolean markCells) {
|
||||
final LayoutParams lp = params;
|
||||
|
||||
// Generate an id for each view, this assumes we have at most 256x256 cells
|
||||
@@ -473,7 +478,7 @@ public class CellLayout extends ViewGroup implements Dimmable {
|
||||
child.setAlpha(getAlpha());
|
||||
addView(child, index, lp);
|
||||
|
||||
markCellsAsOccupiedForView(child);
|
||||
if (markCells) markCellsAsOccupiedForView(child);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -500,6 +505,10 @@ public class CellLayout extends ViewGroup implements Dimmable {
|
||||
clearOccupiedCells();
|
||||
}
|
||||
|
||||
public void removeViewWithoutMarkingCells(View view) {
|
||||
super.removeView(view);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeView(View view) {
|
||||
markCellsAsUnoccupiedForView(view);
|
||||
|
||||
Reference in New Issue
Block a user