has anybody checked the experimental `LazyHorizont...
# compose
j
has anybody checked the experimental
LazyHorizontalStaggeredGrid
in
androidx.compose.foundation
? I'm getting the following exception which seems to indicate that I need to pass in a fixed height (and indeed that fixes it) but it doesn't sound right since its height should depend on the children.
Copy code
java.lang.IllegalArgumentException: LazyHorizontalStaggeredGrid's height should be bound by parent.
my implementation looks like this:
Copy code
LazyHorizontalStaggeredGrid(
    modifier = Modifier.fillMaxWidth(),
    rows = StaggeredGridCells.Fixed(3)
) {
    items(showcaseFeatures) {
        FeatureChip(name = it)
    }
}
a
cc @shikasd
s
For now it works the same way as
LazyGrid
does, taking up the whole height (in horizontal orientation) We are looking into adding a way to define fixed child height and size the grid and staggered grid dynamically
j
so I must either provide a fixed height or place the
LazyHorizontalStaggeredGrid
inside a parent with a fixed height?
s
preferably yes 🙂
k
Lazy and Recycler view to work properly height or width need to be constrained/fixed otherwise lazy/recycling functionality won’t work. I think in compose they made it stricter.