Skip to content
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

Possible bug in endless scroll feature #621

Closed
unveloper opened this issue Jun 7, 2018 · 1 comment
Closed

Possible bug in endless scroll feature #621

unveloper opened this issue Jun 7, 2018 · 1 comment

Comments

@unveloper
Copy link

unveloper commented Jun 7, 2018

Hi there!
First of all thanks for this library, I think it's amazing and very well done!

I'm not sure if I found a bug or I'm doing something wrong...
I think the endless scroll feature doesn't work when a threshold greater than 1 is set.
I have 1000 rows on my db and I retrieve them by a page size of 200.

Before adding them to the adapter I add headers if I need them, so if i retrieve 200 rows is possible that in the adapter the added elements on every "onLoadMoreComplete" will be more than 200 (I say this just to explain my situation but the fact that I add section elements it's not relevant).

This is what I get when I use the default threshold (logged inside the "onLoadMore" method of my EndlessScrollListener):

  • offset = 0 itemcount = 1
  • offset = 200 itemcount = 208 (this is the situazione when I've add 8 headers)
  • offset = 400 itemcount = 408
  • offset = 600 itemcount = 608
  • offset = 800 itemcount = 808
  • offset = 1000 itemcount = 1008

The offset it's always correct, a multiple of my page size.

This is what I get when i use a threshold of 10 or 50 (I'll put more result just to show that the loading become incorrect and random)

First try:

  • offset = 0 itemcount = 1
  • offset = 200 itemcount = 208
  • offset = 200 itemcount = 208
  • offset = 200 itemcount = 208
  • offset = 200 itemcount = 208
  • offset = 200 itemcount = 208
  • offset = 400 itemcount = 408
  • offset = 1400 itemcount = 1408

Second try:

  • offset = 200 itemcount = 208
  • offset = 200 itemcount = 208
  • offset = 200 itemcount = 208
  • offset = 400 itemcount = 408
  • offset = 600 itemcount = 608
  • offset = 1000 itemcount = 1008
  • offset = 1200 itemcount = 1208

Third try:

  • offset = 200, currentPage = 2, itemcount = 208
  • offset = 200, currentPage = 2, itemcount = 208
  • offset = 200, currentPage = 2, itemcount = 208
  • offset = 400, currentPage = 3, itemcount = 408
  • offset = 600, currentPage = 4, itemcount = 608
  • offset = 800, currentPage = 5, itemcount = 808
  • offset = 1400, currentPage = 8, itemcount = 1408

Can you help me?
Thanks

@davideas
Copy link
Owner

davideas commented Jun 27, 2018

@unveloper, sorry but I do not understand your case.

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

No branches or pull requests

2 participants