Skip to content

Instantly share code, notes, and snippets.

@Farhandroid
Last active March 3, 2021 12:40
Show Gist options
  • Save Farhandroid/7c4eacac3461c536f6737fc309867684 to your computer and use it in GitHub Desktop.
Save Farhandroid/7c4eacac3461c536f6737fc309867684 to your computer and use it in GitHub Desktop.
recyclerView.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
super.onScrolled(recyclerView, dx, dy)
if (dy < 0 && firstVisibleItemPosition == 0 && !isLoadMore) {
loadMoreData()
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment