How to implement ItemAnimator of RecyclerView to disable the animation of notifyItemChanged

前端 未结 8 1121
有刺的猬
有刺的猬 2020-12-13 03:20

In my project I need disable the \"change\" animation of RecyclerView while notifyItemChanged.

I investigated in the source of Recycl

8条回答
  •  有刺的猬
    2020-12-13 04:07

    I had the same problem. When calling notifyItemChanged there was a red overlay flashing. After experimenting around with your code I finally removed the default Animator by simply calling

    recyclerView.setItemAnimator(null);
    

    on the RecyclerView.

提交回复
热议问题