暂时禁用Lollipop CheckBox上的动画 [英] Temporarily disable animation on Lollipop CheckBox

查看:136
本文介绍了暂时禁用Lollipop CheckBox上的动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个ListView,其中的行包含CheckBoxes.此ListView附加了过滤行为,该行为通过过滤条件更改设置新数据(通过简单的setData()方法)来回收这些行.发生这种情况时,状态更改为checked的任何回收行都将更新其CheckBox,这又将触发CheckBox的Lollipop动画被拉入或拉出.

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?

推荐答案

在调用setChecked之后立即在CheckBox上调用jumpDrawablesToCurrentState()将跳过动画.

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

这篇关于暂时禁用Lollipop CheckBox上的动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