Disable animation on notifyItemRangeInserted()
17,496
try clearing the RecyclerView
item animator
recyclerView.setItemAnimator(null);
you can re-enable your animation after if needed.
recyclerView.setItemAnimator(null);
notifyItemRangeInserted(int positionStart, int itemCount);
recyclerView.setItemAnimator(new DefaultItemAnimator());
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on June 19, 2022Comments
-
Admin about 2 years
I'm using a RecyclerView. After adding items to the RecyclerView, I need to call:
notifyItemRangeInserted(int positionStart, int itemCount);
However, this shows a sort of "slide down" animation. Is there a way that I can disable this animation?
Thanks.