arrange

abstract fun arrange(totalSize: Int, sizes: IntArray, orientation: ComponentOrientation, outPositions: IntArray)

Writes each child's offset from the left of totalSize into outPositions, for children whose widths are sizes in declaration order, in a container laid out under orientation. outPositions is as long as sizes.

Both arrays belong to the container laying out and are reused by its next pass: read and write them within this call, and keep neither.

Parameters

totalSize

the container's width inside its insets, the gaps this arrangement holds included.

sizes

the widths already granted, which an arrangement reads and never changes.

orientation

the container's reading order; a right-to-left one mirrors the placement, so Arrangement.Start packs against the right edge.

outPositions

arrives zeroed, so an entry an arrangement leaves alone places that child at the container's left edge, whatever orientation says.