Hi, Is it possible to accomplish building a comple...
# compose-android
r
Hi, Is it possible to accomplish building a complex layout as shared below efficiently by composing only those items that are visible ? • The outer list consists of inner lists ( horizontal and vertical) • Last inner list (here Staggered Grid) can be infinitely scrolling • Scrolling behavior appears as if the outer list is being scrolled.
s
Can you put everything in one grid, and have all the items that are not from that last bottom list be ones that take a wider grid span?
a
We use a flattened grid that emulates this with different span sizes and paddings around the items. But staggered grid adds a challenge since we’ve been able to accomplish it all within a lazy vertical grid… Curious if a custom layout here would work best
The items are spliced into individual grid items to be super efficient.
r
Yeah, as @Stylianos Gakis suggested it can be accomplished if it was a grid layout. But we want to do a staggered grid in the last section of the list. @agrosner Any pointers on how we can accomplish this wit custom layout ? Do you mean skipping the idea of nested lists and go with a flattened layout ?
s
Might be able to go full custom lazy layout as well. Take some inspiration from here https://github.com/oleksandrbalan/minabox And then how it is used in “LazyTable” or “ProgramGuide”. I’ve never tried it myself but it may be what you want here
thank you color 1
h
It is recommended on documentation not to nest similar scrolling items in order to avoid future complications in your scrolling. So do not nest vertical scroll inside a vertical, and similar for horizontal nesting horizontal. You can still have a vertical scroll as outer level and each list item to be horizontal scroll.
a
Well it actually will crash the app today , so it’s pretty much impossible. But an official wrapper component that enables this dynamic recycling behavior would be so valuable
r
In iOS, with compositional layout, they can flatten the entire layout allowing all these combinations possible.
👍 1
a
Somebody build it! 🤠
🙌 1