a lib which can creat tags easily
<groupId>andy.ayaseruri.tagsviewlib</groupId>
<artifactId>tagsviewlib</artifactId>
<version>1.0.3</version>
dependencies {
//...
compile 'andy.ayaseruri.tagsviewlib:tagsviewlib:1.0.3@aar'
//...
}
- Define yout tags view in xml like:
<andy.ayaseruri.tagsviewlib.TagsView
android:id="@+id/tags_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:textPaddingLeft="2dp"
app:textPaddingRight="2dp"
app:textPaddingTop="2dp"
app:textPaddingBottom="1dp"
app:textColor="#757575"
app:textSize="13sp"
app:tagsSpace="8dp" //define the space between tags
app:lineSpace="5dp"
app:tagsBg="@drawable/tags_bg"
app:maxlines="10"/>
2.call init method like:
TagsView tagsView = (TagsView)findViewById(R.id.tags_view);
tagsView.init(ArrayList<String>() arrayList, ITagOnClick iTagOnClick(int postion));