A PagedAdapter is used to add a function to the RecyclerView that when it slide to the bottom, load another page data to show. while a SelectedAdapter is used to add a function to a RecyclerView that if its a item is clicked, the backgrand of the item will change to selected state.
The both proxy adapter are decoupled from the orignal normal adapter, which hold the data set.
Relating classes are in the _5_page_selected package.
You can use the adapters like this: (May be you should add another more code to initalize a RecyclerView, just as the Activity5.java shows)
adapter = new NormalAdapter5();
selectedAdapter = new SelectedAdapter5(adapter);
pageAdapter = new PageAdapter5(selectedAdapter);
recyclerView.setAdapter(pageAdapter);
recyclerView.addOnScrollListener(new LoadMoreScrollListener5() {
@Override
public void loadMore(int loadedItem, int pageSize) {
// load next page data
presenter.loadMore(loadedItem, pageSize);
}
});
// load first page data
presenter.loadMore(0, pageAdapter.pageSize());
And the app show: