Pagination with Rx (using Subjects)
I leverage the simple use of a Subject here. Honestly, if you don't have your items coming down via anObservablealready (like through Retrofit or a network request), there's no good reason to use Rx and complicate things.
This example basically sends the page number to a Subject, and the subject handles adding the items. Notice the use ofconcatMapand the return of anObservable<List>from_itemsFromNetworkCall.
For kicks, I've also included aPaginationAutoFragmentexample, this "auto-paginates" without us requiring to hit a button. It should be simple to follow if you got how the previous example works.
Here are some other fancy implementations (while i enjoyed reading them, i didn't land up using them for my real world app cause personally i don't think it's necessary):