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.32k stars 862 forks source link

Animation not working on multi level nesting #349

Open rok5ek opened 7 years ago

rok5ek commented 7 years ago

I'm expanding my RecyclerView on 2 group levels currently, on the first level the group gets animated on expansion correctly, but on the 2nd level the group doesn't animate its children. The children are just displayed per se, without animation, like you would transition from GONE to VISIBLE mode.

I've noticed also that on my 2nd level groups, the method onCheckCanExpandOrCollapseGroup always has a groupPosition of 0. Could this be related to why its not animating, but just displaying children?

I should also mention that the multi level recycler view is in swipeRefreshLayout.

rok5ek commented 7 years ago

multi_level_nesting

It looks similar to this, where on the 2nd level the children are not animated (just a visual reference).

h6ah4i commented 7 years ago

@rok5ek Hi. This library does not support multi level expand feature for now. How do you implement it?

rok5ek commented 7 years ago

@h6ah4i Hey, yeah I though so :/. The way this is currently implemented, is by creating a childView that actually acts as a RecyclerView with a RecyclerViewExpandableItemManager. This solution is not very nice im aware. Maybe in the future there could be a method called treeDepth so the TreeView would be supported. I think if the data structure would be represented as a tree with nodes than the UI implementation also wouldn't be an issue, since all the animations get triggered by notifyItemsRangeInserted. Depending on the treeDepth size, there should be as much onCreateNodeViewHolder methods as there are node levels.

Do you have any other proposition on how should I handle this currently?

h6ah4i commented 7 years ago

@rok5ek I understood what you are trying for. I think it would be worth try the TellH's library instead of mine; https://github.com/TellH/RecyclerTreeView

P.S. Unfortunately, I do not have a plan to support multi level expandable feature in near future 😞

rok5ek commented 7 years ago

@h6ah4i Oh thats awesome, thank you for the link, I was searching for something like that, but I couldn't find it where a RecyclerView would be used. Thank you again! :)