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

Add animations work; Remove animations are clunky #192

Open littledot opened 2 years ago

littledot commented 2 years ago

Video: https://imgur.com/a/DoDWNvE

Hi, I'm using an animator like so:

    views.list.layoutManager = LinearLayoutManager(context)
    views.list.itemAnimator = SlideInLeftAnimator()

The add animation work nicely, there is cascading effect where the items arrives one by one. However, the remove animation is clunky: all the items are removed at the same time. I would expect the items to be removed one by one as well.

After reading the source, I noticed that BaseItemAnimator uses ViewHolder.getOldPosition() to achieve the cascading effect for remove animations. But for me, the old position is always -1, meaning the RecyclerView is not recording ViewHolder's old position.

Are there any special setup you have to do to make RecyclerView record ViewHolder's old position?

liguopengbenli commented 2 years ago

I have same issue

umesh0492 commented 1 year ago

@littledot @liguopengbenli any fix for the above said ?