iPaulPro / Android-ItemTouchHelper-Demo

Basic example of using ItemTouchHelper to add drag & drop and swipe-to-dismiss to RecyclerView.
Apache License 2.0
2.51k stars 499 forks source link

Strange behaviour when i start dragging fast #34

Open milos1991 opened 8 years ago

milos1991 commented 8 years ago

I've implemented your method into my project, and i have a few problems, hopefully i will explain it properly:

  1. When dragging items really fast up and down, sometimes it happens that a copy of an item appears in the "background" of a recyclerview, and stays there, you can select it and drag it but it wont move when released. It can be seen when items inside RV are not fixed size.
  2. This is not what you have put but, i've added a textview that represents getAdapterPosition() of adapter in each item, it is working nice until i start "sling shoting" items via drag and sometimes there is a duplicate of a position ( 1 , 2 , 3 , 5 ,5 ,6 ,7) i fixed that issue with notifyDataSetChanged in onItemClear() but that wasn't very fortunate since i get IllegalStateException if i do the same thing.

I know this may be a bit difficult to resolve (cant use debugger since i have some huge recursion before that code which takes forever) and those lists can be really tricky to debug, so any tip or hint would be awesome. Thank you in advance.