StaggeredGridCells
Interface
Common
interface StaggeredGridCells
This class describes the count and the sizes of columns in vertical staggered grids, or rows in horizontal staggered grids.
Functions
fun Density.calculateCrossAxisCellSizes(availableSize: Int, spacing: Int): IntArray
Calculates the number of cells and their cross axis size based on availableSize and
spacing.
For example, in vertical grids, spacing is passed from the grid's Arrangement.Horizontal.
The Arrangement.Horizontal will also be used to arrange items in a row if the grid is wider
than the calculated sum of columns.
Note that the calculated cross axis sizes will be considered in an RTL-aware manner -- if the staggered grid is vertical and the layout direction is RTL, the first width in the returned list will correspond to the rightmost column.
Parameters
| availableSize | available size on cross axis, e.g. width of LazyVerticalStaggeredGrid. |
| spacing | cross axis spacing, e.g. horizontal spacing for LazyVerticalStaggeredGrid. The spacing is passed from the corresponding Arrangement param of the lazy grid. |
