Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Pagination in RecyclerView with GridLayoutManager
mediaRecycler.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
if ((gridLayoutManager.findLastVisibleItemPosition() == localDocumentsAdapter.itemCount - DOCUMENT_BUFFER) && dy > 0) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment