# SwipeToDismissKeys

Artifact: [androidx.wear.compose:compose-material](https://developer.android.com/jetpack/androidx/releases/wear-compose) [View Source](https://cs.android.com/search?q=file:androidx/wear/compose/material/SwipeToDismissBox.kt+class:androidx.wear.compose.material.SwipeToDismissKeys) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear-compose#1.0.0)


```
enum SwipeToDismissKeys : Enum<SwipeToDismissKeys>
```

<br />

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html) |||
| ↳ | [kotlin.Enum](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-enum/index.html)\<[SwipeToDismissKeys](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys)\> ||
|   | ↳ | [androidx.wear.compose.material.SwipeToDismissKeys](https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys) |

*** ** * ** ***

Keys used to persistent state in `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissBox.composable#SwipeToDismissBox(androidx.wear.compose.foundation.SwipeToDismissBoxState,androidx.compose.ui.Modifier,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,kotlin.Any,kotlin.Any,kotlin.Boolean,kotlin.Function2)`.

## Summary

| ### Enum Values |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys#Background` | The default background key to identify the content displayed by the content block when isBackground == true. |
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys#Content` | The default content key to identify the content displayed by the content block when isBackground == false. |

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys#valueOf(kotlin.String)(value: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)` Returns the enum constant of this type with the specified name. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html<https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys>` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys#values()()` Returns an array containing the constants of this enum type, in the order they're declared. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html<https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys>` | `https://developer.android.com/reference/kotlin/androidx/wear/compose/material/SwipeToDismissKeys#entries()` Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared. |

## Enum Values

### Background

```
val SwipeToDismissKeys.Background: SwipeToDismissKeys
```

The default background key to identify the content displayed by the content block when isBackground == true. Specifying a background key instead of using the default allows remembered state to be correctly moved between background and foreground.

### Content

```
val SwipeToDismissKeys.Content: SwipeToDismissKeys
```

The default content key to identify the content displayed by the content block when isBackground == false. Specifying a background key instead of using the default allows remembered state to be correctly moved between background and foreground.

## Public functions

### valueOf

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

```
fun valueOf(value: String): SwipeToDismissKeys
```

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

| Throws |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-illegal-argument-exception/index.html` | if this enum type has no constant with the specified name |

### values

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

```
fun values(): Array<SwipeToDismissKeys>
```

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

The function returns a new instance of the array on every call. The array could be mutated, so working with it may also require defensive copying. Consider using `entries` property as a more efficient alternative returning an immutable list of enum entries.

## Public properties

### entries

```
val entries: EnumEntries<SwipeToDismissKeys>
```

Returns an immutable `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.enums/-enum-entries/index.html` list containing the constants of this enum type, in the order they're declared.