how to add span size to jetpack compose LazyStaggeredGrid items

Viewed 36

As of compose 1.3.0-beta_2, official LazyStaggeredGrid implementation has been added. However, it does not support Grid Sizes yet. For example if I want only one element in the first row and let the rest to be staggered, I can not set the span value of that first item. My question is, is there a possible workaround for now until the compose team officially add the support? Any idea is appreciated.

EDIT

For more information, you can do something like this in vertical grid:

LazyVerticalGrid(
        columns = GridCells.Fixed(2),
    ) {
        item(span = {GridItemSpan(2)}) { -> LazyStaggeredGrid does not have a parameter like this
            Box() { } -> This will fill both columns
        }
        item {
            Box() {} -> This will fill only one column
        }
    }
0 Answers
Related