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

快速多次设置setChecked(true)之后的check状态就不准了 #16

Open
bean-liu opened this issue Jul 12, 2017 · 6 comments
Open

Comments

@bean-liu
Copy link

比如接连执行下面这两行代码,根据测试实际效果第一行设置开启,第二行却设置关闭了。。
switchButton.setChecked(true); switchButton.setChecked(true);

@yytyxj
Copy link

yytyxj commented Jun 29, 2018

我也碰到了,是它动画没做完,然后有重复,最终结果出问题了。可以考虑设置动画时间非常短看看

@XiaMuYao
Copy link

XiaMuYao commented Jul 1, 2020

我也遇到了,

@zcweng
Copy link
Owner

zcweng commented Jul 1, 2020 via email

@XiaMuYao
Copy link

XiaMuYao commented Jul 1, 2020

是啊,我发现了 0.3s 以内的问题,但是问题应该在于
if(isChecked()){ //切换到unchecked setUncheckViewState(afterState); }else{ setCheckedViewState(afterState); }
前后两次都是一样的,因为没有修改 afterState 如果我们直接把状态设置好,让动画强制执行就不会有这个问题了

@XiaMuYao
Copy link

XiaMuYao commented Jul 1, 2020

昨天这个问题一直没找到 加班到2点,还好今天发现了

@threedeer
Copy link

请问这个问题怎么修改呢?

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

5 participants