SwipeToRevealDefaults

object SwipeToRevealDefaults


Defaults for Material 3 SwipeToReveal.

Summary

Public functions

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

The default behaviour for when SwipeToReveal should handle gestures.

Public properties

Dp

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

Float

The default value used to configure the size of the left edge zone in a SwipeToReveal.

GestureInclusion

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

Public functions

gestureInclusion

Added in 1.5.0-beta01
fun gestureInclusion(
    state: RevealState,
    edgeZoneFraction: @FloatRange(from = 0.0, to = 1.0) 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

RevealState of the SwipeToReveal.

edgeZoneFraction: @FloatRange(from = 0.0, to = 1.0) Float = LeftEdgeZoneFraction

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

Public properties

LargeActionButtonHeight

Added in 1.5.0-beta01
val LargeActionButtonHeightDp

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

LeftEdgeZoneFraction

Added in 1.5.0-beta01
val LeftEdgeZoneFractionFloat

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

Added in 1.5.0-beta01
val bidirectionalGestureInclusionGestureInclusion

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