android_guides icon indicating copy to clipboard operation
android_guides copied to clipboard

disable if no more items

Open danwguy opened this issue 8 years ago • 1 comments

I am working on getting this implemented into my app and I don't see if there is a way to disable this once someone has gotten to the bottom of the list. When that happens, I see in my android monitor it gets called repeatedly an unlimited number of times as long as the user near the bottom of the list. Is there a way to turn it off once the last items have been loaded in, or should I just set the variable to null?

danwguy avatar Oct 23 '17 15:10 danwguy

In my apps, What I did was if the returned list size is less than required list size, then I made a page number negative. before sending server request I'm checking if page number is only positive.

It may not be good idea to turn it off. Because if user wants to refresh list, you have to turn it on again. If you want to remove the listener you can use mRecyclerView.removeOnScrollListener(infiniteScrollListener); and add again using mRecyclerView.addOnScrollListener(infiniteScrollListener);

if you are using it with adapterviews mListView.setOnScrollListener(null) will remove the listener and mListView.setOnScrollListener(mListener) will add it again

nareshkatta99 avatar May 29 '18 07:05 nareshkatta99