kaedea / android-tagview

An Android TagView Widget. You can edit the tag's style, and set listener of selecting or deleting tag.
663 stars 134 forks source link

Add two new methods #26

Closed adrielcafe closed 5 years ago

adrielcafe commented 7 years ago

Related to #16 .

With those new methods, addTag(int position, Tag tag) and replaceTag(int position, Tag tag), It's possible to update a tag style at any time.

Example of usage:

myTag.setOnTagClickListener((id, tag) -> {
  boolean selected = selectedTag.id != tag.id;
  int position = getTagPosition(tag);
  updateTagState(tag, selected);
  myTag.replaceTag(position, tag);
});