TreeListView
自定义多层级树型列表(UI空闲时更新)
演示图
如何接入
Project层级下的build.gradle文件
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Module层级下的build.gradle文件
implementation 'com.github.DasinWong:TreeListView:1.1'
如何使用
布局中添加控件
android:layout_width="match_parent"
android:layout_height="match_parent">
android:id="@+id/tree_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
创建TreeNode数据集合,调用init方法
mTreeListView.init(treeNodeList, new TreeAdapter.OnNodeClickListener() {
@Override
public void onNodeClicked(TreeNode node, String pathContent) {
Toast.makeText(MainActivity.this, pathContent, Toast.LENGTH_SHORT).show();
}
});