GridCells
-
Cmn
interface GridCells
GridCells.Adaptive |
Defines a grid with as many rows or columns as possible on the condition that every cell has at least |
GridCells.FixedSize |
Defines a grid with as many rows or columns as possible on the condition that every cell takes exactly |
GridCells.Fixed |
Defines a grid with fixed number of rows or columns. |
This class describes the count and the sizes of columns in vertical grids, or rows in horizontal grids.
Summary
Nested types |
|---|
class GridCells.Adaptive : GridCellsDefines a grid with as many rows or columns as possible on the condition that every cell has at least |
class GridCells.Fixed : GridCellsDefines a grid with fixed number of rows or columns. |
class GridCells.FixedSize : GridCellsDefines a grid with as many rows or columns as possible on the condition that every cell takes exactly |
Public functions |
||
|---|---|---|
List<Int> |
Density.calculateCrossAxisCellSizes(availableSize: Int, spacing: Int)Calculates the number of cells and their cross axis size based on |
Cmn
|
Public functions
calculateCrossAxisCellSizes
fun Density.calculateCrossAxisCellSizes(availableSize: Int, spacing: Int): List<Int>
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 grid is vertical and the layout direction is RTL, the first width in the returned list will correspond to the rightmost column.
| Parameters | |
|---|---|
availableSize: Int |
available size on cross axis, e.g. width of |
spacing: Int |
cross axis spacing, e.g. horizontal spacing for |