google / volley

https://google.github.io/volley
Apache License 2.0
3.37k stars 751 forks source link

Pagination #446

Closed Daeng96 closed 1 year ago

Daeng96 commented 1 year ago

how to use it for pagination?, for example using the paging 3 library.

jpd236 commented 1 year ago

This is a broader question than would be well-suited for this issue tracker, which is about tracking bugs in Volley. Volley is just a tool for making HTTP requests. Designing an API that supports pagination, and then integrating with the paging library, are beyond the scope of this project.

I see an example at https://developer.android.com/reference/kotlin/androidx/paging/PagingSource which loads pages using Retrofit; adapting that to use Volley should be similar, except that you'd need to bridge the suspending load method with Volley's callback-based interface. This would work, but be fairly cludgy, and if I were designing a new app rather than adapting an existing codebase, I'd be inclined to use a different framework for HTTP over Volley which isn't really the best fit for this use case.

For further general questions, I'd recommend a more general-purpose question forum like StackOverflow or our user group at volley-users@googlegroups.com to the extent that the questions are Volley specific.