sealed class DragDetectionState
Members
AwaitDown
class AwaitDown(
var awaitTouchSlop: AwaitTouchSlop = AwaitTouchSlop.NotInitialized,
var consumedOnInitial: Boolean = false,
var hasSeenInitialEvent: Boolean = false,
) : DragDetectionState()
Starter state for any drag gesture cycle. At this state we're waiting for a Down event to indicate that a drag gesture may start. Since drag gesture start at the initial pass we have the option to indicate if we consumed the event during the initial pass using consumedOnInitial. We also save the awaitTouchSlop between passes so we don't call the DragGestureNode.startDragImmediately as often.
Members
AwaitTouchSlop
enum class AwaitTouchSlop {
Yes,
No,
NotInitialized,
}
Members
Yes
Yes
No
No
NotInitialized
NotInitialized
AwaitTouchSlop
class AwaitTouchSlop(
var initialDown: IndirectPointerInputChange? = null,
var pointerId: PointerId = PointerId(Long.MAX_VALUE),
var verifyConsumptionInFinalPass: Boolean = false,
) : DragDetectionState()
If drag should wait for touch slop, after the initial down recognition we move to this state. Here we will collect drag events until touch slop is crossed.
AwaitGesturePickup
class AwaitGesturePickup(
var initialDown: IndirectPointerInputChange? = null,
var pointerId: PointerId = PointerId(Long.MAX_VALUE),
var touchSlopDetector: TouchSlopDetector? = null,
) : DragDetectionState()
Alternative state that implements the gesture pick up feature. If a draggable loses an event because someone else consumed it, it can still pick it up later if the consumer "gives up" on that gesture. Once a gesture is lost the draggable will pass on to this state until all fingers are up.
Dragging
class Dragging(var pointerId: PointerId = PointerId(Long.MAX_VALUE)) : DragDetectionState()
State where dragging is happening.