Thread
#compose
    v

    vityokkv73

    2 years ago
    Hi guys, I try to create test application and I need to implement pagination for LazyColumnItems. But I couldn't find how to get current visible item position to trigger loading of next page. Should I just get index of itemContent and compare it with items count?
    m

    molikto

    2 years ago
    Currently there is no support for it. I've seen a PR experiment to add API for this, but not merged yet. I guess they are still not sure what kind of API is the best
    It is pretty easy to add though, if you are willing to make the extra effort to change & compile Compose yourself. (Edit: you can also copy the code out
    Andrey Kulikov

    Andrey Kulikov

    2 years ago
    hey! unfortunately this is not yet supported, but planned. maybe you can try to temporary implement it manually if you add Modifier.onPositioned() for the last item and do your logic when the boundsInRoot are not empty - which means visible
    v

    vityokkv73

    2 years ago
    Thanks, guys, it's just test project, so I can try any working solutions 😃
    amar_1995

    amar_1995

    2 years ago
    Where is this PR experiment API. Can anyone please provide a link
    Timo Drick

    Timo Drick

    2 years ago
    If you want you can use this alternative implementation of LazyColumnItems (VerticalLayoutList) it is used the same way. But in addition you can define a LayoutListPosition which includes state of the list. But for you use case maybe you should add a callback to the constructor which is called when end of list is reached or something like that.https://gitlab.com/timod/compose-playground/-/blob/master/compose_list/src/main/java/de/drick/compose/list/LayoutList.kt
    v

    vityokkv73

    2 years ago
    Thanks, Timo, I will look into your implementation 💪