Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Nested Classes](https://developer.android.com/reference/android/view/WindowInsets#nestedclasses) \| [Fields](https://developer.android.com/reference/android/view/WindowInsets#lfields) \| [Ctors](https://developer.android.com/reference/android/view/WindowInsets#pubctors) \| [Methods](https://developer.android.com/reference/android/view/WindowInsets#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/view/WindowInsets#inhmethods)

# WindowInsets

*** ** * ** ***

` public final class WindowInsets `   
` extends https://developer.android.com/reference/java/lang/Object ` ` `

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.view.WindowInsets |

<br />

*** ** * ** ***

Describes a set of insets for window content.

WindowInsets 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 WindowInsets instance with the adjusted properties.

Note: Before `https://developer.android.com/reference/android/os/Build.VERSION_CODES#P`, WindowInsets instances were only immutable during a single layout pass (i.e. would return the same values between `https://developer.android.com/reference/android/view/View#onApplyWindowInsets(android.view.WindowInsets)` and `https://developer.android.com/reference/android/view/View#onLayout(boolean,%20int,%20int,%20int,%20int)`, but could return other values otherwise). Starting with `https://developer.android.com/reference/android/os/Build.VERSION_CODES#P`, WindowInsets are always immutable and implement equality.
**See also:**

- `https://developer.android.com/reference/android/view/View.OnApplyWindowInsetsListener`
- `https://developer.android.com/reference/android/view/View#onApplyWindowInsets(android.view.WindowInsets)`

## Summary

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

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/android/view/WindowInsets` | `https://developer.android.com/reference/android/view/WindowInsets#CONSUMED` A `https://developer.android.com/reference/android/view/WindowInsets` instance for which `https://developer.android.com/reference/android/view/WindowInsets#isConsumed()` returns `true`. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/view/WindowInsets#WindowInsets(android.view.WindowInsets)(https://developer.android.com/reference/android/view/WindowInsets src) ` Construct a new WindowInsets, copying all values from a source WindowInsets. |

| ### Public methods ||
|---|---|
| ` https://developer.android.com/reference/android/view/WindowInsets` | ` https://developer.android.com/reference/android/view/WindowInsets#consumeDisplayCutout()() ` *This method was deprecated in API level 30. Consuming of different parts individually of a `https://developer.android.com/reference/android/view/WindowInsets` instance is deprecated, since `https://developer.android.com/reference/android/view/WindowInsets` contains many different insets. Use `https://developer.android.com/reference/android/view/WindowInsets#CONSUMED` instead to stop dispatching insets.* |
| ` https://developer.android.com/reference/android/view/WindowInsets` | ` https://developer.android.com/reference/android/view/WindowInsets#consumeStableInsets()() ` *This method was deprecated in API level 30. Consuming of different parts individually of a `https://developer.android.com/reference/android/view/WindowInsets` instance is deprecated, since `https://developer.android.com/reference/android/view/WindowInsets` contains many different insets. Use `https://developer.android.com/reference/android/view/WindowInsets#CONSUMED` instead to stop dispatching insets. On `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R`, this method has no effect.* |
| ` https://developer.android.com/reference/android/view/WindowInsets` | ` https://developer.android.com/reference/android/view/WindowInsets#consumeSystemWindowInsets()() ` *This method was deprecated in API level 30. Consuming of different parts individually of a `https://developer.android.com/reference/android/view/WindowInsets` instance is deprecated, since `https://developer.android.com/reference/android/view/WindowInsets` contains many different insets. Use `https://developer.android.com/reference/android/view/WindowInsets#CONSUMED` instead to stop dispatching insets.* |
| ` boolean` | ` https://developer.android.com/reference/android/view/WindowInsets#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object o) ` Indicates whether some other object is "equal to" this one. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/Rect>` | ` https://developer.android.com/reference/android/view/WindowInsets#getBoundingRects(int)(int typeMask) ` Returns a list of `https://developer.android.com/reference/android/graphics/Rect`s, each of which is the bounding rectangle for an area that is being partially or fully obscured inside the window. |
| ` https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/Rect>` | ` https://developer.android.com/reference/android/view/WindowInsets#getBoundingRectsIgnoringVisibility(int)(int typeMask) ` Returns a list of `https://developer.android.com/reference/android/graphics/Rect`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://developer.android.com/reference/android/view/DisplayCutout` | ` https://developer.android.com/reference/android/view/WindowInsets#getDisplayCutout()() ` Returns the display cutout if there is one. |
| ` https://developer.android.com/reference/android/view/DisplayShape` | ` https://developer.android.com/reference/android/view/WindowInsets#getDisplayShape()() ` Returns the display shape in the coordinate space of the window. |
| ` https://developer.android.com/reference/android/util/Size` | ` https://developer.android.com/reference/android/view/WindowInsets#getFrame()() ` Returns the assumed size of the window, relative to which the `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` and `https://developer.android.com/reference/android/view/WindowInsets#getBoundingRects(int)` have been calculated. |
| ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/view/WindowInsets#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/android/view/WindowInsets.Type`s. |
| ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/view/WindowInsets#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/android/view/WindowInsets.Type`s, regardless of whether that type is currently visible or not. |
| ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/view/WindowInsets#getMandatorySystemGestureInsets()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#mandatorySystemGestures()` instead.* |
| ` https://developer.android.com/reference/android/graphics/Rect` | ` https://developer.android.com/reference/android/view/WindowInsets#getPrivacyIndicatorBounds()() ` Returns the `https://developer.android.com/reference/android/graphics/Rect` of the maximum bounds of the system privacy indicator, for the current orientation, in relative coordinates, or null if the bounds have not been loaded yet. |
| ` https://developer.android.com/reference/android/view/RoundedCorner` | ` https://developer.android.com/reference/android/view/WindowInsets#getRoundedCorner(int)(int position) ` Returns the `https://developer.android.com/reference/android/view/RoundedCorner` of the given position if there is one. |
| ` int` | ` https://developer.android.com/reference/android/view/WindowInsets#getStableInsetBottom()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/view/WindowInsets#getStableInsetLeft()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/view/WindowInsets#getStableInsetRight()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/view/WindowInsets#getStableInsetTop()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/view/WindowInsets#getStableInsets()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/view/WindowInsets#getSystemGestureInsets()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemGestures()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsetBottom()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsetLeft()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsetRight()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsetTop()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsets()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()`* |
| ` https://developer.android.com/reference/android/graphics/Insets` | ` https://developer.android.com/reference/android/view/WindowInsets#getTappableElementInsets()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#tappableElement()` instead.* |
| ` boolean` | ` https://developer.android.com/reference/android/view/WindowInsets#hasInsets()() ` Returns true if this WindowInsets has any nonzero insets. |
| ` boolean` | ` https://developer.android.com/reference/android/view/WindowInsets#hasStableInsets()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` boolean` | ` https://developer.android.com/reference/android/view/WindowInsets#hasSystemWindowInsets()() ` *This method was deprecated in API level 30. Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()` instead.* |
| ` int` | ` https://developer.android.com/reference/android/view/WindowInsets#hashCode()() ` Returns a hash code value for the object. |
| ` https://developer.android.com/reference/android/view/WindowInsets` | ` https://developer.android.com/reference/android/view/WindowInsets#inset(int,%20int,%20int,%20int)(int left, int top, int right, int bottom) ` Returns a copy of this instance inset in the given directions. |
| ` https://developer.android.com/reference/android/view/WindowInsets` | ` https://developer.android.com/reference/android/view/WindowInsets#inset(android.graphics.Insets)(https://developer.android.com/reference/android/graphics/Insets insets) ` Returns a copy of this instance inset in the given directions. |
| ` boolean` | ` https://developer.android.com/reference/android/view/WindowInsets#isConsumed()() ` Check if these insets have been fully consumed. |
| ` boolean` | ` https://developer.android.com/reference/android/view/WindowInsets#isRound()() ` Returns true if the associated window has a round shape. |
| ` boolean` | ` https://developer.android.com/reference/android/view/WindowInsets#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://developer.android.com/reference/android/view/WindowInsets` | ` https://developer.android.com/reference/android/view/WindowInsets#replaceSystemWindowInsets(int,%20int,%20int,%20int)(int left, int top, int right, int bottom) ` *This method was deprecated in API level 29. use `Builder#Builder(WindowInsets)` with `https://developer.android.com/reference/android/view/WindowInsets.Builder#setSystemWindowInsets(android.graphics.Insets)` instead.* |
| ` https://developer.android.com/reference/android/view/WindowInsets` | ` https://developer.android.com/reference/android/view/WindowInsets#replaceSystemWindowInsets(android.graphics.Rect)(https://developer.android.com/reference/android/graphics/Rect systemWindowInsets) ` *This method was deprecated in API level 29. use `Builder#Builder(WindowInsets)` with `https://developer.android.com/reference/android/view/WindowInsets.Builder#setSystemWindowInsets(android.graphics.Insets)` instead.* |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/view/WindowInsets#toString()() ` Returns a string representation of the object. |

### Inherited methods

From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Fields

### CONSUMED

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final WindowInsets CONSUMED
```

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

This can be used during insets dispatch in the view hierarchy by returning this value from `https://developer.android.com/reference/android/view/View#onApplyWindowInsets(android.view.WindowInsets)` or `https://developer.android.com/reference/android/view/View.OnApplyWindowInsetsListener#onApplyWindowInsets(android.view.View,%20android.view.WindowInsets)` 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.

<br />

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets#isConsumed()`

## Public constructors

### WindowInsets

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WindowInsets (WindowInsets src)
```

Construct a new WindowInsets, copying all values from a source WindowInsets.

<br />

| Parameters ||
|---|---|
| `src` | `WindowInsets`: Source to copy insets from <br /> |

## Public methods

### consumeDisplayCutout

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WindowInsets consumeDisplayCutout ()
```

<br />

**This method was deprecated in API level 30.**   

Consuming of different parts individually of a `https://developer.android.com/reference/android/view/WindowInsets` instance is deprecated, since `https://developer.android.com/reference/android/view/WindowInsets` contains many different insets. Use `https://developer.android.com/reference/android/view/WindowInsets#CONSUMED` instead to stop dispatching insets.

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets` | A modified copy of this WindowInsets. This value cannot be `null`. <br /> |

### consumeStableInsets

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WindowInsets consumeStableInsets ()
```

<br />

**This method was deprecated in API level 30.**   

Consuming of different parts individually of a `https://developer.android.com/reference/android/view/WindowInsets` instance is deprecated, since `https://developer.android.com/reference/android/view/WindowInsets` contains many different insets. Use `https://developer.android.com/reference/android/view/WindowInsets#CONSUMED` instead to stop dispatching insets. On `https://developer.android.com/reference/android/os/Build.VERSION_CODES#R`, this method has no effect.

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets` | A modified copy of this WindowInsets. This value cannot be `null`. <br /> |

### consumeSystemWindowInsets

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WindowInsets consumeSystemWindowInsets ()
```

<br />

**This method was deprecated in API level 30.**   

Consuming of different parts individually of a `https://developer.android.com/reference/android/view/WindowInsets` instance is deprecated, since `https://developer.android.com/reference/android/view/WindowInsets` contains many different insets. Use `https://developer.android.com/reference/android/view/WindowInsets#CONSUMED` instead to stop dispatching insets.

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets` | A modified copy of this WindowInsets. This value cannot be `null`. <br /> |

### equals

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Indicates whether some other object is "equal to" this one.

The `equals` method implements an equivalence relation on non-null object references:

- It is *reflexive*: for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric*: for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive*: for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent*: for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.

An equivalence relation partitions the elements it operates on into *equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

<br />

| Parameters ||
|---|---|
| `o` | `Object`: This value may be `null`. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### getBoundingRects

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Returns a list of `https://developer.android.com/reference/android/graphics/Rect`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/android/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/android/view/WindowInsets#getInsets(int)`.

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

If inset by `https://developer.android.com/reference/android/view/WindowInsets#inset(android.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.

<br />

<br />

| Parameters ||
|---|---|
| `typeMask` | `int`: the insets type for which to obtain the bounding rectangles. Value is either `0` or a combination of the following: |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/Rect>` | the bounding rectangles. This value cannot be `null`. <br /> |

### getBoundingRectsIgnoringVisibility

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Returns a list of `https://developer.android.com/reference/android/graphics/Rect`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/android/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/android/view/WindowInsets#getInsetsIgnoringVisibility(int)`.

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

<br />

<br />

| Parameters ||
|---|---|
| `typeMask` | `int`: the insets type for which to obtain the bounding rectangles. Value is either `0` or a combination of the following: |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/util/List<https://developer.android.com/reference/android/graphics/Rect>` | the bounding rectangles. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If the caller tries to query `https://developer.android.com/reference/android/view/WindowInsets.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` of the currently focused view, as well as the UI state of the IME. |

### getDisplayCutout

Added in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DisplayCutout getDisplayCutout ()
```

Returns the display cutout if there is one.

Note: the display cutout will already be `https://developer.android.com/reference/android/view/WindowInsets#consumeDisplayCutout()` during dispatch to `https://developer.android.com/reference/android/view/View#onApplyWindowInsets(android.view.WindowInsets)`, unless the window has requested a `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#layoutInDisplayCutoutMode` other than `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_NEVER` or `https://developer.android.com/reference/android/view/WindowManager.LayoutParams#LAYOUT_IN_DISPLAY_CUTOUT_MODE_DEFAULT`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/DisplayCutout` | the display cutout or null if there is none <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/DisplayCutout`

### getDisplayShape

Added in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public DisplayShape getDisplayShape ()
```

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

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/DisplayShape` | the display shape. This value may be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/DisplayShape`

### getFrame

Added in [API level 35](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Size getFrame ()
```

Returns the assumed size of the window, relative to which the `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` and `https://developer.android.com/reference/android/view/WindowInsets#getBoundingRects(int)` have been calculated.

May be used with `https://developer.android.com/reference/android/view/WindowInsets#getBoundingRects(int)` to better understand their position within the window, such as the area between the edge of a bounding rect and the edge of the window.

Note: the size may not match the actual size of the window, which is determined during the layout pass - as `https://developer.android.com/reference/android/view/WindowInsets` are dispatched before layout.

Caution: using this value in determining the actual window size may make the result of layout passes unstable and should be avoided.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/util/Size` | the assumed size of the window during the inset calculation. This value cannot be `null`. <br /> |

### getInsets

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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/android/view/WindowInsets.Type`s.

<br />

| Parameters ||
|---|---|
| `typeMask` | `int`: Bit mask of `https://developer.android.com/reference/android/view/WindowInsets.Type`s to query the insets for. Value is either `0` or a combination of the following: |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Insets` | The insets. This value cannot be `null`. <br /> |

### getInsetsIgnoringVisibility

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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/android/view/WindowInsets.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 `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 inset returned here will still provide the inset associated with the status bar being shown.

<br />

<br />

| Parameters ||
|---|---|
| `typeMask` | `int`: Bit mask of `https://developer.android.com/reference/android/view/WindowInsets.Type`s to query the insets for. Value is either `0` or a combination of the following: |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Insets` | The insets. This value cannot be `null`. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | If the caller tries to query `https://developer.android.com/reference/android/view/WindowInsets.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` of the currently focused view, as well as the UI state of the IME. |

### getMandatorySystemGestureInsets

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Insets getMandatorySystemGestureInsets ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

In contrast to `https://developer.android.com/reference/android/view/WindowInsets#getSystemGestureInsets()`, **mandatory** system gestures cannot be overridden by `https://developer.android.com/reference/android/view/View#setSystemGestureExclusionRects(java.util.List<android.graphics.Rect>)`.

Simple taps are guaranteed to reach the window even within the system gesture insets, as long as they are outside the `https://developer.android.com/reference/android/view/WindowInsets#getTappableElementInsets()`.

When `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_STABLE` is requested, an inset will be returned even when the system gestures are inactive due to `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN` or `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION`.

This inset is consumed together with the `https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsets()` by `https://developer.android.com/reference/android/view/WindowInsets#consumeSystemWindowInsets()`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Insets` | This value cannot be `null`. <br /> |

**See also:**

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

### getPrivacyIndicatorBounds

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Rect getPrivacyIndicatorBounds ()
```

Returns the `https://developer.android.com/reference/android/graphics/Rect` of the maximum bounds of the system privacy indicator, for the current orientation, in relative coordinates, or null if the bounds have not been loaded yet.

The privacy indicator bounds are determined by SystemUI, and subsequently loaded once the StatusBar window has been created and attached. The bounds for all rotations are calculated and loaded at once, and this value is only expected to ever change on display or font scale changes. As long as there is a StatusBar window, this value should not be expected to be null.

The privacy indicator shows over apps when an app uses the microphone or camera permissions, while an app is in immersive mode.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Rect` | A rectangle representing the maximum bounds of the indicator <br /> |

### getRoundedCorner

Added in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public RoundedCorner getRoundedCorner (int position)
```

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

<br />

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

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/RoundedCorner` | the rounded corner of the given position. Returns `null` if there is none or the rounded corner area is not inside the application's bounds. <br /> |

### getStableInsetBottom

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getStableInsetBottom ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `int` | The bottom stable inset <br /> |

### getStableInsetLeft

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getStableInsetLeft ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `int` | The left stable inset <br /> |

### getStableInsetRight

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getStableInsetRight ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `int` | The right stable inset <br /> |

### getStableInsetTop

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getStableInsetTop ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `int` | The top stable inset <br /> |

### getStableInsets

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Insets getStableInsets ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Insets` | The stable insets. This value cannot be `null`. <br /> |

### getSystemGestureInsets

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Insets getSystemGestureInsets ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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#setSystemGestureExclusionRects(java.util.List<android.graphics.Rect>)` outside of the `https://developer.android.com/reference/android/view/WindowInsets#getMandatorySystemGestureInsets()`.

Note: the system will put a limit of `200dp` on the vertical extent of the exclusions it takes into account. The limit does not apply while the navigation bar is `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_IMMERSIVE_STICKY` hidden, nor to the `https://developer.android.com/reference/android/inputmethodservice/InputMethodService` and `https://developer.android.com/reference/android/content/Intent#CATEGORY_HOME`.

Simple taps are guaranteed to reach the window even within the system gesture insets, as long as they are outside the `https://developer.android.com/reference/android/view/WindowInsets#getTappableElementInsets()`.

When `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_STABLE` is requested, an inset will be returned even when the system gestures are inactive due to `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN` or `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION`.

This inset is consumed together with the `https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsets()` by `https://developer.android.com/reference/android/view/WindowInsets#consumeSystemWindowInsets()`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Insets` | This value cannot be `null`. <br /> |

**See also:**

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

### getSystemWindowInsetBottom

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSystemWindowInsetBottom ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `int` | The bottom system window inset <br /> |

### getSystemWindowInsetLeft

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSystemWindowInsetLeft ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `int` | The left system window inset <br /> |

### getSystemWindowInsetRight

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSystemWindowInsetRight ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `int` | The right system window inset <br /> |

### getSystemWindowInsetTop

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int getSystemWindowInsetTop ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `int` | The top system window inset <br /> |

### getSystemWindowInsets

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Insets getSystemWindowInsets ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.Type#systemBars()`

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.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Insets` | The system window insets. This value cannot be `null`. <br /> |

### getTappableElementInsets

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Insets getTappableElementInsets ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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/android/view/WindowInsets#getSystemWindowInsets()` if the system window is largely transparent and lets through simple taps (but not necessarily more complex gestures).

Note that generally, tappable elements **should** be aligned with the `https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsets()` instead to avoid overlapping with the system bars.

When `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_STABLE` is requested, an inset will be returned even when the area covered by the inset would be tappable due to `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN` or `https://developer.android.com/reference/android/view/View#SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION`.

This inset is consumed together with the `https://developer.android.com/reference/android/view/WindowInsets#getSystemWindowInsets()` by `https://developer.android.com/reference/android/view/WindowInsets#consumeSystemWindowInsets()`.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/graphics/Insets` | This value cannot be `null`. <br /> |

### hasInsets

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean hasInsets ()
```

Returns true if this WindowInsets has any nonzero insets.

<br />

| Returns ||
|---|---|
| `boolean` | true if any inset values are nonzero <br /> |

### hasStableInsets

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean hasStableInsets ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsetsIgnoringVisibility(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if any of the stable inset values are nonzero <br /> |

### hasSystemWindowInsets

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean hasSystemWindowInsets ()
```

<br />

**This method was deprecated in API level 30.**   

Use `https://developer.android.com/reference/android/view/WindowInsets#getInsets(int)` with `https://developer.android.com/reference/android/view/WindowInsets.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.

<br />

<br />

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

### hashCode

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### inset

Added in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WindowInsets inset (int left, 
                int top, 
                int right, 
                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));
```

<br />

<br />

| Parameters ||
|---|---|
| `left` | `int`: the amount of insets to remove from the left. Must be non-negative. Value is 0 or greater <br /> |
| `top` | `int`: the amount of insets to remove from the top. Must be non-negative. Value is 0 or greater <br /> |
| `right` | `int`: the amount of insets to remove from the right. Must be non-negative. Value is 0 or greater <br /> |
| `bottom` | `int`: the amount of insets to remove from the bottom. Must be non-negative. Value is 0 or greater <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets` | the inset insets. This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets#inset(android.graphics.Insets)`

### inset

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WindowInsets inset (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));
```

<br />

<br />

| Parameters ||
|---|---|
| `insets` | `Insets`: the amount of insets to remove from all sides. This value cannot be `null`. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets` | This value cannot be `null`. <br /> |

