Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent checkbox animation after setting the value

Tags:

android

On Android >= 21 (lollipop), if I change the checked status of a checkbox, it does an animation. I want to prevent it.

I tried to temporarily set the stateListAnimator to null, but this did not help. How to prevent the animation?

like image 359
Oliv Avatar asked Oct 20 '22 00:10

Oliv


1 Answers

I had the same issue. This helped me. Just add this after you set the checked state:

checkbox.jumpDrawablesToCurrentState();

I hope I could help you :)

Liam

like image 93
Liam Schäpers Avatar answered Oct 22 '22 00:10

Liam Schäpers