https://kotlinlang.org logo
#compose
Title
# compose
c

Chris Johnson

03/29/2022, 7:26 PM
So I'm not seeing any current way to change your content width/height in
LazyVerticalGrid
or
LazyHorizontalGrid
in 1.2.0-alpha05. It seems like your content's size is determined by the columns/rows, horizontal/vertical arrangement/alignment, and contentPadding. Is there no way to custom it and say I want every item in my LazyVerticalGrid to be 40x80dp?
a

Andrey Kulikov

03/29/2022, 9:31 PM
GridCells
you pass into
LazyVerticalGrid
is now an interface. you can implement it and provide the custom sizes as needed
c

Chris Johnson

03/29/2022, 9:39 PM
Gotcha. Just to confirm, you're specifically talking about providing a custom implementation of GridCell's
calculateCrossAxisCellSizes
like how
Fixed
and
Adaptive
do
Edit: Yep. That was it, thank you!
4 Views