In my Android project, I have a ListView with rows containing SwitchCompat items (AppCompat for Switch widget).
ListView
SwitchCompat
Switch
My problem occurs when I scroll into the list and getView(...) method of MyAdapter is invoked with a recycled view. I redefine the correct Switch state but the animation is visible.
getView(...)
MyAdapter
recycled
There is a solution to prevent the animation in this case?
Call jumpDrawablesToCurrentState() to skip the animation
jumpDrawablesToCurrentState()
switchCompat.setChecked(true); switchCompat.jumpDrawablesToCurrentState();
1.4m articles
1.4m replys
5 comments
57.0k users