ListView and ListAdapter are based on a fixed list, so the current endless scrollers just add more and more data to the end of the list.
But you need a scroller similar to the Google Calendar application, which has a bi-directional endless scroller. The problem with using ListView and ListAdapter in this case is that if you add data to the top of the list, the index of any one item changes so that the list jumps.
If you really think about it in terms of MVC, you will realize that the ListAdapter does not provide a model that is suitable for this need.
Instead of absolute indexing (i.e. 1, 2, 3, 4, etc.) what you really want is relative indexing, so instead of saying, βGive me the element at index 42,β you want to say β here is the item, give me five points before that. " Or do you have something like a calendar date that is absolute; still - unlike your device memory; itβs not actually the beginning or the end, so what you really want here is a βwindowβ to the data section.
The best data model for this would be a kind of double version of the queue, which is partly the LRU cache. You set a limit on the number of elements in the structure. Then, when the previous elements are loaded (the user scrolls), the elements on the back panel are discarded, and when new elements are added (the user scrolls down), the elements on the front panel are discarded.
In addition, you will have a threshold where, if you hit several elements of one edge of the structure, the loadNext event or the loadPrevious event will trigger and call the callback that you configured to enter more data to the edge of the structure.
So, once you understand that your model is completely different, you realize that even the RecyclerView will not help you here, because it is tied to the absolute indexing model. You need some kind of custom subclass of ViewGroup that processes the element views, such as ListView , but can adapt to a double-ended queue. And when you do a code search for something like this, there is nothing there.
Sounds fun. I will send the link when I start the project launch. (Unfortunately, this will not be done in a timely manner to help you right now, sorry.)
Something that may help you a little earlier: look at the implementation of Google Calendar and see how they did it: Google Calendar Git repo