# WindowInsetsCompat

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) Added in [1.1.0](https://developer.android.com/jetpack/androidx/releases/core#1.1.0)

*** ** * ** ***


```
public class WindowInsetsCompat
```

<br />

*** ** * ** ***

Describes a set of insets for window content.

WindowInsetsCompats are immutable and may be expanded to include more inset types in the future. To adjust insets, use one of the supplied clone methods to obtain a new WindowInsetsCompat instance with the adjusted properties.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` Builder for `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`. |
| `public final class https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Side` Class that defines different sides for insets. |
| `public final class https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type` Class that defines different types of sources causing window insets. |

| ### Constants |
|---|---|
| `static final @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#CONSUMED()` A `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance for which `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#isConsumed()` returns `true`. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#WindowInsetsCompat(androidx.core.view.WindowInsetsCompat)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat src)` Constructs a new WindowInsetsCompat, copying all values from a source WindowInsetsCompat. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | `[consumeDisplayCutout](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#consumeDisplayCutout())()` **This method is deprecated.** Consuming of different parts individually of a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance is deprecated, since `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` contains many different insets. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | `[consumeStableInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#consumeStableInsets())()` **This method is deprecated.** Consuming of different parts individually of a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance is deprecated, since `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` contains many different insets. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | `[consumeSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#consumeSystemWindowInsets())()` **This method is deprecated.** Consuming of different parts individually of a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance is deprecated, since `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` contains many different insets. <br /> |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html o)` |
| `@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>` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getBoundingRects(int)(int typeMask)` Returns a list of `https://developer.android.com/reference/android/graphics/Rect.html`s, each of which is the bounding rectangle for an area that is being partially or fully obscured inside the window. |
| `@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>` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getBoundingRectsIgnoringVisibility(int)(int typeMask)` Returns a list of `https://developer.android.com/reference/android/graphics/Rect.html`s, each of which is the bounding rectangle for an area that can be partially or fully obscured inside the window, regardless of whether that type is currently visible or not. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/DisplayCutoutCompat` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getDisplayCutout()()` Returns the display cutout if there is one. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/DisplayShapeCompat` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getDisplayShape()()` Returns the display shape in the coordinate space of the window. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)(int typeMask)` Returns the insets of a specific set of windows causing insets, denoted by the `typeMask` bit mask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type`s. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int)(int typeMask)` Returns the insets a specific set of windows can cause, denoted by the `typeMask` bit mask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type`s, regardless of whether that type is currently visible or not. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | `[getMandatorySystemGestureInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getMandatorySystemGestureInsets())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#mandatorySystemGestures()` instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/Rect.html` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getPrivacyIndicatorBounds()()` Returns a `https://developer.android.com/reference/android/graphics/Rect.html` representing the bounds of the system privacy indicator, for the current orientation, in the window space coordinates. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getRoundedCorner(int)(int position)` Returns the `https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat` of the given position if there is one. |
| `int` | `[getStableInsetBottom](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsetBottom())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `int` | `[getStableInsetLeft](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsetLeft())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `int` | `[getStableInsetRight](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsetRight())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `int` | `[getStableInsetTop](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsetTop())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | `[getStableInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsets())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | `[getSystemGestureInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemGestureInsets())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemGestures()` instead. <br /> |
| `int` | `[getSystemWindowInsetBottom](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetBottom())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `int` | `[getSystemWindowInsetLeft](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetLeft())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `int` | `[getSystemWindowInsetRight](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetRight())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `int` | `[getSystemWindowInsetTop](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetTop())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | `[getSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsets())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | `[getTappableElementInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getTappableElementInsets())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#tappableElement()` instead. <br /> |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#hasInsets()()` Returns true if this WindowInsets has any non-zero insets. |
| `boolean` | `[hasStableInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#hasStableInsets())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `boolean` | `[hasSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#hasSystemWindowInsets())()` **This method is deprecated.** Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#systemBars()` instead. <br /> |
| `int` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#hashCode()()` |
| `@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#inset(androidx.core.graphics.Insets)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets)` Returns a copy of this instance inset in the given directions. |
| `@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#inset(int,int,int,int)( @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int left, @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int top, @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int right, @https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int bottom )` Returns a copy of this instance inset in the given directions. |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#isConsumed()()` Check if these insets have been fully consumed. |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#isRound()()` Returns true if the associated window has a round shape. |
| `boolean` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#isVisible(int)(int typeMask)` Returns whether a set of windows that may cause insets is currently visible on screen, regardless of whether it actually overlaps with this window. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | `[replaceSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#replaceSystemWindowInsets(android.graphics.Rect))(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Rect.html systemWindowInsets)` **This method is deprecated.** use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setSystemWindowInsets(androidx.core.graphics.Insets)` instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | `[replaceSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#replaceSystemWindowInsets(int,int,int,int))(int left, int top, int right, int bottom)` **This method is deprecated.** use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setSystemWindowInsets(androidx.core.graphics.Insets)` instead. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/WindowInsets.html` | `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#toWindowInsets()()` Return the source `https://developer.android.com/reference/android/view/WindowInsets.html` instance used in this `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`. |
| `static @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#toWindowInsetsCompat(android.view.WindowInsets)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/WindowInsets.html insets)` Wrap an instance of `https://developer.android.com/reference/android/view/WindowInsets.html` into a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`. |
| `static @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#toWindowInsetsCompat(android.view.WindowInsets,android.view.View)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/WindowInsets.html insets, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html view)` Wrap an instance of `https://developer.android.com/reference/android/view/WindowInsets.html` into a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`. |

## Constants

### CONSUMED

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

```
public static final @NonNull WindowInsetsCompat CONSUMED
```

A `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance for which `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#isConsumed()` returns `true`.

This can be used during insets dispatch in the view hierarchy by returning this value from `View.onApplyWindowInsets(WindowInsets)` or `https://developer.android.com/reference/androidx/core/view/OnApplyWindowInsetsListener#onApplyWindowInsets(android.view.View,androidx.core.view.WindowInsetsCompat)` to stop dispatch the insets to its children to avoid traversing the entire view hierarchy.

The application should return this instance once it has taken care of all insets on a certain level in the view hierarchy, and doesn't need to dispatch to its children anymore for better performance.

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

## Public constructors

### WindowInsetsCompat

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

```
public WindowInsetsCompat(@Nullable WindowInsetsCompat src)
```

Constructs a new WindowInsetsCompat, copying all values from a source WindowInsetsCompat.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat src` | source from which values are copied |

## Public methods

### consumeDisplayCutout

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

```
public @NonNull WindowInsetsCompat [consumeDisplayCutout](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#consumeDisplayCutout())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Consuming of different parts individually of a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance is deprecated, since `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` contains many different insets. Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#CONSUMED()` instead to stop dispatching insets.

Returns a copy of this WindowInsets with the cutout fully consumed.

When running on platforms with API 27 and below, this method is a no-op.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | A modified copy of this WindowInsets |

### consumeStableInsets

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

```
public @NonNull WindowInsetsCompat [consumeStableInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#consumeStableInsets())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Consuming of different parts individually of a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance is deprecated, since `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` contains many different insets. Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#CONSUMED()` instead to stop dispatching insets.

Returns a copy of this WindowInsets with the stable insets fully consumed.

When running on platforms with API 20 and below, this method always returns `null`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | A modified copy of this WindowInsetsCompat |

### consumeSystemWindowInsets

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

```
public @NonNull WindowInsetsCompat [consumeSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#consumeSystemWindowInsets())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Consuming of different parts individually of a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` instance is deprecated, since `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` contains many different insets. Use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#CONSUMED()` instead to stop dispatching insets.

Returns a copy of this WindowInsets with the system window insets fully consumed.

When running on platforms with API 19 and below, this method always returns `null`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | A modified copy of this WindowInsets |

### equals

```
public boolean equals(Object o)
```

### getBoundingRects

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

```
public @NonNull List<Rect> getBoundingRects(int typeMask)
```

Returns a list of `https://developer.android.com/reference/android/graphics/Rect.html`s, each of which is the bounding rectangle for an area that is being partially or fully obscured inside the window.

May be used with or instead of `https://developer.android.com/reference/androidx/core/graphics/Insets` for finer avoidance of regions that may be partially obscuring the window but may be smaller than those provided by `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsets(int)`.

The `https://developer.android.com/reference/android/graphics/Rect.html`s returned are always cropped to the bounds of the window frame and their coordinate values are relative to the getFrame, regardless of the window's position on screen.

If inset by `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#inset(androidx.core.graphics.Insets)`, bounding rects that intersect with the provided insets will be resized to only include the intersection with the remaining frame. Bounding rects may be completely removed if they no longer intersect with the new instance.

When running on devices with API Level 35 and before, the returned bounding rects are an approximation based on the information available from current insets.

| Parameters |
|---|---|
| `int typeMask` | the insets type for which to obtain the bounding rectangles |

| Returns |
|---|---|
| `@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>` | the bounding rectangles |

### getBoundingRectsIgnoringVisibility

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

```
public @NonNull List<Rect> getBoundingRectsIgnoringVisibility(int typeMask)
```

Returns a list of `https://developer.android.com/reference/android/graphics/Rect.html`s, each of which is the bounding rectangle for an area that can be partially or fully obscured inside the window, regardless of whether that type is currently visible or not.

The bounding rects represent areas of a window that **may** be partially or fully obscured by the `type`. 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 bounding rects returned here will provide the rects associated with the status bar being shown.

May be used with or instead of `https://developer.android.com/reference/androidx/core/graphics/Insets` for finer avoidance of regions that may be partially obscuring the window but may be smaller than those provided by `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int)`.

The `https://developer.android.com/reference/android/graphics/Rect.html`s returned are always cropped to the bounds of the window frame and their coordinate values are relative to the getFrame, regardless of the window's position on screen.

When running on devices with API Level 35 and before, the returned bounding rects are an approximation based on the information available from current insets ignoring visibility.

| Parameters |
|---|---|
| `int typeMask` | the insets type for which to obtain the bounding rectangles |

| Returns |
|---|---|
| `@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>` | the bounding rectangles |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If the caller tries to query `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#ime()`. Bounding rects are not available if the IME isn't visible 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. |

### getDisplayCutout

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

```
public @Nullable DisplayCutoutCompat getDisplayCutout()
```

Returns the display cutout if there is one.

When running on platforms with API 27 and below, this method always returns `null`.

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

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/DisplayCutoutCompat` |   |

### getDisplayShape

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

```
public @Nullable DisplayShapeCompat getDisplayShape()
```

Returns the display shape in the coordinate space of the window.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/core/view/DisplayShapeCompat` |   |

### getInsets

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

```
public @NonNull Insets getInsets(int typeMask)
```

Returns the insets of a specific set of windows causing insets, denoted by the `typeMask` bit mask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type`s. When running on devices with API Level 29 and before, the returned insets are an approximation based on the information available. This is especially true for the `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#ime()` type, which currently only works when running on devices with SDK level 23 and above.

| Parameters |
|---|---|
| `int typeMask` | Bit mask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type`s to query the insets for. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | The insets. |

### getInsetsIgnoringVisibility

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

```
public @NonNull Insets getInsetsIgnoringVisibility(int typeMask)
```

Returns the insets a specific set of windows can cause, denoted by the `typeMask` bit mask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type`s, regardless of whether that type is currently visible or not.

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.
When running on devices with API Level 29 and before, the returned insets are an approximation based on the information available. This is especially true for the `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#ime()` type, which currently only works when running on devices with SDK level 23 and above.

| Parameters |
|---|---|
| `int typeMask` | Bit mask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type`s to query the insets for. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | The insets. |

| Throws |
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException.html` | If the caller tries to query `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#ime()`. Insets are not available if the IME isn't visible 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. |

### getMandatorySystemGestureInsets

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

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

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

Returns the mandatory system gesture insets.

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.

| See also |
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets.html#getMandatorySystemGestureInsets()` |   |

### getPrivacyIndicatorBounds

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

```
public @Nullable Rect getPrivacyIndicatorBounds()
```

Returns a `https://developer.android.com/reference/android/graphics/Rect.html` representing the bounds of the system privacy indicator, for the current orientation, in the window space coordinates. This method returns null if the system component doesn't have such indicators or the bounds have been consumed.

### getRoundedCorner

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

```
public @Nullable RoundedCornerCompat getRoundedCorner(int position)
```

Returns the `https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat` of the given position if there is one.

| Parameters |
|---|---|
| `int position` | the position of the rounded corner on the display. The value should be one of the following: `https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat#POSITION_TOP_LEFT()`, `https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat#POSITION_TOP_RIGHT()`, `https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat#POSITION_BOTTOM_RIGHT()`, `https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat#POSITION_BOTTOM_LEFT()`. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/RoundedCornerCompat` | the rounded corner of the given position. Returns `null` if there is none or the rounded corner area is not inside the bounds of the window. |

### getStableInsetBottom

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

```
public int [getStableInsetBottom](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsetBottom())()
```

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

Returns the bottom stable inset 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.

When running on platforms with API 20 and below, this method always returns `0`.

| Returns |
|---|---|
| `int` | The bottom stable inset |

### getStableInsetLeft

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

```
public int [getStableInsetLeft](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsetLeft())()
```

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

Returns the left stable inset 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.

When running on platforms with API 20 and below, this method always returns `0`.

| Returns |
|---|---|
| `int` | The left stable inset |

### getStableInsetRight

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

```
public int [getStableInsetRight](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsetRight())()
```

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

Returns the right stable inset 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.

When running on platforms with API 20 and below, this method always returns `0`.

| Returns |
|---|---|
| `int` | The right stable inset |

### getStableInsetTop

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

```
public int [getStableInsetTop](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getStableInsetTop())()
```

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

Returns the top stable inset 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.

When running on platforms with API 20 and below, this method always returns `0`.

### getStableInsets

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

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

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

Returns 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.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets` | The stable insets |

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

### getSystemGestureInsets

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

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

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

Returns the system gesture insets.

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.

An app can declare priority over system gestures with `https://developer.android.com/reference/android/view/View.html#setSystemGestureExclusionRects(java.util.List&lt;android.graphics.Rect&gt;)` outside of the `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getMandatorySystemGestureInsets()`.

| See also |
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets.html#getSystemGestureInsets()` |   |

### getSystemWindowInsetBottom

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

```
public int [getSystemWindowInsetBottom](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetBottom())()
```

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

Returns the bottom system window inset 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.

When running on platforms with API 19 and below, this method always returns `0`.

| Returns |
|---|---|
| `int` | The bottom system window inset |

### getSystemWindowInsetLeft

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

```
public int [getSystemWindowInsetLeft](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetLeft())()
```

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

Returns the left system window inset 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.

When running on platforms with API 19 and below, this method always returns `0`.

| Returns |
|---|---|
| `int` | The left system window inset |

### getSystemWindowInsetRight

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

```
public int [getSystemWindowInsetRight](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetRight())()
```

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

Returns the right system window inset 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.

When running on platforms with API 19 and below, this method always returns `0`.

| Returns |
|---|---|
| `int` | The right system window inset |

### getSystemWindowInsetTop

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

```
public int [getSystemWindowInsetTop](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetTop())()
```

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

Returns the top system window inset 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.

When running on platforms with API 19 and below, this method always returns `0`.

| Returns |
|---|---|
| `int` | The top system window inset |

### getSystemWindowInsets

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

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

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

Returns the 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/graphics/Insets` | The system window insets |

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

### getTappableElementInsets

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

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

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

Returns the tappable element insets.

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.

This may be smaller than `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#getSystemWindowInsets()` if the system window is largely transparent and lets through simple taps (but not necessarily more complex gestures).

| See also |
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets.html#getTappableElementInsets()` |   |

### hasInsets

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

```
public boolean hasInsets()
```

Returns true if this WindowInsets has any non-zero insets.

When running on platforms with API 19 and below, this method always returns `false`.

| Returns |
|---|---|
| `boolean` | true if any inset values are nonzero |

### hasStableInsets

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

```
public boolean [hasStableInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#hasStableInsets())()
```

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

Returns true if this WindowInsets has nonzero stable insets.

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.

When running on platforms with API 20 and below, this method always returns `false`.

| Returns |
|---|---|
| `boolean` | true if any of the stable inset values are nonzero |

### hasSystemWindowInsets

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

```
public boolean [hasSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#hasSystemWindowInsets())()
```

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

Returns true if this WindowInsets has nonzero system window insets.

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.

When running on platforms with API 19 and below, this method always returns `false`.

| Returns |
|---|---|
| `boolean` | true if any of the system window inset values are nonzero |

### hashCode

```
public int hashCode()
```

### inset

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

```
public @NonNull WindowInsetsCompat inset(@NonNull Insets insets)
```

Returns a copy of this instance inset in the given directions. This is intended for dispatching insets to areas of the window that are smaller than the current area.

Example:

```
childView.dispatchApplyWindowInsets(insets.inset(childMargins));
```

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/graphics/Insets insets` | the amount of insets to remove from all sides. |

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

### inset

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

```
public @NonNull WindowInsetsCompat inset(
    @IntRange(from = 0) int left,
    @IntRange(from = 0) int top,
    @IntRange(from = 0) int right,
    @IntRange(from = 0) int bottom
)
```

Returns a copy of this instance inset in the given directions. This is intended for dispatching insets to areas of the window that are smaller than the current area.

Example:

```
childView.dispatchApplyWindowInsets(insets.inset(
        childMarginLeft, childMarginTop, childMarginBottom, childMarginRight));
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int left` | the amount of insets to remove from the left. Must be non-negative. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int top` | the amount of insets to remove from the top. Must be non-negative. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int right` | the amount of insets to remove from the right. Must be non-negative. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int bottom` | the amount of insets to remove from the bottom. Must be non-negative. |

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

### isConsumed

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

```
public boolean isConsumed()
```

Check if these insets have been fully consumed.

Insets are considered "consumed" if the applicable `consume*` methods have been called such that all insets have been set to zero. This affects propagation of insets through the view hierarchy; insets that have not been fully consumed will continue to propagate down to child views.

The result of this method is equivalent to the return value of `https://developer.android.com/reference/android/view/View.html#fitSystemWindows(android.graphics.Rect)`.

| Returns |
|---|---|
| `boolean` | true if the insets have been fully consumed. |

### isRound

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

```
public boolean isRound()
```

Returns true if the associated window has a round shape.

A round window's left, top, right and bottom edges reach all the way to the associated edges of the window but the corners may not be visible. Views responding to round insets should take care to not lay out critical elements within the corners where they may not be accessible.

When running on platforms with API 19 and below, this method always returns `false`.

| Returns |
|---|---|
| `boolean` | true if the window is round |

### isVisible

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

```
public boolean isVisible(int typeMask)
```

Returns whether a set of windows that may cause insets is currently visible on screen, regardless of whether it actually overlaps with this window. When running on devices with API Level 29 and before, the returned value is an approximation based on the information available. This is especially true for the `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type#ime()` type, which currently only works when running on devices with SDK level 23 and above.

| Parameters |
|---|---|
| `int typeMask` | Bit mask of `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type`s to query visibility status. |

| Returns |
|---|---|
| `boolean` | `true` if and only if all windows included in `typeMask` are currently visible on screen. |

### replaceSystemWindowInsets

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

```
public @NonNull WindowInsetsCompat [replaceSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#replaceSystemWindowInsets(android.graphics.Rect))(@NonNull Rect systemWindowInsets)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setSystemWindowInsets(androidx.core.graphics.Insets)` instead.

Returns a copy of this WindowInsets with selected system window insets replaced with new values.

When running on platforms with API 19 and below, this method always returns `null`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Rect.html systemWindowInsets` | New system window insets. Each field is the inset in pixels for that edge |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | A modified copy of this WindowInsets |

### replaceSystemWindowInsets

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

```
public @NonNull WindowInsetsCompat [replaceSystemWindowInsets](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#replaceSystemWindowInsets(int,int,int,int))(int left, int top, int right, int bottom)
```

> [!CAUTION]
> **This method is deprecated.**   
>
> use `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder` with `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Builder#setSystemWindowInsets(androidx.core.graphics.Insets)` instead.

Returns a copy of this WindowInsets with selected system window insets replaced with new values.

When running on platforms with API 19 and below, this method always returns `null`.

| Parameters |
|---|---|
| `int left` | New left inset in pixels |
| `int top` | New top inset in pixels |
| `int right` | New right inset in pixels |
| `int bottom` | New bottom inset in pixels |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` | A modified copy of this WindowInsets |

### toWindowInsets

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

```
public @Nullable WindowInsets toWindowInsets()
```

Return the source `https://developer.android.com/reference/android/view/WindowInsets.html` instance used in this `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`.

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/WindowInsets.html` | the wrapped WindowInsets instance |

### toWindowInsetsCompat

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

```
public static @NonNull WindowInsetsCompat toWindowInsetsCompat(@NonNull WindowInsets insets)
```

Wrap an instance of `https://developer.android.com/reference/android/view/WindowInsets.html` into a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`.

This version of the function does not allow the resulting `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` to be aware of the root window insets and root view, meaning that the returned values for many of the different inset `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type`s will be incorrect.

Prefer using `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat#toWindowInsetsCompat(android.view.WindowInsets,android.view.View)` instead.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/WindowInsets.html insets` | source insets to wrap |

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

### toWindowInsetsCompat

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

```
public static @NonNull WindowInsetsCompat toWindowInsetsCompat(@NonNull WindowInsets insets, @Nullable View view)
```

Wrap an instance of `https://developer.android.com/reference/android/view/WindowInsets.html` into a `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat`.

This version of the function allows the resulting `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat` to be aware of the root window insets and root view through the `view` parameter. This is required for many of the different inset `https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat.Type`s to return correct values when used on devices running Android 10 and before.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/view/WindowInsets.html insets` | source insets to wrap |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/view/View.html view` | view to use as an entry point for obtaining root window information. This view needs be attached to the window, otherwise it will be ignored. |

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