Does `ScrollableColumn` not support nested scrolli...
# compose
s
Does
ScrollableColumn
not support nested scrolling? I have a
LazyRowFor
and a
LazyColumnFor
inside a
ScrollableColumn
and it messed up vertical scrolling. Fling scroll doesn't work.
Copy code
ScrollableColumn {
    Text(...)
    LazyRowFor(...)
    LazyColumnFor(...)
}
y
Why not use directly:
Copy code
LazyColumn {
    Text(...)
    LazyRowFor(...)
    // Additional content
}
? (I tried using LazyColumn stand-alone, without nested scrolling, and with very simple items, fling wasn't working and it was super laggy)
s
It's not stable so I'm using
LazyColumnFor
rn. But I'll try with
LazyColumn
. Is there a sample for
LazyColumn
? Looks like it doesn't take a composable argument
y
It does,
LazyColumnFor
and
LazyColumn
use the same composable under the hood
LazyFor
. I'm not sure what are the differences between the two, except that one is wrapping a list of items (LazyColumnFor) while the other has a more similar api with
Column
s
It doesn't... Maybe they changed it in alpha03?
y
content
is what you're looking for
s
Here's the error because content isn't composable
🤔 1
y
They changed it, now you have to wrap items inside an
item
call
💯 1
s
LazyColumnFor's content is composable
y
`
Copy code
LazyColumn {
   item {
      // I'm a composable
   }
}
s
Got it
y
There's also
items
and
itemsIndexed
s
Thanks!
y
Tell me if it's better, I'm curious
s
Lags and fling doesn't work just like
ScrollableColumn
😞 1
a
could you please share the final code you have? yes, it is tricky to have two components scrollable in the same direction nested, but if you use
LazyColumn
dsl instead the fling should work fine
s
Copy code
LazyColumn {
   item {
      Button(...)
      LazyRowFor(...)
      LazyColumnFor(...)
   }
}
I can make a sample project if you want
y
you shouldn't need the LazyColumnFor anymore (I think)
s
So...a loop?
a
Copy code
LazyColumn {
   item {
      Button(...)
   }
   item {
      LazyRowFor(...)
   }
   items(yourList) {
       ... item of the list
   }
}
could you please try something like this?
s
Sure wait
Yeah the fling works great now
Although it's kinda lagging a little more than
LazyColumnFor
but that's expected right now I guess?
d
I had a
ScrollableColumn
with a
LazyColumnFor
inside and fling didn’t work. Replacing the lazy column with a
forEach
did the trick, fling now works perfectly 👌
âž• 1