Google se compromete a impulsar la igualdad racial para las comunidades afrodescendientes. Obtén información al respecto.

androidx.compose.foundation.gestures

Interfaces

DraggableState

State of draggable.

DragScope

Scope used for suspending drag blocks

FlingBehavior

Interface to specify fling behavior.

PressGestureScope

Receiver scope for detectTapGestures's onPress lambda.

ScrollableState

An object representing something that can be scrolled.

ScrollScope

Scope used for suspending scroll blocks

TransformableState

State of transformable.

TransformScope

Scope used for suspending transformation operations

Exceptions

GestureCancellationException

A gesture was canceled and cannot continue, likely because another gesture has taken over the pointer input stream.

Enums

Orientation

Class to define possible directions in which common gesture modifiers like draggable and scrollable can drag.

Top-level functions summary

DraggableState
DraggableState(onDelta: (Float) -> Unit)

Default implementation of DraggableState interface that allows to pass a simple action that will be invoked when the drag occurs.

ScrollableState
ScrollableState(consumeScrollDelta: (Float) -> Float)

Default implementation of ScrollableState interface that contains necessary information about the ongoing fling and provides smooth scrolling capabilities.

TransformableState
TransformableState(onTransformation: (zoomChange: Float, panChange: Offset, rotationChange: Float) -> Unit)

Default implementation of TransformableState interface that contains necessary information about the ongoing transformations and provides smooth transformation capabilities.

DraggableState

Create and remember default implementation of DraggableState interface that allows to pass a simple action that will be invoked when the drag occurs.

ScrollableState
rememberScrollableState(consumeScrollDelta: (Float) -> Float)

Create and remember the default implementation of ScrollableState interface that contains necessary information about the ongoing fling and provides smooth scrolling capabilities.

TransformableState
rememberTransformableState(onTransformation: (zoomChange: Float, panChange: Offset, rotationChange: Float) -> Unit)

Create and remember default implementation of TransformableState interface that contains necessary information about the ongoing transformations and provides smooth transformation capabilities.

Extension functions summary

For TransformableState
suspend Unit
TransformableState.animatePanBy(offset: Offset, animationSpec: AnimationSpec<Offset> = SpringSpec(stiffness = Spring.StiffnessLow))

Animate pan by offset Offset in pixels and suspend until its finished

suspend Unit
TransformableState.animateRotateBy(degrees: Float, animationSpec: AnimationSpec<Float> = SpringSpec(stiffness = Spring.StiffnessLow))

Animate rotate by a ratio of degrees clockwise and suspend until its finished.

suspend Unit
TransformableState.animateZoomBy(zoomFactor: Float, animationSpec: AnimationSpec<Float> = SpringSpec(stiffness = Spring.StiffnessLow))

Animate zoom by a ratio of zoomFactor over the current size and suspend until its finished.

suspend Unit

Pan without animation by a offset Offset in pixels and suspend until it's set.

suspend Unit

Rotate without animation by a degrees degrees and suspend until it's set.

suspend Unit