-
Notifications
You must be signed in to change notification settings - Fork 554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with endless scrolling and LOAD_MORE_RESET delay #184
Comments
@Aselox, I get your point, so it's because the RV can't be scrolled due to few elements? Indeed, if 2 bindings are executed in less than 200ms, you loose the chain. But how many items the first load more processes? On the other hand, I need to think a different solution to reset the flag. |
Maybe I can remove the delay. It might work anyway, but I'm not sure. |
@davideas yes, I agree that the server response should not return few items (i reduced the server pagination limit on purpose to test this case) but I think we shoud not rely on the fact that each page should contain enough items that, once rendeded on screen, will make the recyclerview scrollable. Take the case of a tablet with hidpi. The vertical "space" wil be more that the one on a regular smartphone and if 2 pages fit on its screen, the endless scroll is broken. The current solution is not scalable. |
@davideas yes, I would try that too. Why is there a delay to that message? |
@Aselox, I removed the delay, but I had to modify the code in more points. I will commit in rc1 branch and i will create a SNAPSHOT this evening or tomorrow evening. |
@borisdamato, please be aware that, Endless Scrolling is going to be changed very soon. In order to support the new features and a better logic, the behaviors and callbacks methods will be refactored. Please check issue #233 for the latest developments. |
Working with the endless scrolling feature and items limit per page in server replies, I found out that if the limit is small enough for whatever reason, the adapter loads just the first page (other than the initial one, so 2 pages).
This happens because the adapter's
onLoadMoreComplete
method sends theLOAD_MORE_RESET
message to the handler with a delay of 200L (not editable) and before this delay has passed, the viewholder calls the adapter's onLoadMore but finds themLoading
boolean to be true (because the handler is in charge of setting it to false upon receiving the LOAD_MORE_RESET message) and does nothing.At this point it's unable to re-trigger the onLoadMore method because there are few elements in the list for each pag so the recyclerview is not scrollable, the elements can't be recycled and the built-in onBindViewHolder method (which calls the adapter's onLoadMore) can't be re-executed when the delay of the LOAD_MORE_RESET has passed.
I know this can be tricky to read but hope everything is clear. If something is not, please ask.
Is this actually a bug or am mis-implementing something?
@davideas
The text was updated successfully, but these errors were encountered: