Package-level declarations

Types

Link copied to clipboard

A fixed threshold will be at an offset away from the first anchor.

Link copied to clipboard
class ResistanceConfig(val basis: Float, val factorAtMin: Float = StandardResistanceFactor, val factorAtMax: Float = StandardResistanceFactor)

Specifies how resistance is calculated in swipeable.

Link copied to clipboard

Contains useful defaults for swipeable and SwipeableState.

Link copied to clipboard
open class SwipeableState<T>(initialValue: T, animationSpec: AnimationSpec<Float> = AnimationSpec, val confirmStateChange: (newValue: T) -> Boolean = { true })

State of the swipeable modifier.

Link copied to clipboard
class SwipeProgress<T>(val from: T, val to: T, val fraction: Float)

Collects information about the ongoing swipe or animation in swipeable.

Link copied to clipboard

Interface to compute a threshold between two anchors/states in a swipeable.

Functions

Link copied to clipboard
fun <T : Any> rememberSwipeableState(initialValue: T, animationSpec: AnimationSpec<Float> = AnimationSpec, confirmStateChange: (newValue: T) -> Boolean = { true }): SwipeableState<T>

Create and remember a SwipeableState with the default animation clock.

Link copied to clipboard
fun <T : Any> rememberSwipeableStateFor(value: T, onValueChange: (T) -> Unit, animationSpec: AnimationSpec<Float> = AnimationSpec): SwipeableState<T>

Create and remember a SwipeableState which is kept in sync with another state, i.e.:

Link copied to clipboard
fun <T> Modifier.swipeable(state: SwipeableState<T>, anchors: Map<Float, T>, orientation: Orientation, enabled: Boolean = true, reverseDirection: Boolean = false, interactionSource: MutableInteractionSource? = null, thresholds: (from: T, to: T) -> ThresholdConfig = { _, _ -> FixedThreshold(56.dp) }, resistance: ResistanceConfig? = resistanceConfig(anchors.keys), velocityThreshold: Dp = VelocityThreshold): Modifier

Enable swipe gestures between a set of predefined states.