可分组的 RecyclerView 适配器 ExpandableAdapter

码农软件 · 软件分类 · Android UI 组件 · 2019-04-24 12:13:01

软件介绍

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'

本文地址:https://codercto.com/soft/d/4277.html

自媒体之道

自媒体之道

吴晨光 / 中国人民大学出版社有限公司 / 2018-7-31 / CNY 49.80

内容简介: 《自媒体之道》为你解决四个问题: 1. 一篇10万+的刷屏文章是怎么写出来的? 2. 一支10万+的爆款视频是怎么做出来的? 3. 一个100万+粉丝的大号是怎么运营的? 4. 神秘的人工智能(AI)和备受争议的算法是怎么运行的? 这部超过30万字的著作,集纳了中国顶尖自媒体人和平台运营者3年的实操经验。全书13章,详解案例150+,提炼“锦囊秒句”......一起来看看 《自媒体之道》 这本书的介绍吧!

随机密码生成器
随机密码生成器

多种字符组合密码

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试