wasabeef / recyclerview-animators

An Android Animation library which easily add itemanimator to RecyclerView items.
Apache License 2.0
11.49k stars 1.98k forks source link

Removal animation does not working #29

Open oktayayar opened 9 years ago

oktayayar commented 9 years ago

I have following codes:

RecyclerView mailList; ....... mailList.setItemAnimator(new SlideInRightAnimator()); mailList.getItemAnimator().setAddDuration(200); mailList.getItemAnimator().setRemoveDuration(200); ......

Although addition animation is woking, removal animation is not working

oktayayar commented 9 years ago

I debugged the codes again and I realized that animateRemove() method in ItemAnimator class is not called. What could cause that issue? (I call notifyItemRemoved() method when an item is removed from dataset)

mohamad-amin commented 8 years ago

I have this problem too! The adding animation works but removing does not. I'm using RecyclerView version 22.2.1

mohamad-amin commented 8 years ago

Well I think it is solved for me now. The problem was that I was calling notifyDataSetChanged() right after adapter.remove(position) and it was cancelling the animation. My solution was to call notifyItemChanged(position) instead of notifyDataSetChanged() before calling adapter.remove(position) and it is solved now.