Closed XxGoliathusxX closed 8 years ago
It would be very helpful if you could implement notifyItemMoved(from, to). Because tinker with normal recyclerview notifyXXX methods and the parent/child notify methods you guys integrated doesnt work well.
I don't think I have a good answer to your question. This library was designed around the idea of children always living under a parent, not sure we cover your situation properly.
I agree mixing the different notify methods is not very good, we are working towards notifyMoved methods for the next version, tracked in #88. That being said I don't know that we would move a child to be "Parentless", only to being contained within a parent. I'll try to ping you when the PR goes up for this to get your input on the direction we take.
Ok I understand that.I think it would be sufficient if the user can swap parents with parents (I already solved that and it works). And inside a parent you can swap children. I think then you would get a very efficient solution for it that doesnt dissolute. Can I send you my code so you can have a look over it? The code contains only the readme example with the swipe and drag behavior, not more.
Resolved in 2.1.0.
Hello, I'm almost done. There is one last problem: How to remove an ChildItem that has no parent? When i drag a child around it can temporary inserted everywhere. It can be that it has no parentitem. Then this childitem shall be removed and added to the nearest parent item. I call notifyItemMoved every time a item gets moved. For the parent the drag&drop behaviour works fantastic. Also swiping is implemented and causes no problems. Only dragging childitems causes problems.