Controls spacing
The last row may contain spacers, but these also need the correct margins so all controls retain the same dimensions. Fixes: 190089614 Test: manual (controls main activity + add/edit controls) Change-Id: Ie19b98405213bc0f9ef53a11f44cb8013139e562
This commit is contained in:
@@ -422,8 +422,12 @@ class ControlsUiControllerImpl @Inject constructor (
|
||||
// add spacers if necessary to keep control size consistent
|
||||
val mod = selectedStructure.controls.size % maxColumns
|
||||
var spacersToAdd = if (mod == 0) 0 else maxColumns - mod
|
||||
val margin = context.resources.getDimensionPixelSize(R.dimen.control_spacing)
|
||||
while (spacersToAdd > 0) {
|
||||
lastRow.addView(Space(context), LinearLayout.LayoutParams(0, 0, 1f))
|
||||
val lp = LinearLayout.LayoutParams(0, 0, 1f).apply {
|
||||
setMarginStart(margin)
|
||||
}
|
||||
lastRow.addView(Space(context), lp)
|
||||
spacersToAdd--
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user