Skip to content

Instantly share code, notes, and snippets.

@anitaa1990
Created December 24, 2018 04:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anitaa1990/c2feaaa239968ab7f711969caf0c5eb7 to your computer and use it in GitHub Desktop.
Save anitaa1990/c2feaaa239968ab7f711969caf0c5eb7 to your computer and use it in GitHub Desktop.
recyclerView.addOnScrollListener(object : RecyclerViewPaginator(recyclerView) {
override val isLastPage: Boolean
get() = viewModel.isLastPage()
override fun loadMore(page: Long) {
viewModel.loadData(page)
}
})
@TobiAlbert
Copy link

TobiAlbert commented Jan 2, 2019

Hi, is there a reason why you used

    override val isLastPage: Boolean
        get() = viewModel.isLastPage()

on line 2 and not

recyclerView.addOnScrollListener(object:RecyclerViewPaginator(recyclerView) {
	override fun isLastPage(): Boolean = viewModel.isLastPage()
	override fun loadMore(page: Long) {
		viewModel.loadData(page)
	})	

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment