PullLoadView
pull to refresh and loadMore recyclerView
Screenshot
How to use (??MainActivity)
Gradle
add in build.gradle:
compile 'com.github.tosslife:pullloadview:1.1.0'
Xml
After adding the gradle dependencies from above you can go to your xml layout and add the following code for a PullToLoadView:
<com.srx.widget.PullToLoadView
android:id="@+id/pullToLoadView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Java
To set some basic settings use the following java-code:
//??RecyclerView
RecyclerView mRecyclerView = mPullToLoadView.getRecyclerView();
//??????????
mPullToLoadView.isLoadMoreEnabled(true);
//????
mPullToLoadView.setPullCallback(new PullCallback() {
@Override
public void onLoadMore() {
//??????
}
@Override
public void onRefresh() {
//????
}
@Override
public boolean isLoading() {
//?????????
return isLoading;
}
@Override
public boolean hasLoadedAllItems() {
//????????????
return isHasLoadedAll;
}
}
);
//????
mPullToLoadView.initLoad();