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

How to change background and text color of a selected tag ? #16

Open sajib-4414 opened 8 years ago

sajib-4414 commented 8 years ago

This library offers all other necessary features but i badly in need of this to change color of a selected tag ,so that user can get visual feedback which tag was selected

kaedea commented 8 years ago

need to add selected-state feature

kiaanpillay commented 7 years ago

Any update on this? I need this too!

samernady commented 7 years ago

I've made a work around solution for this : in the TagView.java in the library i added this function : public void replaceAtPosition(int position,Tag tag){ LogUtil.v(TAG,"[remove]position = " + position); mTags.remove(position); mTags.add(position,tag); drawTags(); } and i called it from the main class with tagView.setOnTagClickListener(new OnTagClickListener() { @Override public void onTagClick(int position, Tag tag) { Tag newTag= new Tag(); newTag.tagTextColor = Color.parseColor(colorOfElements); newTag.layoutColorPress = Color.parseColor(colorOfElements); newTag.layoutBorderColor = Color.parseColor(colorOfElements); newTag.layoutBorderSize = 1f; tagView.replaceAtPosition(position,tag); }