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

oday

02/22/2023, 3:27 PM
I really have tried all sorts of grids and LazyVerticalGrid and LazyVerticalStaggeredGrid, I can’t really figure out how I would do this with a grid… I tried a Box as well but if you add spacer between each item, all items will of course always start at 0,0 so they wont be driving out far like that and then wrap down and if I want to try with a Row, that row is going to keep extending beyond the screen, Column will do vertical one item after the other how would you do this?
this is what I dont want, they’re totally even, i want each row to take up as much as it can before wrapping to the next
A column of rows? but that’s what a grid is ..
k

krzysztof

02/22/2023, 3:29 PM
Sounds like you might want to use Flow Layout https://google.github.io/accompanist/flowlayout/
o

oday

02/22/2023, 3:29 PM
oh so im not crazy!
damn ok
thank you i will try
k

krzysztof

02/22/2023, 3:30 PM
Good luck
s

sindrenm

02/22/2023, 3:38 PM
Sounds like FlowRow, yeah. Although if you want it to be lazy, you might be out of luck, still, unfortunately. You might not need that for your use case, though.
o

oday

02/22/2023, 3:39 PM
no its not even scrollable, the items are sub 20 at most
yeap, that did it
t

Tolriq

02/22/2023, 3:49 PM
For the record it's being deprecated and integrated in Compose 1.4 with some difference so might worth directly looking into the compose native version.
k

krzysztof

02/22/2023, 3:50 PM
Nice, can you point me to the source, please?
The main difference is
crossAxisSpacing
but they are looking into adding this.
o

oday

02/25/2023, 7:45 PM
that PR ain’t going nowhere
12 Views