-
-
Notifications
You must be signed in to change notification settings - Fork 495
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
Ghost after drag and drop #991
Conversation
Thank you so much for the PR @tsuharesu @cketti could you possibly also have a look at this change? Would be super interested if this will also positively impact your implementation. |
This looks very similar to the initial implementation. My commit message contains some explanation on why I changed it: ffdc702
Unfortunately, it doesn't say how you get into that state. I believe I was dropping an item and then started dragging another one before the animation of the first item was finished. The behavior in the video looks very strange to me. Maybe using stable IDs will fix the issue? We're also using |
@cketti yes, I read all the commits and that's why I reverted only this piece. I couldn't reproduce what you mentioned in the commit as well. I noticed in your reference that you are using
|
Not using stable IDs probably means the adapter shouldn't be updated while any of the items are being dragged or are in the middle of an animation. I don't see how duplicate items could be avoided otherwise. Mapping UUIDs to somewhat stable IDs is probably less effort than trying to make this work without stable IDs. |
I was excited of this because I implemented the same
itemTouchStopDrag
method locally to clear visuals after I dropped the item, however after this change my list is having a ghost effect.In my
itemTouchDropped
method I update my DB and that triggers a new list being set to FastAdapter withitemAdapter.set(newList)
. According to my logs, the list is being set beforeitemTouchStopDrag
is called.Here is a video of what is happening:
https://user-images.githubusercontent.com/808267/114277375-cafbd780-9a22-11eb-9052-54f21f0b17a8.mp4