Last active
January 30, 2018 14:26
-
-
Save HIFILEO/5aaf9275878a33141d109eebf07063d5 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
compositeDisposable.add(RxRecyclerView.scrollEvents(nowPlayingBinding.recyclerView) | |
.flatMap(recyclerViewScrollEvent -> { | |
if (scrollEventCalculator.isAtScrollEnd()) { | |
return Observable.just(new ScrollEvent(pageNumber + 1)); | |
} else { | |
return Observable.empty(); | |
} | |
}) | |
.debounce(scrollEvent -> Observable.<ScrollEvent>empty().delay(250, TimeUnit.MILLISECONDS)) | |
.subscribe(scrollEvent -> nowPlayingViewModel.processUiEvent(scrollEvent), throwable -> { | |
throw new UnsupportedOperationException("Errors in scroll event unsupported. Crash app."); | |
}) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment