Skip to content
This repository has been archived by the owner on Nov 4, 2022. It is now read-only.

OnMoreListener gets triggerred when scrolling up #60

Closed
chaitanya79 opened this issue Aug 6, 2015 · 7 comments
Closed

OnMoreListener gets triggerred when scrolling up #60

chaitanya79 opened this issue Aug 6, 2015 · 7 comments

Comments

@chaitanya79
Copy link

I am trying to user super recycler view to load a list of messages from the server and when I reach the end of pages and start scrolling up again a call is getting triggered to load more messages.

@xingag
Copy link

xingag commented Aug 7, 2015

When I use mRecycler.setupMoreListener(this, 1) ; the onMoreAsked would be called 10 times untils
((totalItemCount - lastVisibleItemPosition) <= ITEM_LEFT_TO_LOAD_MORE ||
(totalItemCount - lastVisibleItemPosition) == 0 && totalItemCount > visibleItemCount)
&& !isLoadingMore) return false; I guess the second param in setupMoreListener is useless!(ListActivity)

@chaitanya79
Copy link
Author

Hi @hush881025 Does the above mentioned issue exist with ultimate recyclerview ?

@xingag
Copy link

xingag commented Aug 7, 2015

yes,it dose

@chaitanya79
Copy link
Author

@hush881025 Thank you.

@xingag
Copy link

xingag commented Aug 7, 2015

you are welcome

@youzai001
Copy link

Maybe we should check whether it's scrolling down or up.
just change SuperRecyclerView.java on line 145 as blow:

@OverRide
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);

if (dy > 5) { // only process it when scrolled down
    processOnMore();
}

if (mExternalOnScrollListener != null)
    mExternalOnScrollListener.onScrolled(recyclerView, dx, dy);
if (mSwipeDismissScrollListener != null)
    mSwipeDismissScrollListener.onScrolled(recyclerView, dx, dy);

}

@raviteja06
Copy link

I did a small hack to get rid of this problem. I replaced the load more layout with a dummy 0dp layout. and after that i had a custom progress dialog in my layout which starts/stops when calls server.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants