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:
@@ -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--
|
||||
|
||||
Reference in New Issue
Block a user