basshelal / BoardView

🚧Work In Progress🚧 Android library for easy to use Kanban Boards
3 stars 0 forks source link

Fix ItemDragShadow's return point #5

Open basshelal opened 4 years ago

basshelal commented 4 years ago

ItemDragShadow doesn't always animate back to the correct return point. This is because of timings and stuff to do with ItemAnimator. We tell ItemDragShadow to return to the points of the target ViewHolder but when those are calculated they were mid-animation, hence ItemDragShadow will return to mid-animation points instead of actual points.

We need to make sure we compute the return point's values at the correct time or at least compensate for this animation stuff somehow.

A good idea would be to do it last second, basically in onReleaseDrag, but this too can be prone to the mid-animation issue. Another thing would be to compute them before a swap is made at all but confirmed that it will be made.