SwipeableDefaults

Added in 1.0.0
Deprecated in 1.6.0

Contains useful defaults for swipeable and SwipeableState.

Summary

Constants

const Float

This property is deprecated. Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs.

Cmn
const Float

This property is deprecated. Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs.

Cmn

Public functions

ResistanceConfig?
resistanceConfig(
    anchors: Set<Float>,
    factorAtMin: Float,
    factorAtMax: Float
)

This function is deprecated. Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs.

Cmn

Public properties

SpringSpec<Float>

This property is deprecated. Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs.

Cmn
Dp

This property is deprecated. Material's Swipeable has been replaced by Foundation's AnchoredDraggable APIs.

Cmn

Constants

StandardResistanceFactor

const val StandardResistanceFactor = 10.0f: Float

A standard resistance factor which indicates that the user has run out of things to see.

StiffResistanceFactor

const val StiffResistanceFactor = 20.0f: Float

A stiff resistance factor which indicates that swiping isn't available right now.

Public functions

resistanceConfig

fun resistanceConfig(
    anchors: Set<Float>,
    factorAtMin: Float = StandardResistanceFactor,
    factorAtMax: Float = StandardResistanceFactor
): ResistanceConfig?

The default resistance config used by swipeable.

This returns null if there is one anchor. If there are at least two anchors, it returns a ResistanceConfig with the resistance basis equal to the distance between the two bounds.

Public properties

AnimationSpec

val AnimationSpecSpringSpec<Float>

The default animation used by SwipeableState.

VelocityThreshold

val VelocityThresholdDp

The default velocity threshold (1.8 dp per millisecond) used by swipeable.