**See also:**

- `https://developer.android.com/reference/android/view/WindowInsets#inset(int,%20int,%20int,%20int)`

### isConsumed

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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#fitSystemWindows(android.graphics.Rect)`.

<br />

<br />

| Returns ||
|---|---|
| `boolean` | true if the insets have been fully consumed. <br /> |

### isRound

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

<br />

<br />

| Returns ||
|---|---|
| `boolean` | True if the window is round <br /> |

### isVisible

Added in [API level 30](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

<br />

| Parameters ||
|---|---|
| `typeMask` | `int`: Bit mask of `https://developer.android.com/reference/android/view/WindowInsets.Type`s to query visibility status. Value is either `0` or a combination of the following: |

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

### replaceSystemWindowInsets

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WindowInsets replaceSystemWindowInsets (int left, 
                int top, 
                int right, 
                int bottom)
```

<br />

**This method was deprecated in API level 29.**   

use `Builder#Builder(WindowInsets)` with `https://developer.android.com/reference/android/view/WindowInsets.Builder#setSystemWindowInsets(android.graphics.Insets)` instead.

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

Note: If the system window insets are already consumed, this method will return them unchanged on `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` and later. Prior to `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q`, the new values were applied regardless of whether they were consumed, and this method returns invalid non-zero consumed insets.

<br />

| Parameters ||
|---|---|
| `left` | `int`: New left inset in pixels <br /> |
| `top` | `int`: New top inset in pixels <br /> |
| `right` | `int`: New right inset in pixels <br /> |
| `bottom` | `int`: New bottom inset in pixels <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets` | A modified copy of this WindowInsets. This value cannot be `null`. <br /> |

### replaceSystemWindowInsets

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public WindowInsets replaceSystemWindowInsets (Rect systemWindowInsets)
```

<br />

**This method was deprecated in API level 29.**   

use `Builder#Builder(WindowInsets)` with `https://developer.android.com/reference/android/view/WindowInsets.Builder#setSystemWindowInsets(android.graphics.Insets)` instead.

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

Note: If the system window insets are already consumed, this method will return them unchanged on `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q` and later. Prior to `https://developer.android.com/reference/android/os/Build.VERSION_CODES#Q`, the new values were applied regardless of whether they were consumed, and this method returns invalid non-zero consumed insets.

<br />

| Parameters ||
|---|---|
| `systemWindowInsets` | `Rect`: New system window insets. Each field is the inset in pixels for that edge <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/view/WindowInsets` | A modified copy of this WindowInsets. This value cannot be `null`. <br /> |

### toString

Added in [API level 20](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

Returns a string representation of the object.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | a string representation of the object. <br /> |