1

I want to achieve pagination in the recycler view (not endless scroll).

Here is the first image:

image 1

When I scroll up I want to listen for that event and go to the next page, when I scroll down I want to listen for that event and go to the previous page

See the below video for a scroll up event https://i.stack.imgur.com/CwNGR.jpg

See the below video for a scroll down event https://i.stack.imgur.com/vAjRJ.jpg

Liam
  • 461
  • 4
  • 27
enou plus
  • 43
  • 1
  • 8
  • 2
    have u tried searching this ? [Here](https://stackoverflow.com/questions/36127734/detect-when-recyclerview-reaches-the-bottom-most-position-while-scrolling) is how u find bottom end and for top end u will be at 0th position and the first completely visible item with 0th one something like [This](https://stackoverflow.com/questions/39558704/pagination-while-scrolling-recycler-view-to-the-top). – ADM Apr 12 '22 at 04:57
  • it does not work – enou plus Apr 12 '22 at 06:02
  • @enou plus instead of just saying it does not work, please provide attempts of what you have tried so that the community may help you – Liam Apr 13 '22 at 08:22
  • What I tried is public void onScrollStateChanged(RecyclerView recyclerView, int newState) { super.onScrollStateChanged(recyclerView, newState); if (!recyclerView.canScrollVertically(1) && newState == SCOLL_STATE_DRAGGING) { Toast.makeText(YourActivity.this, "Reached last and still dragging", Toast.LENGTH_LONG).show(); } } but this will trigger when the user scrolled fastly and reached the bottom I need to detect Recyclerview Drag Even When reached the end https://imgur.com/a/XamC8Np – enou plus Apr 13 '22 at 10:33
  • @enou plus, please include what you tried in your question, not as a comment – Liam Apr 13 '22 at 10:59

0 Answers0