Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checked style is not working #57

Open
ece321 opened this issue May 8, 2017 · 2 comments
Open

Checked style is not working #57

ece321 opened this issue May 8, 2017 · 2 comments

Comments

@ece321
Copy link

ece321 commented May 8, 2017

Checked background and text color is not working. I tried to place it in the XML layout but it doesn't work.

@lazysong
Copy link

lazysong commented Jun 1, 2017

I got the same problem too.

@DroidBoyJr
Copy link

DroidBoyJr commented Jul 29, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants