Object

SwipeableDefaults

Contains useful defaults for swipeable and SwipeableState.

Source set: Common
@Deprecated(SwipeableDeprecation)
public object SwipeableDefaults

Contains useful defaults for swipeable and SwipeableState.

Properties

AnimationSpec

Source set: Common
public val AnimationSpec: SpringSpec<Float> = SpringSpec<Float>()

The default animation used by SwipeableState.

VelocityThreshold

Source set: Common
public val VelocityThreshold: Dp = 125.dp

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

StiffResistanceFactor

Source set: Common
public const val StiffResistanceFactor: Float = 20f

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

StandardResistanceFactor

Source set: Common
public const val StandardResistanceFactor: Float = 10f

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

Functions

resistanceConfig

Source set: Common
public 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.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: