Slide 27
Slide 27 text
Auto loading with RecyclerView
recyclerView.scrollEvents()
.mapToPagingEvents(startPagingWith = 1)
.subscribeWhenCompleted { it, completed ->
getFromApi()
.observeOn(AndroidSchedulers.mainThread())
.compose(bindToLifecycle())
.subscribe({
adapter.add(it)
adapter.notifyDataSetChanged()
}, {
// call when error.
completed()
}, {
completed()
})
}