I have this situation. I implemented endless scrolling with RecyclerView. Normally new items are suppose to load when there are only 5 items below the current scroll position but this is not so.
Rather As soon as the first set of items are loaded from the API, another is sent (without scrolling), received and parsed . After which yet another request is sent (still without scrolling) and parsed. This process continues (without scrolling) until the app is exited.
My RecyclerView
mLayoutManager = new LinearLayoutManager(getActivity());
recyclerView.setLayoutManager(mLayoutManager);
recyclerView.setItemAnimator(new FadeInLeftAnimator());
recyclerView.setNestedScrollingEnabled(false);
adapter = new PostAdapter(mPostItemList, getActivity());
recyclerView.setAdapter(adapter);
recyclerView.addOnScrollListener(new EndlessRecyclerViewScrollListener( mLayoutManager) {
@Override
public void onLoadMore(final int page, int totalItemsCount, RecyclerView view) {
Log.w(TAG, "onLoadMore called");
morePostsUrl = postUrl + "&page=" + page;
getMorePostArray(morePostsUrl, true, false);
}
});