If anyone is in need of a LazyGrid that supports s...
# compose
b
If anyone is in need of a LazyGrid that supports staggered layout here is the implementation that I've been working on: https://twitter.com/brandonmcansh/status/1402327080352862208?s=21
🙌🏻 2
🙌🏼 1
🙌 2
🙌🏽 1
Source gist is available here https://t.co/cSrthmn3LV
@Zach Klippenstein (he/him) [MOD] I think I'm going to submit this upstream for LazyGrid, restructuring how the grid is laid out (column based instead of row based) make both symmetrical grids and staggered grids work
z
Awesome!!
a
Unfortunately your implementation is not really lazy, meaning that all the items are composed at once. Not only the visible ones as it is done in
LazyVerticalGrid
. This happens because you use
LazyColumn
with only one item() inside it. It is basically the same as if you just do
Column(Modifier.verticalScroll())
. There is no good way to implement it really lazily with the current public API if not reimplementing from scratch the whole LazyList. For 1.1 we are considering trying to see if we can provide something similar to LayoutManagers of RecyclerView to unblock such use cases
👍 5
b
Ah yeah I see that looking at it. :/
c
Compose 1.1 coming in August, right? /s