SwipeableDefaults

@ExperimentalWearMaterialApi
object SwipeableDefaults


Contains useful defaults for swipeable and SwipeableState.

Summary

Constants

const Float

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

const Float

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

Public functions

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

The default resistance config used by swipeable.

Public properties

SpringSpec<Float>

The default animation used by SwipeableState.

Dp

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

Constants

StandardResistanceFactor

Added in 1.0.0
const val StandardResistanceFactor = 10.0f: Float

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

StiffResistanceFactor

Added in 1.0.0
const val StiffResistanceFactor = 20.0f: Float

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

Public functions

resistanceConfig

Added in 1.0.0
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

Added in 1.0.0
val AnimationSpecSpringSpec<Float>

The default animation used by SwipeableState.

VelocityThreshold

Added in 1.0.0
val VelocityThresholdDp

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