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

作者你好,标签设置为默认选中第一个之后,能不能加一个From User的监听 #40

Open
TReturn opened this issue Mar 7, 2020 · 1 comment

Comments

@TReturn
Copy link

TReturn commented Mar 7, 2020

判断是用户选择的标签还是框架默认选择的第一个

@donkingliang
Copy link
Owner

目前是没有判断标签是否是用户手动选中的,因为无论是用户点击选中还是初始化是默认选中或者调用setSelects、setCompulsorys选中,都是调用相同的方法处理的,而且区分这个的意义不大。
但是你这个需求其实是可以实现的,你可以setOnLabelClickListener()监听标签的点击事件,用户通过点击改变标签状态时会回调这个监听,如果是默认选中或者通过代码设置选中,就不会回调这个监听。这样你就可以记录那些标签是用户手动选中了。
在点击监听的回调里判断当前标签是否选中:mLabelView.getSelectLabels().contains(position);

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

2 participants