# ExpandPolicy

Artifact: [androidx.compose.foundation:foundation](https://developer.android.com/jetpack/androidx/releases/compose-foundation) [View Source](https://cs.android.com/search?q=file:androidx/compose/foundation/text/input/TrackedRange.kt+class:androidx.compose.foundation.text.input.ExpandPolicy) Added in [1.12.0](https://developer.android.com/jetpack/androidx/releases/compose-foundation#1.12.0) Common/All
- Cmn

  ```
  value class ExpandPolicy
  ```

*** ** * ** ***

Defines how a `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TrackedRange` expands when text is inserted exactly at its boundaries.

This policy is used in methods like `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/TextFieldBuffer#addStyle(androidx.compose.ui.text.SpanStyle,kotlin.Int,kotlin.Int)` to configure whether the range expands to include text inserted at its start, end, or both boundaries.

## Summary

| ### Public companion properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/ExpandPolicy` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/ExpandPolicy#AtBoth()` The range will expand when text is inserted at either of its boundaries. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/ExpandPolicy` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/ExpandPolicy#AtEnd()` The range will expand when text is inserted at its end boundary. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/ExpandPolicy` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/ExpandPolicy#AtStart()` The range will expand when text is inserted at its start boundary. | Cmn |
| `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/ExpandPolicy` | `https://developer.android.com/reference/kotlin/androidx/compose/foundation/text/input/ExpandPolicy#InsideOnly()` The range will not expand when text is inserted at its boundaries. | Cmn |

## Public companion properties

### AtBoth

Cmn

```
val AtBoth: ExpandPolicy
```

The range will expand when text is inserted at either of its boundaries.

### AtEnd

Cmn

```
val AtEnd: ExpandPolicy
```

The range will expand when text is inserted at its end boundary. Text inserted exactly at the end will be included in the range.

### AtStart

Cmn

```
val AtStart: ExpandPolicy
```

The range will expand when text is inserted at its start boundary. Text inserted exactly at the start will be included in the range.

### InsideOnly

Cmn

```
val InsideOnly: ExpandPolicy
```

The range will not expand when text is inserted at its boundaries. Text inserted exactly at the start or end will be placed outside the range.