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

Esme

06/09/2022, 4:24 PM
Is there an implementation available now that you can recommend for staggered grids with lazy?
c

Chris Sinco [G]

06/09/2022, 4:51 PM
Do you have an example of specific staggered effect you're looking for?
e

Esme

06/09/2022, 5:37 PM
I want to obtain something similar to this example, as far as I understand I need to implement a custom layout but in the custom implementations, I've seen it composes all of the items in the list.
c

Chris Sinco [G]

06/09/2022, 6:45 PM
Yes, that likely requires a custom lazy layout, which there’s a new experimental API for this in 1.2.0-beta: https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/package-summary?hl=en#LazyLayout(android[…],kotlin.Function2)
Seems we don’t have thorough docs or codelabs on this yet so stay tuned
cc @Andrey Kulikov who might have some better code sample pointers
a

Andrey Kulikov

06/09/2022, 6:50 PM
Yes, we are planning to provide it, but there is nothing just yet. I actually saw some third party implementation - https://github.com/devDebajo/staggered_lazy_column. Not sure how production ready it is as I didn’t try on my own, but why not to try
e

Esme

06/09/2022, 7:22 PM
going to try those and stay tuned for new updates for custom lazy layout. Thanks for the info and the samples.
3 Views