{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

LazyGridItemSpanScope

@LazyGridScopeMarker
public sealed interface LazyGridItemSpanScope


Scope of lambdas used to calculate the spans of items in lazy grids.

Summary

Public methods

abstract int

The max current line (horizontal for vertical grids) the item can occupy, such that it will be positioned on the current line.

abstract int

The max line span (horizontal for vertical grids) an item can occupy.

Public methods

getMaxCurrentLineSpan

abstract int getMaxCurrentLineSpan()

The max current line (horizontal for vertical grids) the item can occupy, such that it will be positioned on the current line.

For example if LazyVerticalGrid has 3 columns this value will be 3 for the first cell in the line, 2 for the second cell, and 1 for the last one. If you return a span count larger than maxCurrentLineSpan this means we can't fit this cell into the current line, so the cell will be positioned on the next line.

getMaxLineSpan

abstract int getMaxLineSpan()

The max line span (horizontal for vertical grids) an item can occupy. This will be the number of columns in vertical grids or the number of rows in horizontal grids.

For example if LazyVerticalGrid has 3 columns this value will be 3 for each cell.