-
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
Endless Scroll Feature Request #749
Comments
I have used the library for a similar project. I don't have the exact code with me anymore but for your particular scenario, there are 2 ways to solve this:
OR
|
Thanks @VaslD! Timestamps is a good idea. I ended up taking out the Endless listener as you suggested and did something like this in my
That got me super close, but it will be called more than once as you are scrolling, so just added a check where I only load the
|
I am creating a messaging screen and am using the Endless Scroll Listener to lazy load old messages. Here is my problem. Currently the callback for
onLoadMore
is only called when you hit the last item minus the threshold. This works great in most cases but imagine this scenario:Message API Limit = 10 messages
I am saving my messages to disk. I have a conversation with 50 messages in it. Then I don't use the app for months. Let's say 50 more messages have been sent to me since I last opened the app. I now have 100 total messages in the server. I open the app again and go to this conversation. The 50 messages that were saved to disk will show. Then I will pull down the latest 10 messages, but I won't try loading more messages until I reach the end of the list. So I have in effect missed out on 40 messages. (10 messages from initial load, plus the 50 stored in the database)
Is there a way to be notified every time I scroll 10 messages so I can download the next 10 messages, whether they are needed to be downloaded or not? Is there a better way to solve this problem that I am not seeing?
The text was updated successfully, but these errors were encountered: