SuperRecyclerView icon indicating copy to clipboard operation
SuperRecyclerView copied to clipboard

OnMoreAsked not being called

Open Peddro opened this issue 11 years ago • 10 comments

Hello. I'm making API calls to get more items as the user reaches the end of the page. That api call gives me 10 at a time. The problem is when the user reaches the end of the page the OnMoreAsked method is not being called. And I believe the problem is with the max number.

Currently I have the following:

<com.malinskiy.superrecyclerview.SuperRecyclerView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/feed_item_recycler_view" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_empty="@layout/emptyview" app:layout_moreProgress="@layout/layout_progress"/>

mSuperRecyclerView.setupMoreListener(new OnMoreListener() { @Override public void onMoreAsked(int numberOfItems, int numberBeforeMore, int currentItemPos) { Toast.makeText(getActivity(), "Older items", Toast.LENGTH_SHORT).show(); } }, 10);

I have tried with different numbers but it is never being triggered. Note: My list can have more than 10 items in it, it just fetches from the backend 10 at a time.

Peddro avatar Mar 11 '15 10:03 Peddro

same issue here, I had 10 set to max, tried a lot of numbers, it gets called when its not even at the bottom of the list and it never gets called again

testgif

slidenerd avatar Mar 17 '15 07:03 slidenerd

I'm having this same issue as well - I've been trying all manner of ways to resolve it (that I could come up with) and have been unable to do so. If anyone who has successfully gotten the OnMoreAsked to function correctly could let us know how they did it, that would be much appreciated. Otherwise, I'm going to keep looking into this.

t0astt avatar Apr 27 '15 02:04 t0astt

Hi everyone, @Peddro, @slidenerd, @t0astt, could one of you please upload a sample of not working onMore? I have a demo which as of now works on all my devices, maybe I missed something.

Thanks

Malinskiy avatar Jul 28 '15 13:07 Malinskiy

Hello @Malinskiy , @Peddro , @slidenerd @t0astt, I am also facing same issue, onMoreAsked never gets called after first attempt. I tried a lot. I am in the middle of development and I can not imagine switching to some other RecyclerView because of this issue (it will take lot of time). Please let me know if you guys have solution to this.

niket-sminq avatar Jul 30 '15 08:07 niket-sminq

Hello @Malinskiy @Peddro @slidenerd @t0astt , guys I found my mistake... and may be urs also... if you call mSuperRecyclerView.setLoadingMore(true) somewhere in your code, then you have to call mSuperRecyclerView.setLoadingMore(false) after some conditions like what I did

@Override public void onMoreAsked(int numberOfItems, int numberBeforeMore, int currentItemPos) { if (!mAllPageLoaded) { mSuperRecyclerView.setLoadingMore(true); mSuperRecyclerView.hideProgress(); mSuperRecyclerView.showMoreProgress(); getListFromServer(++mPageNumber); } else { mSuperRecyclerView.setLoadingMore(false); mSuperRecyclerView.hideProgress(); mSuperRecyclerView.hideMoreProgress(); } }

niket-sminq avatar Jul 30 '15 10:07 niket-sminq

Once I Called mSuperRecyclerView.setLoadingMore(false) , I don't seem to be able to use Loadmore Feature. I tried setting morelistener again, setloadingmore to true . etc . I can use it the first time but thats it, no more again.

Is it true ? I need to load items by selecting various category on the same list ,which are paginated differently. So enabling /disabling/enabling is essential.

yudhir avatar Oct 08 '15 17:10 yudhir

I am also getting same problem after refreshing its not calling onMoreAsked. Please tell me solution.

swatiprabha avatar Jan 02 '16 08:01 swatiprabha

I am also getting same problem after refreshing its not calling onMoreAsked. Please tell me solution.

liuzhanta avatar Oct 18 '16 07:10 liuzhanta

same issue here.

rishabhsri20 avatar Apr 07 '17 05:04 rishabhsri20

same issue here.

pislion avatar Sep 21 '17 02:09 pislion