Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add animations work; Remove animations are clunky #192

Open
littledot opened this issue Oct 29, 2021 · 2 comments
Open

Add animations work; Remove animations are clunky #192

littledot opened this issue Oct 29, 2021 · 2 comments

Comments

@littledot
Copy link

littledot commented Oct 29, 2021

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
Copy link

I have same issue

@umesh0492
Copy link

@littledot @liguopengbenli any fix for the above said ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants