# preferKeepClear

Common/AllAndroid/JVM

## Functions summary

|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/compose/foundation/preferKeepClear.modifier#(androidx.compose.ui.Modifier).preferKeepClear()()` Mark the layout rectangle as preferring to stay clear of floating windows. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier.https://developer.android.com/reference/kotlin/androidx/compose/foundation/preferKeepClear.modifier#(androidx.compose.ui.Modifier).preferKeepClear(kotlin.Function1)(rectProvider: (https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/LayoutCoordinates) -> https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect)` Mark a rectangle within the local layout coordinates preferring to stay clear of floating windows. | android |

## Functions

### Modifier.preferKeepClear

android 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/PreferKeepClear.android.kt+function:preferKeepClear)

```
fun Modifier.preferKeepClear(): Modifier
```

Mark the layout rectangle as preferring to stay clear of floating windows.

This Modifier only has an effect on SDK 33 and above.

| See also |
|---|---|
| `https://developer.android.com/reference/android/view/View.html#setPreferKeepClearRects(java.util.List&lt;android.graphics.Rect&gt;)` |   |

### Modifier.preferKeepClear

android 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/PreferKeepClear.android.kt+function:preferKeepClear)

```
fun Modifier.preferKeepClear(rectProvider: (LayoutCoordinates) -> Rect): Modifier
```

Mark a rectangle within the local layout coordinates preferring to stay clear of floating windows. After layout, `https://developer.android.com/reference/kotlin/androidx/compose/foundation/package-summary#(androidx.compose.ui.Modifier).preferKeepClear(kotlin.Function1)` is called to determine the `https://developer.android.com/reference/kotlin/androidx/compose/ui/geometry/Rect` to mark as keep clear.

The `https://developer.android.com/reference/kotlin/androidx/compose/ui/layout/LayoutCoordinates` of the `https://developer.android.com/reference/kotlin/androidx/compose/ui/Modifier`'s location in the layout is passed as `https://developer.android.com/reference/kotlin/androidx/compose/foundation/package-summary#(androidx.compose.ui.Modifier).preferKeepClear(kotlin.Function1)`'s parameter.

This Modifier only has an effect on SDK 33 and above.

| See also |
|---|---|
| `https://developer.android.com/reference/android/view/View.html#setPreferKeepClearRects(java.util.List&lt;android.graphics.Rect&gt;)` |   |