s

    Se7eN

    2 years ago
    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.
    ScrollableColumn {
        Text(...)
        LazyRowFor(...)
        LazyColumnFor(...)
    }
    Yann Badoual

    Yann Badoual

    2 years ago
    Why not use directly:
    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

    Se7eN

    2 years ago
    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
    Yann Badoual

    Yann Badoual

    2 years ago
    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

    Se7eN

    2 years ago
    It doesn't... Maybe they changed it in alpha03?
    Yann Badoual

    Yann Badoual

    2 years ago
    content
    is what you're looking for
    s

    Se7eN

    2 years ago
    Here's the error because content isn't composable
    Yann Badoual

    Yann Badoual

    2 years ago
    They changed it, now you have to wrap items inside an
    item
    call
    s

    Se7eN

    2 years ago
    LazyColumnFor's content is composable
    Yann Badoual

    Yann Badoual

    2 years ago
    `
    LazyColumn {
       item {
          // I'm a composable
       }
    }
    s

    Se7eN

    2 years ago
    Got it
    Yann Badoual

    Yann Badoual

    2 years ago
    There's also
    items
    and
    itemsIndexed
    s

    Se7eN

    2 years ago
    Thanks!
    Yann Badoual

    Yann Badoual

    2 years ago
    Tell me if it's better, I'm curious
    s

    Se7eN

    2 years ago
    Lags and fling doesn't work just like
    ScrollableColumn
    Andrey Kulikov

    Andrey Kulikov

    2 years ago
    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

    Se7eN

    2 years ago
    LazyColumn {
       item {
          Button(...)
          LazyRowFor(...)
          LazyColumnFor(...)
       }
    }
    I can make a sample project if you want
    Yann Badoual

    Yann Badoual

    2 years ago
    you shouldn't need the LazyColumnFor anymore (I think)
    s

    Se7eN

    2 years ago
    So...a loop?
    Andrey Kulikov

    Andrey Kulikov

    2 years ago
    LazyColumn {
       item {
          Button(...)
       }
       item {
          LazyRowFor(...)
       }
       items(yourList) {
           ... item of the list
       }
    }
    could you please try something like this?
    s

    Se7eN

    2 years ago
    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?
    dambakk

    dambakk

    2 years ago
    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 👌