-
Notifications
You must be signed in to change notification settings - Fork 365
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
RecyclerView Animation #81
Comments
The current example for recycler is calling the animation start in onLayoutChildren which, as you can see, is applying the animation to the children rather than when they are added. The proper path to take is to run the animation from a RecyclerView.ItemAnimator#animateAdd() call so the children are animated when they are added. The drawback to using animateAdd is it'd apply the animations one at a time rather than to the group. The path moving forward is to add native RecyclerView.ItemAnimator support which will hopefully be available in an upcoming release. Thank you for calling this out! |
+1 |
@bret-fears We could probably label this as an |
+1 looking forward to that! |
I think I found an easier solution for that problem than #79 is. In If I change now
to
the animation starts (items will be hidden) but the actual animation is cancelled immediately. After that I can add the start delay and the full animation will be played as expected. What do you think about that? PS: Looks like this change only affects the initial recycler view animation, all other animations (recycler view onClick animation, all sort animations) still work fine and as previously in the sample app. |
@tfonfara I like it! It's simple and solves the issue described by @lokither |
@bret-fears I'm pleased to hear that :) I noticed that you declined your pr, will you integrate my approach into the main code? ;) |
@tfonfara you're welcome to submit a pull request. Otherwise, I'll gladly add that suggested change when I have time to. |
@bret-fears there you go ;) |
@tfonfara cheers! good work. |
Closing this issue for now. Feel free to leave feedback here or open new issues as appropriate. |
@bret-fears thanks a lot for approving and merging! Could you create a new release version from the updated master branch so this change is available as gradle dependency? |
- Bump version number to 1.0.1 for recycler bug fix #81
Hey @bret-fears I don't think this is fixed in version 1.0.2. In the Recycler Example, I still see what @16meyrat commented: RecyclerView is animated is first almost fully displayed, then disappears, and then the animation starts. It's quick but clearly visible...which is not ideal. Is there anything I am missing? Attached video of the sample app Screenrecorder-2021-01-13-15-18-23-263.mp4 |
Also, @tfonfara fix makes children's setStartDelay to stop working. I added the fix manually, and now all RecyclerView children animate at the same time, instead of one by one! Spruce.mp4Edited for adding video. @bret-fears I see this issue is quite old, maybe there is another way to fix this in the latest version? |
@amanzan I have completely forgotten about this. I will re-open and investigate possible options around it so it doesn't interfere with other types of set animations. |
Fix has been merged and is available in patch version 1.0.3 |
When a RecyclerView is animated, it is first fully displayed, then disapears, and then the animation starts. Is their a way to launch the animation as soon as the Activity starts ?
The text was updated successfully, but these errors were encountered: