TvGridCells.Fixed

class TvGridCells.Fixed : TvGridCells


Defines a grid with fixed number of rows or columns.

For example, for the vertical TvLazyVerticalGrid Fixed(3) would mean that there are 3 columns 1/3 of the parent width.

Summary

Public constructors

Fixed(count: Int)

Public functions

open List<Int>
Density.calculateCrossAxisCellSizes(availableSize: Int, spacing: Int)

This function is deprecated. Use GridCells from compose foundation.

open operator Boolean
equals(other: Any?)
open Int

Public constructors

Fixed

Added in 1.0.0-alpha11
Deprecated in 1.0.0-alpha11
Fixed(count: Int)

Public functions

calculateCrossAxisCellSizes

open 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 TvLazyVerticalGrid.

spacing: Int

cross axis spacing, e.g. horizontal spacing for TvLazyVerticalGrid. The spacing is passed from the corresponding Arrangement param of the lazy grid.

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int