You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for your library, it is convenient for me to do pulling-up operations in my app.
However, I found that "onLoadMore" method is passively called in the case where the list which uses Paginate initializes. For example, when the list which is initialized only has two items so that it can not fill the phone screen, the onLoadMore method is invoked strangely. I read your source code, and I found some code in the EndScrollListener.java below:
@Override
public void onScroll(AbsListView view, int firstVisibleItemPosition, int visibleItemCount, int totalItemCount) {
if ((totalItemCount - visibleItemCount) <= (firstVisibleItemPosition + visibleThreshold)) {
callback.onEndReached();
}
if (delegate != null) {
delegate.onScroll(view, firstVisibleItemPosition, visibleItemCount, totalItemCount);
}
}
I found that "onEndReached is called" leads to my question. So I change the code above to this:
@Override
public void onScroll(AbsListView view, int firstVisibleItemPosition, int visibleItemCount, int totalItemCount) {
if (((totalItemCount - visibleItemCount) <= (firstVisibleItemPosition + visibleThreshold)) && (totalItemCount != visibleItemCount)) {
// if (((totalItemCount - visibleItemCount) <= (firstVisibleItemPosition + visibleThreshold))) {
callback.onEndReached();
}
if (delegate != null) {
delegate.onScroll(view, firstVisibleItemPosition, visibleItemCount, totalItemCount);
}
}
I use this condition: totalItemCount != visibleItemCount
It seems my queestion has gone out after my change.
Could you please give some advice on my problem and my change on your code? Is my change on your code correct and is there any more efficient solution to solve my question? Please help and sorry for my poor English.If you are puzzled with my question, I will describe my question more detailedly afterwards.
The text was updated successfully, but these errors were encountered:
When onEndReached is called it will call the onLoadMore() method only if you indicate that loading is not currently in progress (by returning false from isLoading()) and that there is more data to load (by returning false from hasLoadedAllItems()). By doing so your are basically saying "I have more pages to load and I'm currently not loading anything" - so the library invokes onLoadMore()
Let me know if I misunderstood you. Also, can you c/p your initialization and callback code?
Thanks for your library, it is convenient for me to do pulling-up operations in my app.
However, I found that "onLoadMore" method is passively called in the case where the list which uses Paginate initializes. For example, when the list which is initialized only has two items so that it can not fill the phone screen, the onLoadMore method is invoked strangely. I read your source code, and I found some code in the EndScrollListener.java below:
I found that "onEndReached is called" leads to my question. So I change the code above to this:
I use this condition:
totalItemCount != visibleItemCount
It seems my queestion has gone out after my change.
Could you please give some advice on my problem and my change on your code? Is my change on your code correct and is there any more efficient solution to solve my question? Please help and sorry for my poor English.If you are puzzled with my question, I will describe my question more detailedly afterwards.
The text was updated successfully, but these errors were encountered: