Package-level declarations
Types
Scope used for suspending anchored drag blocks. Allows to set UnstyledAnchoredDraggableState.offset to a new value.
DraggableAnchorsConfig stores a mutable configuration anchors, comprised of values of T and corresponding Float positions. This DraggableAnchorsConfig is used to construct an immutable UnstyledDraggableAnchors instance later on.
State of the unstyledAnchoredDraggable modifier. Use the constructor overload with anchors if the anchors are defined in composition, or update the anchors using updateAnchors.
Structure that represents the anchors of a UnstyledAnchoredDraggableState.
Functions
Animate to a targetValue. If the targetValue is not in the set of anchors, the UnstyledAnchoredDraggableState.currentValue will be updated to the targetValue without updating the offset.
Attempt to animate using decay Animation to a targetValue. If the velocity is high enough to get to the target offset, we'll use UnstyledAnchoredDraggableState.decayAnimationSpec to get to that offset and return the consumed velocity. If the velocity is not high enough, we'll use UnstyledAnchoredDraggableState.snapAnimationSpec to reach the target offset.
Reads pointer input events until a drag is detected or all pointers are up. When the final pointer is raised, the up event is returned. When a drag event is detected, the drag change will be returned. Note that if pointerId has been raised, another pointer that is down will be used, if available, so the returned PointerInputChange.id may differ from pointerId. If the position change in the any direction has been consumed by the PointerEventPass.Main pass, then the drag is considered canceled and null is returned. If pointerId is not down when awaitDragOrCancellation is called, then null is returned.
Reads pointer input events until a horizontal drag is detected or all pointers are up. When the final pointer is raised, the up event is returned. When a drag event is detected, the drag change will be returned. Note that if pointerId has been raised, another pointer that is down will be used, if available, so the returned PointerInputChange.id may differ from pointerId. If the position change has been consumed by the PointerEventPass.Main pass, then the drag is considered canceled and null is returned. If pointerId is not down when awaitHorizontalDragOrCancellation is called, then null is returned.
Waits for horizontal drag motion to pass touch slop, using pointerId as the pointer to examine. If pointerId is raised, another pointer from those that are down will be chosen to lead the gesture, and if none are down, null is returned.
Waits for a long press by examining pointerId.
Waits for drag motion to pass touch slop, using pointerId as the pointer to examine. If pointerId is raised, another pointer from those that are down will be chosen to lead the gesture, and if none are down, null is returned. If pointerId is not down when awaitTouchSlopOrCancellation is called, then null is returned.
Reads pointer input events until a vertical drag is detected or all pointers are up. When the final pointer is raised, the up event is returned. When a drag event is detected, the drag change will be returned. Note that if pointerId has been raised, another pointer that is down will be used, if available, so the returned PointerInputChange.id may differ from pointerId. If the position change has been consumed by the PointerEventPass.Main pass, then the drag is considered canceled and null is returned. If pointerId is not down when awaitVerticalDragOrCancellation is called, then null is returned.
Waits for vertical drag motion to pass touch slop, using pointerId as the pointer to examine. If pointerId is raised, another pointer from those that are down will be chosen to lead the gesture, and if none are down, null is returned. If pointerId is not down when awaitVerticalTouchSlopOrCancellation is called, then null is returned.
Gesture detector that waits for pointer down and touch slop in any direction and then calls onDrag for each drag event. It follows the touch slop detection of awaitTouchSlopOrCancellation but will consume the position change automatically once the touch slop has been crossed.
Gesture detector that waits for pointer down and long press, after which it calls onDrag for each drag event.
Gesture detector that waits for pointer down and touch slop in the horizontal direction and then calls onHorizontalDrag for each horizontal drag event. It follows the touch slop detection of awaitHorizontalTouchSlopOrCancellation, but will consume the position change automatically once the touch slop has been crossed.
Gesture detector that waits for pointer down and touch slop in the vertical direction and then calls onVerticalDrag for each vertical drag event. It follows the touch slop detection of awaitVerticalTouchSlopOrCancellation, but will consume the position change automatically once the touch slop has been crossed.
Configure touch dragging for the UI element in a single Orientation. The drag distance reported to DraggableState, allowing users to react on the drag delta and update their state.
Default implementation of DraggableState interface that allows to pass a simple action that will be invoked when the drag occurs.
Create and remember default implementation of DraggableState interface that allows to pass a simple action that will be invoked when the drag occurs.
Snap to a targetValue without any animation. If the targetValue is not in the set of anchors, the UnstyledAnchoredDraggableState.currentValue will be updated to the targetValue without updating the offset.
Enable drag gestures between a set of predefined values.
Create a new UnstyledDraggableAnchors instance using a builder function.