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

Commit 6813206e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix calculation of empty spaces" into rvc-dev

parents a0caf8fa 1ffaf8c2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -429,7 +429,8 @@ class ControlsUiControllerImpl @Inject constructor (
        }

        // add spacers if necessary to keep control size consistent
        var spacersToAdd = maxColumns - (selectedStructure.controls.size % maxColumns)
        val mod = selectedStructure.controls.size % maxColumns
        var spacersToAdd = if (mod == 0) 0 else maxColumns - mod
        while (spacersToAdd > 0) {
            lastRow.addView(Space(context), LinearLayout.LayoutParams(0, 0, 1f))
            spacersToAdd--