AndroidTagGroup
AndroidTagGroup copied to clipboard
Checked style is not working
trafficstars
Checked background and text color is not working. I tried to place it in the XML layout but it doesn't work.
I got the same problem too.
I tried to go through the code and it seems that if it's not in append mode, the tag wont be set to checked. But if in append mode, the "onTagClickListener" wont be triggered. in function on line 615
class InternalTagClickListener implements OnClickListener { @Override public void onClick(View v) { final TagView tag = (TagView) v; if (isAppendMode) { if (tag.mState == TagView.STATE_INPUT) { // If the clicked tag is in INPUT state, uncheck the previous checked tag if exists. final TagView checkedTag = getCheckedTag(); if (checkedTag != null) { checkedTag.setChecked(false); } } else { // If the clicked tag is currently checked, delete the tag. if (tag.isChecked) { deleteTag(tag); } else { // If the clicked tag is unchecked, uncheck the previous checked tag if exists, // then check the clicked tag. final TagView checkedTag = getCheckedTag(); if (checkedTag != null) { checkedTag.setChecked(false); } tag.setChecked(true); } } } else { if (mOnTagClickListener != null) { mOnTagClickListener.onTagClick(tag.getText().toString()); } } } }
The code
checkedTag.setChecked
and
if (mOnTagClickListener != null) {
mOnTagClickListener.onTagClick(tag.getText().toString());
}
should execute irrespective of append mode or not.