ExpandableAdapter可分组的 RecyclerView 适配器

联合创作 · 2023-09-24 08:05

ExpandableAdapter,继承自 RecyclerView.Adapter,支持header,child, group, groupchild, footer 分组,并且支持group悬浮效果(Sticky效果)。

运行截图:

示例代码:

1.需要Group悬浮,将RecyclerView包裹在'StickyLayout'里面,并且调用'stickylayout'的init函数传入参数true(true,表示group悬浮,false表示不悬浮)

<com.qbw.recyclerview.expandable.StickyLayout
    android:id="@+id/stickylayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</com.qbw.recyclerview.expandable.StickyLayout>

2.不需要Group悬浮,可直接使用'RecyclerView'

<android.support.v7.widget.RecyclerView
        android:id="@+id/recyclerview"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

下载:

Gradle:

compile 'com.qbw.recyclerview:expandableadapter:2.4.0'
浏览 6
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报