BaseExpandableRecyclerViewAdapter 实现二级列表
效果图
依赖
implementation 'com.hgDendi:expandable-recyclerview-adapter:1.0.1'
xml-main
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/expanded_listView"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
xml-child
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/child"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="子列表"/>
</LinearLayout>
xml-group
<?xml version="1.0" encoding="utf-8"?>
<Lin