Malinskiy / SuperRecyclerView

Pumped up RecyclerView
2.63k stars 469 forks source link

onMoreAsked is not called after refresh and initial load fits in screen without scroll #98

Open PepijnK opened 8 years ago

PepijnK commented 8 years ago

Hi,

I use the SuperRecyclerView in combination with an adapter that holds different views. This means the adapter is not tied to a list so I don't have many items (5 at max). The first 2 items cover less than the screen. I'm implementing a LoadMoreListener to do lazy fetching of the views which are still outside view-range. It only works when loading everything for the first time:

When I register a MoreListener through setupMoreListener(), the SRV is calling onMoreAsked the very first time. After refreshing, I set a new adapter and resetting the OnLoadListener but now it doesn't trigger onMoreAsked.

rahul-padmakumar commented 8 years ago

Hi PepijnK,

Have you tried to call "setLoadingMore(false)" before setting new adapter and OnLoadListener. As per my investigation your issue may be you have created new OnLoadListener and Adapter but you have not reset the "isLoadingMore" flag based on which OnLoadListener decides whether to call onMoreAsked() or not.

PepijnK commented 8 years ago

I assumed that was handled automatically for me once I notify the SRV about data inserts/modifications. Let me try setting the loading flag manually... Op 26 jun. 2016 06:24 schreef "rahul-padmakumar" notifications@github.com:

Hi PepijnK,

Have you tried to call "setLoadingMore(false)" before setting new adapter and OnLoadListener. As per my investigation your issue may be you have created new OnLoadListener and Adapter but you have not reset the "isLoadingMore" flag based on which OnLoadListener decides whether to call onMoreAsked() or not.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Malinskiy/SuperRecyclerView/issues/98#issuecomment-228583632, or mute the thread https://github.com/notifications/unsubscribe/ADLJEUHaokr53HHgUWIIOsQPr5UWW4I9ks5qPf75gaJpZM4I2cCu .