basshelal / BoardView

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

Touch Point detection algorithm should account for margins and empty areas #1

Closed basshelal closed 4 years ago

basshelal commented 4 years ago

Currently the touch point detection algorithm used when drag is started checks only if the touch point is over a valid ViewHolder that is not the currently dragging one, it ignores margins and empty areas. See the gif below:

IssueGif

This needs to be changed so that when the touch point is in the bounds of (margin and padding included) another ViewHolder that is different from itself, it should trigger the swap. This means if callers have VHs with large margins or padding the swaps will still work as expected.

This also means that when a drag is happening over an empty area of a BoardList, like if it is empty or has few items (and thus an empty space at the bottom) swaps won't be triggered until the touch point is over another ViewHolder. This an old issue from Waqti that was hackily solved quite poorly before but we need to properly solve this here in a scalable manner.

basshelal commented 4 years ago

Update: This has mostly been done, just needs some cleanups and fine tuning but it's essentially done.

I won't close yet because it may need some cleanups, especially when we make a new ItemAnimator, but the issue is essentially fixed!