What's the right way to have a LazyColumn inside a...
# compose
a
What's the right way to have a LazyColumn inside a Column with
verticalScroll
modifier? For example in the Bloom AndroidDevChallenge app home screen.
c
I don't think you can? That would give you two things with infinite height which compose doesn't allow? Definitely wait for someone that really knows what they're talking about to chime in. 😄
a
Yeah I mean Compose pretty much tells me that I can't so you're right. I'm more wondering how to actually do something like have a sublist. Like if I have a screen, which needs to scroll on small screens (or in landscape mode) but then also has a component in it that is a LazyColumn with items that need to behave as a separate list, maybe allow reordering between those items or something that's only limited to that component. Currently, I just have a normal column since I know it's gonna only have 3 items in there but then the reordering animations in LazyColumn are coming up and I'm wondering how I would use that
animateItemPlacement
Modifier with this setup.
n
What I’m doing is: use a single
LazyColumn
. for static items, use
item
function and for list items, use
items
function… 🤷‍♂️
Copy code
LazyColumn {
    item { YourHeader() }
    item { AnotherStaticItem() }
    items(yourList) { YourListItem(it) }
    item { OneMoreStaticItem() }
}
🤔 1
1
c
@Afzal Najam it looks like andrey kulikov (who seems to know everything there is to know about lazyCols added a + to the above comment, so I think its safe to say that that's the way to move forward)
👍 2
a
Thanks @nglauber and @Colton Idle! Lol, I have a stash with this change now, waiting for the
animateItemPlacement
modifier to get into a release to try it 😄
👍 1