Open cwfei opened 7 years ago
@cwfei Hi. This library expects stable ID for swiping feature, and it seems that your adapter does not support stable IDs properly.
@Override
public long getItemId(int position) {
// return position; <- this is not stable!
// should returns stable value. IDs have to be kept the same value
// even after its position has been changed.
return mItems.get(position).getId();
}
related issues:
Thanks for reply, I'm confused with stableIds, what kind of ids should I return? Currently I'm returning the primary key (Id) of every item, is it correct?
primary key (Id) of every item
Sorry, I thought the behavior looked exactly the same as when the adapter just returning position
. If they keeps the same value after removing an item, that would be perfect for item IDs.
Do you use custom ItemAnimator
or any other RecyclerView
extension libraries?
I didn't use any recyclerview extension libraries and only use the animator that included in your sample.
Hi. Any progress on this? I have not reproduced it yet and I have no idea to solve this 😥
Hi there, this is my latest result, https://youtu.be/7lGDjUfFVNM
Unfortunately I still can't get it working properly.
Thanks for the new video, it helps me a lot! I noticed that the issue only present when the list does not have sufficient items to fill the whole of screen. It seems you are using wrap_content
for RecyclerView, but I guess swipe dismiss animation won't work well in this situation. I'll try to reproduce it later and find any workarounds.
EDIT:
match_parent
for RecyclerView
.
Hi there, I have problems implementing the Basic Swipe, I read your sample project over and over again and still I can't figure out the issues. Whenever I swiping an item to the right to remove it, the item will be removed before the animation finish. Fyi, I have no problem with stableIds.
Here's the video for your better understanding https://youtu.be/ZUGOsEykDgM