Ensure gridCenters are cleared when dimensions of grid change
This prevents an issue of items that can't be dropped onto the grid, because of missing center values
This commit is contained in:
parent
a429fba97f
commit
3a4f4b47a9
|
@ -129,6 +129,7 @@ class HomeScreenGrid(context: Context, attrs: AttributeSet, defStyle: Int) : Rel
|
||||||
columnCount = newColumnCount
|
columnCount = newColumnCount
|
||||||
cellXCoords = ArrayList(columnCount)
|
cellXCoords = ArrayList(columnCount)
|
||||||
cellYCoords = ArrayList(rowCount)
|
cellYCoords = ArrayList(rowCount)
|
||||||
|
gridCenters.clear()
|
||||||
iconMargin = (context.resources.getDimension(R.dimen.icon_side_margin) * 5 / columnCount).toInt()
|
iconMargin = (context.resources.getDimension(R.dimen.icon_side_margin) * 5 / columnCount).toInt()
|
||||||
redrawWidgets = true
|
redrawWidgets = true
|
||||||
redrawGrid()
|
redrawGrid()
|
||||||
|
|
Loading…
Reference in New Issue