Calculate spacers properly

The number of spacers should be how many tiles we can fit, minus
how many we have.

Bug: 152628601
Test: manual
Change-Id: I7cddaba3282068ab6f059baff5ad774ae9bf8b11
This commit is contained in:
Lucas Dupin
2020-04-08 13:35:21 -07:00
parent 6651da4348
commit ff92353f27

View File

@@ -370,7 +370,7 @@ class ControlsUiControllerImpl @Inject constructor (
}
// add spacers if necessary to keep control size consistent
var spacersToAdd = selectedStructure.controls.size % maxColumns
var spacersToAdd = maxColumns - (selectedStructure.controls.size % maxColumns)
while (spacersToAdd > 0) {
lastRow.addView(Space(context), LinearLayout.LayoutParams(0, 0, 1f))
spacersToAdd--