Android 12 Developer Preview is here! Try it out, and give us your feedback!

Adaptive

class Adaptive : GridCells
kotlin.Any
   ↳ androidx.compose.foundation.lazy.GridCells
   ↳ androidx.compose.foundation.lazy.GridCells.Adaptive

Combines cells with adaptive number of rows or columns. It will try to position as many rows or columns as possible on the condition that every cell has at least minSize space and all extra space distributed evenly.

For example, for the vertical LazyVerticalGrid Adaptive(20.dp) would mean that there will be as many columns as possible and every column will be at least 20.dp and all the columns will have equal width. If the screen is 88.dp wide then there will be 4 columns 22.dp each.

Summary

Public constructors
<init>(minSize: Dp)

Combines cells with adaptive number of rows or columns.

Properties
Dp

Public constructors

<init>

Adaptive(minSize: Dp)

Combines cells with adaptive number of rows or columns. It will try to position as many rows or columns as possible on the condition that every cell has at least minSize space and all extra space distributed evenly.

For example, for the vertical LazyVerticalGrid Adaptive(20.dp) would mean that there will be as many columns as possible and every column will be at least 20.dp and all the columns will have equal width. If the screen is 88.dp wide then there will be 4 columns 22.dp each.

Properties

minSize

val minSize: Dp