hashtag-view icon indicating copy to clipboard operation
hashtag-view copied to clipboard

Remove all tags (clear all) programmatically

Open dsdebastiani opened this issue 6 years ago • 3 comments

Can I remove all tags programmatically?

hashtagview.removeAll()

I'm using dynamic mode and applying an for each to remove item by item. But the view refresh only once and only the first tagview is removed.

dsdebastiani avatar Jun 04 '18 21:06 dsdebastiani

@dsdebastiani did u solve this?

jay-quetzal avatar Jun 27 '18 04:06 jay-quetzal

Not exactly @jay-quetzal . I had to insert a new empty data and reapply the transformation to erase the tags.

fun updateData(items: ArrayList<TagObject>) {
    hashtagView.setData(items, TAG_TRANSFORM)
}

In my custom View, where the HashtagView is, I wrote a simple function that receives an array and set as new data in the HastagView component. If the array is empty, the tags will be cleared. It's not an ideal solution, but it works.

dsdebastiani avatar Jun 27 '18 18:06 dsdebastiani

@dsdebastiani Sorry for late reply, will add new method and update library soon.

greenfrvr avatar Sep 17 '18 14:09 greenfrvr