BaseRecyclerAndAdapter和ItheimaRecyclerView

方便添加HeaderView,FootView,点击,长按,ViewHolder等。

//如果使用数字控制页数可以使用如下api
//设置参数的key
setCurPageKey("curPage");//当前页key
setPageSizeKey("pageSize");//每一页数量的key
//设置参数的值
setPageSize(1);//设置每一页数量
setTotalPage(20);//设置一共有多少页
//如果使用其他方式分页
可以设置setLoadingDataListener在onSuccess(Bean o)回调中处理分页
onSuccess回调在每一次加载数据成功后回调

 

ItheimaRecyclerView使用方式
网格RecyclerView(app:spanCount="2",spanCount取值范围[1,10])
<org.itheima.recycler.widget.ItheimaRecyclerView
    android:id="@+id/recycler_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:spanCount="2"/>
垂直滚动RecyclerView
<org.itheima.recycler.widget.ItheimaRecyclerView
    android:id="@+id/recycler_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"/>
横向滚动RecyclerView(11:一行,12:二行.......,spanCount取值范围[11,19])
<org.itheima.recycler.widget.ItheimaRecyclerView
    android:id="@+id/recycler_view"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:spanCount="12"/>
ItheimaRecyclerView添加头
<FrameLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <org.itheima.recycler.widget.ItheimaRecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <org.itheima.recycler.header.RecyclerViewHeader
        android:id="@+id/recycler_header"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal|top">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="100dp"
            android:text="header"/>
    </org.itheima.recycler.header.RecyclerViewHeader>
</FrameLayout>
 代码传送:https://github.com/open-android/BaseRecyclerAndAdapter

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值