Adapter for RecyclerView for load more. As simple as only a file to import to you project. (Did not upload to gist because the network problom. -_-)
- Instantiate this class with a LayoutManager object.
- Call
RecyclerView.addOnScrollListener(LoadMoreRecyclerViewAdapter.getOnRecyclerScrollChangeListener());
to listen the scroll event of RecyclerView. - Call
super.onCreateViewHolder(parent, viewType);
inonCreateViewHolder()
method to create footer view holder. - Call
super.onBindViewHolder(holder, position);
inonBindViewHolder()
method. - Override
getActualItemCount()
method to return actual data item count. - Override
onCreateLoadMoreFooter()
method to create footer view that implements ILoadMoreFooter. - Call
setLoadMoreComplete()
method to complete loading. - Call
setHasMore()
method to configure whether have more data.