-1

I have a view pager, which has a fragment, that contains recyclerview.

recyclerView contains so much data, and the issue is that it loads all of the data on load, i want it to load only few items on load, and if user scrolls then call onBind of those item.

But currently it calls onBind of all of the items on load.

I used this this project for the integration. If you clone it, you can check it call onBindViewHolder for all of the object on load, and if you add more data in the same project, it will start freezing the layout.

dev90
  • 7,187
  • 15
  • 80
  • 153

1 Answers1

2

I think you should see this Ans. This is a better answer for you. We can do this by using the Layout manager & another way you can do this recyclerView.canScrollVertically(int direction) if you just need to know that is it possible to scroll?

  • 0 : return false all time
  • -1 : for bottom direction
  • 1 : for top direction
Hemant Patel
  • 125
  • 1
  • 4