Compose Unstyled 2.0 is out! Check the official announcement blog ->
Object

SwipeToRevealDefaults

Defaults for Material 3 SwipeToReveal.

Source set: Android
public object SwipeToRevealDefaults

Defaults for Material 3 SwipeToReveal.

Properties

LargeActionButtonHeight

Source set: Android
public val LargeActionButtonHeight: Dp

Standard height for a large revealed action, such as when the swiped item is a Card.

LeftEdgeZoneFraction

Source set: Android
public val LeftEdgeZoneFraction: Float

The default value used to configure the size of the left edge zone in a SwipeToReveal. The left edge zone in this case refers to the leftmost edge of the screen, in this region it is common to disable scrolling in order for swipe-to-dismiss handlers to take over.

bidirectionalGestureInclusion

Source set: Android
public val bidirectionalGestureInclusion: GestureInclusion

A behaviour for SwipeToReveal to handle all gestures, intended for rare cases where RevealDirection.Bidirectional is used and no swipe events are ignored.

Functions

gestureInclusion

public fun gestureInclusion(
        state: RevealState,
        @FloatRange(from = 0.0, to = 1.0) edgeZoneFraction: Float = LeftEdgeZoneFraction,
    ): GestureInclusion

The default behaviour for when SwipeToReveal should handle gestures. In this implementation of GestureInclusion, swipe events that originate in the left edge of the screen (as determined by LeftEdgeZoneFraction) will be ignored, if the RevealState is Covered. This allows swipe-to-dismiss handlers (if present) to handle the gesture in this region.

Parameters

state RevealState of the SwipeToReveal.
edgeZoneFraction The fraction of the screen width from the left edge where gestures should be ignored. Defaults to LeftEdgeZoneFraction.

flingBehavior

@Composable
public fun flingBehavior(revealState: RevealState): TargetedFlingBehavior

Creates and remembers the default fling behavior used by the SwipeToReveal component.

This specialized behavior handles the physics of the swipe gesture, ensuring compliance with Wear Compose Material 3 UX guidelines.

This should be used when building custom gesture modifiers (like nested scrolling) that need to perform a fling on a RevealState while maintaining the exact feel of the native component.

Parameters

revealState The RevealState associated with the component.

Returns

A TargetedFlingBehavior configured for SwipeToReveal gestures.

Last updated: