https://kotlinlang.org logo
#compose
Title
# compose
r

Remon Shehata

10/10/2023, 5:02 PM
Hey, I used to have a scroll listener to recycler view to know when I reached the end of the list so I could get data for the next page (pagination). how can I achieve the same in compose?
d

dewildte

10/10/2023, 5:26 PM
LazyListState
lets you subscribe to what items are visible on the screen. But I (personally) suggest using the Paging 3 Library and offload all that complexity to it.
r

Remon Shehata

10/10/2023, 5:35 PM
will check that..thanks
s

Stylianos Gakis

10/11/2023, 6:09 PM
Paging3 still has integration with RecyclerView but not compose LazyColumn right? So in that case you say to use RV with compose for the individual items, is that correct Eric?
d

dewildte

10/11/2023, 7:59 PM
Paging 3 has compatibility with Compose, it’s in the docs.
Copy code
// optional - Jetpack Compose integration
  implementation("androidx.paging:paging-compose:3.3.0-alpha02")
s

Stylianos Gakis

10/11/2023, 8:23 PM
Right, but does this also take care of dispatching requests of more pages as you are reaching the edges and so on? If yes I had no idea 😲
👌 1
6 Views