# TagFlowLayout
**Repository Path**: xiquansun/TagFlowLayout
## Basic Information
- **Project Name**: TagFlowLayout
- **Description**: 标签布局
- **Primary Language**: Android
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 1
- **Forks**: 0
- **Created**: 2021-12-15
- **Last Updated**: 2024-12-31
## Categories & Tags
**Categories**: Uncategorized
**Tags**: Android
## README
# TagFlowLayout
#### 介绍
流组
#### 安装教程
> 1. 在根目录下的build.gradle中添加:
```
allprojects {
repositories {
maven {
url 'https://packages.aliyun.com/maven/repository/2173928-snapshot-MaI0SL/'
}
}
}
```
> 2. 在app下的build.gradle中添加:
```
dependencies {
compile 'com.sun.lib_tag:TagFlowLayout:1.0.0-SNAPSHOT'
}
```
#### 使用说明
```
...
// 创建adapter
private class MyAdapter extends TagAdapter{
@Override
public View getView(TagFlowGroup parent, final int position, String s) {
View root = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_tag_editable, parent, false);
STextView textView = root.findViewById(R.id.titleView);
ImageView delView = root.findViewById(R.id.delView);
delView.setVisibility(showDel ? View.VISIBLE : View.GONE);
textView.setText(s);
delView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
del(position);
}
});
return root;
}
}
MyAdapter tagAdapter = new MyAdapter();
tagFlowLayout.setAdapter(tagAdapter);
tagAdapter.setTags("哈哈哈哈", "语文", "数据", "斗破苍穹", "星辰变", "凡人修仙传", "一念之间");
```