# WindowInsetsCompat.Builder

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/WindowInsetsCompat.java+class:androidx.core.view.WindowInsetsCompat.Builder) Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0)

*** ** * ** ***


```
public final class WindowInsetsCompat.Builder
```

<br />

*** ** * ** ***

Builder for `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#Builder()()` Creates a builder where all insets are initially consumed. |
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#Builder(androidx.core.view.WindowInsetsCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat insets)` Creates a builder where all insets are initialized from `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#build()()` Builds a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setBoundingRects(int,java.util.List<android.graphics.Rect>)(int typeMask, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/graphics/Rect.html> rects)` Sets the bounding rects. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setBoundingRectsIgnoringVisibility(int,java.util.List<android.graphics.Rect>)( int typeMask, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/graphics/Rect.html> rects )` Sets the bounding rects ignoring visibility. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setDisplayCutout(androidx.core.view.DisplayCutoutCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/DisplayCutoutCompat displayCutout)` Sets the display cutout. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setDisplayShape(androidx.core.view.DisplayShapeCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/DisplayShapeCompat displayShape)` Sets the display shape. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsets(int,androidx.core.graphics.Insets)(int typeMask, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets)` Sets the insets of a specific window type in pixels. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsetsIgnoringVisibility(int,androidx.core.graphics.Insets)(int typeMask, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets)` Sets the insets a specific window type in pixels, while ignoring its visibility state. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `[setMandatorySystemGestureInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setMandatorySystemGestureInsets(androidx.core.graphics.Insets))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsets(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#mandatorySystemGestures()`. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setPrivacyIndicatorBounds(android.graphics.Rect)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/Rect.html bounds)` Sets the bounds of the system privacy indicator. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setRoundedCorner(int,androidx.core.view.RoundedCornerCompat)( int position, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat roundedCorner )` Sets the rounded corner of given position. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `[setStableInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setStableInsets(androidx.core.graphics.Insets))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsetsIgnoringVisibility(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()`. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `[setSystemGestureInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setSystemGestureInsets(androidx.core.graphics.Insets))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsets(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemGestures()`. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `[setSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setSystemWindowInsets(androidx.core.graphics.Insets))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsets(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()`. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `[setTappableElementInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setTappableElementInsets(androidx.core.graphics.Insets))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets)` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsets(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#tappableElement()`. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setVisible(int,boolean)(int typeMask, boolean visible)` Sets whether windows that can cause insets are currently visible on screen. |

## Public constructors

### Builder

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0)

```
public Builder()
```

Creates a builder where all insets are initially consumed.

### Builder

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0)

```
public Builder(@NonNull WindowInsetsCompat insets)
```

Creates a builder where all insets are initialized from `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat insets` | the instance to initialize from. |

## Public methods

### build

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0)

```
public @NonNull WindowInsetsCompat build()
```

Builds a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | the `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance. |

### setBoundingRects

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/core#1.18.0)

```
public @NonNull WindowInsetsCompat.Builder setBoundingRects(int typeMask, @NonNull List<Rect> rects)
```

Sets the bounding rects.

| Parameters |
|---|---|
| `int typeMask` | the inset types to which these rects apply. All types specified in this mask will have their existing bounding rects overridden and replaced by the provided `rects` array. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/graphics/Rect.html> rects` | the bounding rects. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getBoundingRects(int)` |   |

### setBoundingRectsIgnoringVisibility

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/core#1.18.0)

```
public @NonNull WindowInsetsCompat.Builder setBoundingRectsIgnoringVisibility(
    int typeMask,
    @NonNull List<Rect> rects
)
```

Sets the bounding rects ignoring visibility.

| Parameters |
|---|---|
| `int typeMask` | the inset types to which these rects apply. All types specified in this mask will have their existing bounding rects overridden and replaced by the provided `rects` array. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/android/graphics/Rect.html> rects` | the bounding rects. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If `typeMask` contains `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#ime()`. Maximum bounding rects are not available for this type as the height of the IME is dynamic depending on the `https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html` of the currently focused view, as well as the UI state of the IME. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getBoundingRectsIgnoringVisibility(int)` |   |

### setDisplayCutout

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0)

```
public @NonNull WindowInsetsCompat.Builder setDisplayCutout(@Nullable DisplayCutoutCompat displayCutout)
```

Sets the display cutout.

The cutout passed will only take effect when running on API 29 and above.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/DisplayCutoutCompat displayCutout` | the display cutout or null if there is none |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getDisplayCutout()` |   |

### setDisplayShape

Added in [1.18.0](https://developer.android.com/jetpack/androidx/releases/core#1.18.0)

```
public @NonNull WindowInsetsCompat.Builder setDisplayShape(@NonNull DisplayShapeCompat displayShape)
```

Sets the display shape.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/DisplayShapeCompat displayShape` | the display shape |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getDisplayShape()` |   |

### setInsets

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull WindowInsetsCompat.Builder setInsets(int typeMask, @NonNull Insets insets)
```

Sets the insets of a specific window type in pixels.

The insets represents the area of a a window that is partially or fully obscured by the system windows identified by `typeMask`.

