🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

IndirectPointerInputDragCycleDetector.DragDetectionState

Source set: Common
sealed class DragDetectionState

Members

AwaitDown

Source set: Common
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

Source set: Common
enum class AwaitTouchSlop {
                Yes,
                No,
                NotInitialized,
            }

Members

Yes

Source set: Common
Yes

No

Source set: Common
No

NotInitialized

Source set: Common
NotInitialized

AwaitTouchSlop

Source set: Common
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

Source set: Common
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

Source set: Common
class Dragging(var pointerId: PointerId = PointerId(Long.MAX_VALUE)) : DragDetectionState()

State where dragging is happening.