带有上拉/下拉的RecyclerView扩展组件

来源:http://blog.csdn.net/sinat_18268881/article/details/51027735

https://github.com/jianghejie/XRecyclerView

compile 'com.jcodecraeer:xrecyclerview:1.3.2'
<com.jcodecraeer.xrecyclerview.XRecyclerView
    android:id="@+id/lendListView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">
com.jcodecraeer.xrecyclerview.XRecyclerView>
@BindView(R.id.lendListView) XRecyclerView lendListView;

lendListView.setLoadingListener(new XRecyclerView.LoadingListener() {
    @Override
    public void onRefresh() {
        new Handler().postDelayed(new Runnable(){
          public void run() {
              Log.d("提示","下拉刷新");
              lendListView.refreshComplete();
            }
        }, 800);
    }

    @Override
    public void onLoadMore() {
        new Handler().postDelayed(new Runnable(){
            public void run() {
                Log.d("提示","上拉刷新");
                lendListView.loadMoreComplete();
            }
        }, 800);
    }
});

你可能感兴趣的:(Android)