h6ah4i / android-advancedrecyclerview

RecyclerView extension library which provides advanced features. (ex. Google's Inbox app like swiping, Play Music app like drag and drop sorting)
https://advancedrecyclerview.h6ah4i.com/
Apache License 2.0
5.31k stars 862 forks source link

Group collapse animation #244

Open NSouth opened 8 years ago

NSouth commented 8 years ago

I've been using a custom implementation of this library for a while (so just downloading the latest version would overwrite my customizations).

See the animated GIF below. When collapsing, the "Lab" group disappears and then shows up under "Exams" instead of smoothly moving up beneath it. This used to be a much smoother transition and I'm wondering if someone can help me figure out what's changed in recent Android updates and which classes from this library I need to update to correct this. I've already gone through and tried updating the animator classes, but to no avail. I'd appreciate any tips. Thanks.

Animation of behavior - GIF

h6ah4i commented 8 years ago

Hi. Which version of the old libraries have you been using?

I think this unwanted animation is related to item change animations. The RecyclerView has been changed some times around the change animation. Here is a picked up important revision history of it;


Android Support Library, revision 23.1.0 (October 2015)

Changes for v7 recyclerview library:


Android Support Library, revision 23.2.0 (February 2016)

Changes for v7 RecyclerView library:


source: http://developer.android.com/tools/support-library/index.html#revisions

Thanks

NSouth commented 8 years ago

Thanks for the reply. I haven't been able to get it back to working as smoothly as it did before and, but I played with the following and, while the remove animation is no longer pretty, at least it's short and doesn't bother me as much anymore. I don't have the time to dig into this any deeper, although I'm sure there's a way to make this work as it once did. animator.setMoveDuration(150); animator.setChangeDuration(200); animator.setRemoveDuration(40);

kakai248 commented 6 years ago

I was having the same problem but managed to fix it. I had android:layout_height="wrap_content" on my RecyclerView. With match_parent the remove animation quirk no longer happens.

This depends on your use of course. For my layout, match_parent worked.