# SwipeToRevealDefaults

Artifact: [androidx.wear.compose:compose-foundation](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/foundation/SwipeToReveal.kt+class:androidx.wear.compose.foundation.SwipeToRevealDefaults) Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)


```
@ExperimentalWearFoundationApi
object SwipeToRevealDefaults
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This object is deprecated.**   
> The SwipeToReveal component from the latest material library should be used instead. This will be removed in a future release of this library, use this instead:
>
> ```kotlin
> SwipeToRevealDefaults
> ```

An internal object containing some defaults used across the Swipe to reveal component.

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/GestureInclusion` | `[gestureInclusion](https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToRevealDefaults#gestureInclusion(androidx.wear.compose.foundation.RevealState,kotlin.Float))( state: https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/RevealState, edgeZoneFraction: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html )` **This function is deprecated.** The SwipeToReveal component from the latest material library should be used instead. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToRevealDefaults#LeftEdgeZoneFraction()` **This property is deprecated.** The SwipeToReveal component from the latest material library should be used instead. |
| `(totalDistance: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html) -> https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToRevealDefaults#PositionalThreshold()` **This property is deprecated.** The SwipeToReveal component from the latest material library should be used instead. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToRevealDefaults#RevealingRatio()` **This property is deprecated.** The SwipeToReveal component from the latest material library should be used instead. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/GestureInclusion` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToRevealDefaults#bidirectionalGestureInclusion()` **This property is deprecated.** The SwipeToReveal component from the latest material library should be used instead. |

## Public functions

### gestureInclusion

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
fun [gestureInclusion](https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToRevealDefaults#gestureInclusion(androidx.wear.compose.foundation.RevealState,kotlin.Float))(
    state: RevealState,
    edgeZoneFraction: @FloatRange(from = 0.0, to = 1.0) Float = LeftEdgeZoneFraction
): GestureInclusion
```

> [!CAUTION]
> **This function is deprecated.**   
> The SwipeToReveal component from the latest material library should be used instead. This will be removed in a future release of this library, use this instead:
>
> ```kotlin
> SwipeToRevealDefaults
> ```

The default behaviour for when `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToReveal.composable#SwipeToReveal(kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,androidx.wear.compose.foundation.RevealState,kotlin.Function0,kotlin.Function0,androidx.wear.compose.foundation.GestureInclusion,kotlin.Function0)` should handle gestures. In this implementation of `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/GestureInclusion`, swipe events that originate in the left edge of the screen (as determined by `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToRevealDefaults#LeftEdgeZoneFraction()`) will be ignored, if the `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/RevealState` is `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/RevealValue#Covered()`. This allows swipe-to-dismiss handlers (if present) to handle the gesture in this region.

| Parameters |
|---|---|
| `state: https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/RevealState` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/RevealState` of the `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToReveal.composable#SwipeToReveal(kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,androidx.wear.compose.foundation.RevealState,kotlin.Function0,kotlin.Function0,androidx.wear.compose.foundation.GestureInclusion,kotlin.Function0)`. |
| `edgeZoneFraction: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0, to = 1.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html = LeftEdgeZoneFraction` | The fraction of the screen width from the left edge where gestures should be ignored. Defaults to `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToRevealDefaults#LeftEdgeZoneFraction()`. |

## Public properties

### LeftEdgeZoneFraction

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val LeftEdgeZoneFraction: Float
```

> [!CAUTION]
> **This property is deprecated.**   
> The SwipeToReveal component from the latest material library should be used instead. This will be removed in a future release of this library, use this instead:
>
> ```kotlin
> SwipeToRevealDefaults
> ```

The default value used to configure the size of the left edge zone in a `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToReveal.composable#SwipeToReveal(kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,androidx.wear.compose.foundation.RevealState,kotlin.Function0,kotlin.Function0,androidx.wear.compose.foundation.GestureInclusion,kotlin.Function0)`. 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.

### PositionalThreshold

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val PositionalThreshold: (totalDistance: Float) -> Float
```

> [!CAUTION]
> **This property is deprecated.**   
> The SwipeToReveal component from the latest material library should be used instead. This will be removed in a future release of this library, use this instead:
>
> ```kotlin
> SwipeToRevealDefaults
> ```

Default position threshold that needs to be swiped in order to transition to the next state. Used in conjunction with `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToRevealDefaults#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 `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/RevealValue#Covered()` to `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/RevealValue#RightRevealing()` and at least 85% (0.7 + 0.5 \* (1 - 0.7)) of the component width to go from `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/RevealValue#RightRevealing()` to `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/RevealValue#RightRevealed()`.

### RevealingRatio

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val RevealingRatio: Float
```

> [!CAUTION]
> **This property is deprecated.**   
> The SwipeToReveal component from the latest material library should be used instead. This will be removed in a future release of this library, use this instead:
>
> ```kotlin
> SwipeToRevealDefaults
> ```

Default ratio of the content displayed when in `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/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.

### bidirectionalGestureInclusion

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.5.0)

```
val bidirectionalGestureInclusion: GestureInclusion
```

> [!CAUTION]
> **This property is deprecated.**   
> The SwipeToReveal component from the latest material library should be used instead. This will be removed in a future release of this library, use this instead:
>
> ```kotlin
> SwipeToRevealDefaults
> ```

A behaviour for `https://developer.android.com/reference/kotlin/androidx/wear/compose/foundation/SwipeToReveal.composable#SwipeToReveal(kotlin.Function0,androidx.compose.ui.Modifier,kotlin.Function0,androidx.wear.compose.foundation.RevealState,kotlin.Function0,kotlin.Function0,androidx.wear.compose.foundation.GestureInclusion,kotlin.Function0)` to handle all gestures, intended for rare cases where bidirectional anchors are used and no swipe events are ignored