| Parameters |
|---|---|
| `int typeMask` | The bitmask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type` to set the insets for. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets` | The insets to set. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` |   |

### setInsetsIgnoringVisibility

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull WindowInsetsCompat.Builder setInsetsIgnoringVisibility(int typeMask, @NonNull Insets insets)
```

Sets the insets a specific window type in pixels, while ignoring its visibility state.

The insets represents the area of a a window that that **may** be partially or fully obscured by the system window identified by `typeMask`. This value does not change based on the visibility state of those elements. For example, if the status bar is normally shown, but temporarily hidden, the inset returned here will still provide the inset associated with the status bar being shown.

| Parameters |
|---|---|
| `int typeMask` | The bitmask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type` to set the insets for. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets` | The insets to set. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If `typeMask` contains `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#ime()`. Maximum insets are not available for this type as the height of the IME is dynamic depending on the `https://developer.android.com/reference/android/view/inputmethod/EditorInfo.html` of the currently focused view, as well as the UI state of the IME. |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int)` |   |

### setMandatorySystemGestureInsets

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull WindowInsetsCompat.Builder [setMandatorySystemGestureInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setMandatorySystemGestureInsets(androidx.core.graphics.Insets))(@NonNull Insets insets)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsets(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#mandatorySystemGestures()`.

Sets mandatory system gesture insets in pixels.

The mandatory system gesture insets represent the area of a window where mandatory system gestures have priority and may consume some or all touch input, e.g. due to the a system bar occupying it, or it being reserved for touch-only gestures.

In contrast to `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setSystemGestureInsets(androidx.core.graphics.Insets)`, **mandatory** system gestures cannot be overridden by `https://developer.android.com/reference/androidx/core/view/ViewCompat#setSystemGestureExclusionRects(android.view.View,java.util.List<android.graphics.Rect>)`.

The insets passed will only take effect when running on API 29 and above.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getMandatorySystemGestureInsets()` |   |

### setPrivacyIndicatorBounds

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/core#1.17.0)

```
public @NonNull WindowInsetsCompat.Builder setPrivacyIndicatorBounds(@Nullable Rect bounds)
```

Sets the bounds of the system privacy indicator.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/Rect.html bounds` | The bounds of the system privacy indicator, or null if they don't exist or the bounds have been consumed. |

### setRoundedCorner

Added in [1.16.0](https://developer.android.com/jetpack/androidx/releases/core#1.16.0)

```
public @NonNull WindowInsetsCompat.Builder setRoundedCorner(
    int position,
    @Nullable RoundedCornerCompat roundedCorner
)
```

Sets the rounded corner of given position.

| Parameters |
|---|---|
| `int position` | the position of this rounded corner |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat roundedCorner` | the rounded corner or null if there is none |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getRoundedCorner(int)` |   |

### setStableInsets

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull WindowInsetsCompat.Builder [setStableInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setStableInsets(androidx.core.graphics.Insets))(@NonNull Insets insets)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsetsIgnoringVisibility(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()`.

Sets the stable insets in pixels.

The stable inset represents the area of a full-screen window that **may** be partially or fully obscured by the system UI elements. This value does not change based on the visibility state of those elements; for example, if the status bar is normally shown, but temporarily hidden, the stable inset will still provide the inset associated with the status bar being shown.

The insets passed will only take effect when running on API 29 and above.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsets()` |   |

### setSystemGestureInsets

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull WindowInsetsCompat.Builder [setSystemGestureInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setSystemGestureInsets(androidx.core.graphics.Insets))(@NonNull Insets insets)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsets(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemGestures()`.

Sets system gesture insets in pixels.

The system gesture insets represent the area of a window where system gestures have priority and may consume some or all touch input, e.g. due to the a system bar occupying it, or it being reserved for touch-only gestures.

The insets passed will only take effect when running on API 29 and above.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemGestureInsets()` |   |

### setSystemWindowInsets

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull WindowInsetsCompat.Builder [setSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setSystemWindowInsets(androidx.core.graphics.Insets))(@NonNull Insets insets)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsets(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()`.

Sets system window insets in pixels.

The system window inset represents the area of a full-screen window that is partially or fully obscured by the status bar, navigation bar, IME or other system windows.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsets()` |   |

### setTappableElementInsets

Added in [1.3.0](https://developer.android.com/jetpack/androidx/releases/core#1.3.0) Deprecated in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull WindowInsetsCompat.Builder [setTappableElementInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setTappableElementInsets(androidx.core.graphics.Insets))(@NonNull Insets insets)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setInsets(int,androidx.core.graphics.Insets)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#tappableElement()`.

Sets tappable element insets in pixels.

The tappable element insets represent how much tappable elements **must at least** be inset to remain both tappable and visually unobstructed by persistent system windows.

The insets passed will only take effect when running on API 29 and above.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getTappableElementInsets()` |   |

### setVisible

Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/core#1.5.0)

```
public @NonNull WindowInsetsCompat.Builder setVisible(int typeMask, boolean visible)
```

Sets whether windows that can cause insets are currently visible on screen.

| Parameters |
|---|---|
| `int typeMask` | The bitmask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type` to set the visibility for. |
| `boolean visible` | Whether to mark the windows as visible or not. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` | itself |

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#isVisible(int)` |   |