Deprecated
The SwipeToReveal component from the latest material library should be used instead. This will be removed in a future release of this library.
@ExperimentalWearFoundationApi
public object SwipeToRevealDefaults
An internal object containing some defaults used across the Swipe to reveal component.
Properties
RevealingRatio
public val RevealingRatio: Float
Default ratio of the content displayed when in RevealValue.RightRevealing state, i.e. all the actions are revealed and the top content is not being swiped. For example, a value of 0.7 means that 70% of the width is used to place the actions.
PositionalThreshold
public val PositionalThreshold: (totalDistance: Float) -> Float
Default position threshold that needs to be swiped in order to transition to the next state. Used in conjunction with RevealingRatio; for example, a threshold of 0.5 with a revealing ratio of 0.7 means that the user needs to swipe at least 35% (0.5 * 0.7) of the component width to go from RevealValue.Covered to RevealValue.RightRevealing and at least 85% (0.7 + 0.5 * (1 - 0.7)) of the component width to go from RevealValue.RightRevealing to RevealValue.RightRevealed.
LeftEdgeZoneFraction
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
public val bidirectionalGestureInclusion: GestureInclusion
A behaviour for SwipeToReveal to handle all gestures, intended for rare cases where bidirectional anchors are 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 RevealValue.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. |