Change Switch state without animation

前端 未结 7 1927
醉酒成梦
醉酒成梦 2020-12-09 07:54

In my Android project, I have a ListView with rows containing SwitchCompat items (AppCompat for Switch widget).

My problem occ

7条回答
  •  独厮守ぢ
    2020-12-09 08:21

    The issue in with animation playing in the list can be present if you use Android Databinding.

    To resolve it, run binding.executePendingBindings() method after you set data – it will refresh binding state for the component in current frame and will not wait for the next one to come.

    As you have probably guessed already – next frame is the animation

提交回复
热议问题