Extract drag detection logic to interface
Currently, only two hardcoded types of dragging (press and long press) are supported by this library.
This PR adds an interface, DragGestureDetector, which is responsible for handling drag detection via PointerInputScope. The interface is taken as a parameter in drag handle functions such as draggableHandle, allowing the user to override the behaviour. This is useful for applications that wish to use non-standard drag detection, such as dragging with middle click or waiting for a long press using a specific length.
API changes (let me know if you'd rather these were reverted):
draggableHandlemethods now have adragGestureDetectorparameter in the last position (with a default value)- The
onDragStartedandonDragStoppedparameters ofReorderableScope.draggableHandleare no longer suspending and do not haveCoroutineScopeas a receiver
The longPressDraggableHandle API is kept the same, but now just calls draggableHandle with DragGestureDetector.LongPress as the dragGestureDetector.