Created
February 28, 2016 13:29
-
-
Save pwittchen/add026064c6fa4c2b74d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private InfiniteScrollListener createInfiniteScrollListener() { | |
return new InfiniteScrollListener(maxItemsPerRequest, layoutManager) { | |
@Override public void onScrolledToEnd(final int firstVisibleItemPosition) { | |
// load your items here | |
// logic of loading items will be different depending on your specific use case | |
// when new items are loaded, combine old and new items, pass them to your adapter | |
// and call refreshView(...) method from InfiniteScrollListener class to refresh RecyclerView | |
refreshView(recyclerView, new MyAdapter(items), firstVisibleItemPosition); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment