Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ff92353f authored by Lucas Dupin's avatar Lucas Dupin
Browse files

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
parent 6651da43
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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--