Temporarily disable animation on Lollipop CheckBox

北城余情 提交于 2019-12-06 20:23:32

问题


I have a ListView with rows that include CheckBoxes. This ListView has filtering behavior attached, which recycles those rows by setting new data (via a simple setData() method) as the filter criteria changes. When this occurs, any recycled row that has the checked state changed will update its CheckBox, which in turn triggers the Lollipop animation of the CheckBox being drawn in or out.

The ways in which this is distracting to the user are numerous. How can this animation be disabled temporarily when its state is programmatically updated?


回答1:


Calling jumpDrawablesToCurrentState() on your CheckBox right after calling setChecked will skip the animation.



来源:https://stackoverflow.com/questions/33876792/temporarily-disable-animation-on-lollipop-checkbox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!