# WindowInsetsCompat

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/view/WindowInsetsCompat "View this page in Java")

<br />

```
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                                                                                                                      |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[WindowInsetsCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Builder) Builder for[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat). |
| `class `[WindowInsetsCompat.Side](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Side) Class that defines different sides for insets.                                                                               |
| `class `[WindowInsetsCompat.Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type) Class that defines different types of sources causing window insets.                                                         |

|                                                   ### Constants                                                    |
|--------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat) | [CONSUMED](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#CONSUMED()) A[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)instance for which[isConsumed](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#isConsumed())returns`true`. |

|                                                                                                                                                                               ### Public constructors                                                                                                                                                                                |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#WindowInsetsCompat(androidx.core.view.WindowInsetsCompat))`(src: `[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)`?)` Constructs a new WindowInsetsCompat, copying all values from a source WindowInsetsCompat. |

|                                                   ### Public functions                                                   |
|--------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)               | ~~[consumeDisplayCutout](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#consumeDisplayCutout())~~`()` **This function is deprecated.** Consuming of different parts individually of a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)instance is deprecated, since[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)contains many different insets. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)               | ~~[consumeStableInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#consumeStableInsets())~~`()` **This function is deprecated.** Consuming of different parts individually of a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)instance is deprecated, since[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)contains many different insets. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)               | ~~[consumeSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#consumeSystemWindowInsets())~~`()` **This function is deprecated.** Consuming of different parts individually of a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)instance is deprecated, since[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)contains many different insets. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                      | [equals](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#equals(java.lang.Object))`(o: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`!)`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [DisplayCutoutCompat](https://developer.android.com/reference/kotlin/androidx/core/view/DisplayCutoutCompat)`?`          | [getDisplayCutout](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getDisplayCutout())`()` Returns the display cutout if there is one.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets)                                   | [getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))`(typeMask: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the insets of a specific set of windows causing insets, denoted by the`typeMask`bit mask of[Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)s.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets)                                   | [getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))`(typeMask: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the insets a specific set of windows can cause, denoted by the`typeMask`bit mask of[Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)s, regardless of whether that type is currently visible or not.                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets)                                   | ~~[getMandatorySystemGestureInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getMandatorySystemGestureInsets())~~`()` **This function is deprecated.** Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[mandatorySystemGestures](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#mandatorySystemGestures())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Rect](https://developer.android.com/reference/android/graphics/Rect.html)`?`                                            | [getPrivacyIndicatorBounds](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getPrivacyIndicatorBounds())`()` Returns a[Rect](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.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [RoundedCornerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/RoundedCornerCompat)`?`          | [getRoundedCorner](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getRoundedCorner(int))`(position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns the[RoundedCornerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/RoundedCornerCompat)of the given position if there is one.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                              | ~~[getStableInsetBottom](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetBottom())~~`()` **This function is deprecated.** Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                              | ~~[getStableInsetLeft](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetLeft())~~`()` **This function is deprecated.** Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                              | ~~[getStableInsetRight](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetRight())~~`()` **This function is deprecated.** Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                              | ~~[getStableInsetTop](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetTop())~~`()` **This function is deprecated.** Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets)                                   | ~~[getStableInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsets())~~`()` **This function is deprecated.** Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets)                                   | ~~[getSystemGestureInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemGestureInsets())~~`()` **This function is deprecated.** Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemGestures](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemGestures())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                              | ~~[getSystemWindowInsetBottom](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetBottom())~~`()` **This function is deprecated.** Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                              | ~~[getSystemWindowInsetLeft](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetLeft())~~`()` **This function is deprecated.** Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                              | ~~[getSystemWindowInsetRight](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetRight())~~`()` **This function is deprecated.** Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                              | ~~[getSystemWindowInsetTop](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetTop())~~`()` **This function is deprecated.** Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets)                                   | ~~[getSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsets())~~`()` **This function is deprecated.** Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets)                                   | ~~[getTappableElementInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getTappableElementInsets())~~`()` **This function is deprecated.** Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[tappableElement](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#tappableElement())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                      | [hasInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#hasInsets())`()` Returns true if this WindowInsets has any non-zero insets.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                      | ~~[hasStableInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#hasStableInsets())~~`()` **This function is deprecated.** Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                      | ~~[hasSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#hasSystemWindowInsets())~~`()` **This function is deprecated.** Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#systemBars())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                              | [hashCode](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#hashCode())`()`                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)               | [inset](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#inset(androidx.core.graphics.Insets))`(insets: `[Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets)`)` Returns a copy of this instance inset in the given directions.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)               | [inset](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#inset(int,int,int,int))`(` ` left: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` top: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` right: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` bottom: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) `)` Returns a copy of this instance inset in the given directions. |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                      | [isConsumed](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#isConsumed())`()` Check if these insets have been fully consumed.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                      | [isRound](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#isRound())`()` Returns true if the associated window has a round shape.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                      | [isVisible](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#isVisible(int))`(typeMask: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Returns whether a set of windows that may cause insets is currently visible on screen, regardless of whether it actually overlaps with this window.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)               | ~~[replaceSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#replaceSystemWindowInsets(android.graphics.Rect))~~`(systemWindowInsets: `[Rect](https://developer.android.com/reference/android/graphics/Rect.html)`)` **This function is deprecated.** use[WindowInsetsCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Builder)with[setSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Builder#setSystemWindowInsets(androidx.core.graphics.Insets))instead. <br />                                                                                                                                                                                                                                                                                                                                        |
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)               | ~~[replaceSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#replaceSystemWindowInsets(int,int,int,int))~~`(left: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, top: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, right: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`, bottom: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` **This function is deprecated.** use[WindowInsetsCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Builder)with[setSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Builder#setSystemWindowInsets(androidx.core.graphics.Insets))instead. <br />                                                                                          |
| [WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html)`?`                                | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 20)` [toWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#toWindowInsets())`()` Return the source[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html)instance used in this[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| `java-static `[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat) | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 20)` [toWindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#toWindowInsetsCompat(android.view.WindowInsets))`(insets: `[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html)`)` Wrap an instance of[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html)into a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat).                                                                                                                                                                                                                                                                                                                                                                    |
| `java-static `[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat) | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 20)` [toWindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#toWindowInsetsCompat(android.view.WindowInsets,android.view.View))`(insets: `[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html)`, view: `[View](https://developer.android.com/reference/android/view/View.html)`?)` Wrap an instance of[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html)into a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat).                                                                                                                                                                                                                                                                 |

## Constants

### CONSUMED

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

```
const val CONSUMED: WindowInsetsCompat
```

A[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)instance for which[isConsumed](https://developer.android.com/reference/kotlin/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[onApplyWindowInsets](https://developer.android.com/reference/kotlin/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                                                     |
|-----------------------------------------------------------------------------------------------------------------|---|
| [isConsumed](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#isConsumed()) |   |

## Public constructors

### WindowInsetsCompat

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

```
WindowInsetsCompat(src: WindowInsetsCompat?)
```

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

|                                                      Parameters                                                      |
|----------------------------------------------------------------------------------------------------------------------|-------------------------------------|
| `src: `[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)`?` | source from which values are copied |

## Public functions

### 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)  

```
fun [consumeDisplayCutout](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#consumeDisplayCutout())(): WindowInsetsCompat
```
| **This function is deprecated.**   
|
| Consuming of different parts individually of a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)instance is deprecated, since[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)contains many different insets. Use[CONSUMED](https://developer.android.com/reference/kotlin/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                                                   |
|------------------------------------------------------------------------------------------------------------|--------------------------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/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)  

```
fun [consumeStableInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#consumeStableInsets())(): WindowInsetsCompat
```
| **This function is deprecated.**   
|
| Consuming of different parts individually of a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)instance is deprecated, since[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)contains many different insets. Use[CONSUMED](https://developer.android.com/reference/kotlin/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                                                   |
|------------------------------------------------------------------------------------------------------------|--------------------------------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/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)  

```
fun [consumeSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#consumeSystemWindowInsets())(): WindowInsetsCompat
```
| **This function is deprecated.**   
|
| Consuming of different parts individually of a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)instance is deprecated, since[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat)contains many different insets. Use[CONSUMED](https://developer.android.com/reference/kotlin/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                                                   |
|------------------------------------------------------------------------------------------------------------|--------------------------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat) | A modified copy of this WindowInsets |

### equals

```
fun equals(o: Any!): Boolean
```  

### getDisplayCutout

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

```
fun getDisplayCutout(): DisplayCutoutCompat?
```

Returns the display cutout if there is one.

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

|                                                     Returns                                                     |
|-----------------------------------------------------------------------------------------------------------------|---------------------------------------------|
| [DisplayCutoutCompat](https://developer.android.com/reference/kotlin/androidx/core/view/DisplayCutoutCompat)`?` | the display cutout or null if there is none |

|                                                   See also                                                   |
|--------------------------------------------------------------------------------------------------------------|---|
| [DisplayCutoutCompat](https://developer.android.com/reference/kotlin/androidx/core/view/DisplayCutoutCompat) |   |

### getInsets

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

```
fun getInsets(typeMask: Int): Insets
```

Returns the insets of a specific set of windows causing insets, denoted by the`typeMask`bit mask of[Type](https://developer.android.com/reference/kotlin/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[IME](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#ime())type, which currently only works when running on devices with SDK level 23 and above.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| `typeMask: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Bit mask of[Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)s to query the insets for. |

|                                        Returns                                         |
|----------------------------------------------------------------------------------------|-------------|
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets) | The insets. |

### getInsetsIgnoringVisibility

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

```
fun getInsetsIgnoringVisibility(typeMask: Int): Insets
```

Returns the insets a specific set of windows can cause, denoted by the`typeMask`bit mask of[Type](https://developer.android.com/reference/kotlin/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[IME](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#ime())type, which currently only works when running on devices with SDK level 23 and above.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| `typeMask: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Bit mask of[Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)s to query the insets for. |

|                                        Returns                                         |
|----------------------------------------------------------------------------------------|-------------|
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets) | The insets. |

|                                                        Throws                                                         |
|-----------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [java.lang.IllegalArgumentException](https://developer.android.com/reference/java/lang/IllegalArgumentException.html) | If the caller tries to query[ime](https://developer.android.com/reference/kotlin/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[EditorInfo](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)  

```
fun [getMandatorySystemGestureInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getMandatorySystemGestureInsets())(): Insets
```
| **This function is deprecated.**   
|
| Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[mandatorySystemGestures](https://developer.android.com/reference/kotlin/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                                                                   |
|---------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getMandatorySystemGestureInsets](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)  

```
fun getPrivacyIndicatorBounds(): Rect?
```

Returns a[Rect](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)  

```
fun getRoundedCorner(position: Int): RoundedCornerCompat?
```

Returns the[RoundedCornerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/RoundedCornerCompat)of the given position if there is one.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `position: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the position of the rounded corner on the display. The value should be one of the following:[POSITION_TOP_LEFT](https://developer.android.com/reference/kotlin/androidx/core/view/RoundedCornerCompat#POSITION_TOP_LEFT()),[POSITION_TOP_RIGHT](https://developer.android.com/reference/kotlin/androidx/core/view/RoundedCornerCompat#POSITION_TOP_RIGHT()),[POSITION_BOTTOM_RIGHT](https://developer.android.com/reference/kotlin/androidx/core/view/RoundedCornerCompat#POSITION_BOTTOM_RIGHT()),[POSITION_BOTTOM_LEFT](https://developer.android.com/reference/kotlin/androidx/core/view/RoundedCornerCompat#POSITION_BOTTOM_LEFT()). |

|                                                     Returns                                                     |
|-----------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|
| [RoundedCornerCompat](https://developer.android.com/reference/kotlin/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)  

```
fun [getStableInsetBottom](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetBottom())(): Int
```
| **This function is deprecated.**   
|
| Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | 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)  

```
fun [getStableInsetLeft](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetLeft())(): Int
```
| **This function is deprecated.**   
|
| Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | 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)  

```
fun [getStableInsetRight](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetRight())(): Int
```
| **This function is deprecated.**   
|
| Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | 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)  

```
fun [getStableInsetTop](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetTop())(): Int
```
| **This function is deprecated.**   
|
| Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/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)  

```
fun [getStableInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsets())(): Insets
```
| **This function is deprecated.**   
|
| Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/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                                         |
|----------------------------------------------------------------------------------------|-------------------|
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets) | The stable insets |

|                                                              See also                                                               |
|-------------------------------------------------------------------------------------------------------------------------------------|---|
| [getStableInsetLeft](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetLeft())     |   |
| [getStableInsetTop](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetTop())       |   |
| [getStableInsetRight](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getStableInsetRight())   |   |
| [getStableInsetBottom](https://developer.android.com/reference/kotlin/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)  

```
fun [getSystemGestureInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemGestureInsets())(): Insets
```
| **This function is deprecated.**   
|
| Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemGestures](https://developer.android.com/reference/kotlin/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[setSystemGestureExclusionRects](https://developer.android.com/reference/android/view/View.html#setSystemGestureExclusionRects(java.util.List&lt;android.graphics.Rect&gt;))outside of the[mandatory system gesture insets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getMandatorySystemGestureInsets()).  

|                                                         See also                                                          |
|---------------------------------------------------------------------------------------------------------------------------|---|
| [getSystemGestureInsets](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)  

```
fun [getSystemWindowInsetBottom](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetBottom())(): Int
```
| **This function is deprecated.**   
|
| Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | 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)  

```
fun [getSystemWindowInsetLeft](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetLeft())(): Int
```
| **This function is deprecated.**   
|
| Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | 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)  

```
fun [getSystemWindowInsetRight](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetRight())(): Int
```
| **This function is deprecated.**   
|
| Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | 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)  

```
fun [getSystemWindowInsetTop](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetTop())(): Int
```
| **This function is deprecated.**   
|
| Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | 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)  

```
fun [getSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsets())(): Insets
```
| **This function is deprecated.**   
|
| Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/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                                         |
|----------------------------------------------------------------------------------------|--------------------------|
| [Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets) | The system window insets |

|                                                                    See also                                                                     |
|-------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getSystemWindowInsetLeft](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetLeft())     |   |
| [getSystemWindowInsetTop](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetTop())       |   |
| [getSystemWindowInsetRight](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getSystemWindowInsetRight())   |   |
| [getSystemWindowInsetBottom](https://developer.android.com/reference/kotlin/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)  

```
fun [getTappableElementInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getTappableElementInsets())(): Insets
```
| **This function is deprecated.**   
|
| Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[tappableElement](https://developer.android.com/reference/kotlin/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[getSystemWindowInsets](https://developer.android.com/reference/kotlin/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                                                            |
|-------------------------------------------------------------------------------------------------------------------------------|---|
| [getTappableElementInsets](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)  

```
fun hasInsets(): Boolean
```

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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | 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)  

```
fun [hasStableInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#hasStableInsets())(): Boolean
```
| **This function is deprecated.**   
|
| Use[getInsetsIgnoringVisibility](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsetsIgnoringVisibility(int))with[systemBars](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | 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)  

```
fun [hasSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#hasSystemWindowInsets())(): Boolean
```
| **This function is deprecated.**   
|
| Use[getInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#getInsets(int))with[systemBars](https://developer.android.com/reference/kotlin/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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if any of the system window inset values are nonzero |

### hashCode

```
fun hashCode(): Int
```  

### inset

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

```
fun inset(insets: Insets): WindowInsetsCompat
```

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:  

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

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|------------------------------------------------|
| `insets: `[Insets](https://developer.android.com/reference/kotlin/androidx/core/graphics/Insets) | the amount of insets to remove from all sides. |

|                                                       See also                                                       |
|----------------------------------------------------------------------------------------------------------------------|---|
| [inset](https://developer.android.com/reference/kotlin/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)  

```
fun inset(
    left: @IntRange(from = 0) Int,
    top: @IntRange(from = 0) Int,
    right: @IntRange(from = 0) Int,
    bottom: @IntRange(from = 0) Int
): WindowInsetsCompat
```

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:  

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

|                                                                                         Parameters                                                                                         |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------|
| `left: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)   | the amount of insets to remove from the left. Must be non-negative.   |
| `top: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)    | the amount of insets to remove from the top. Must be non-negative.    |
| `right: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)  | the amount of insets to remove from the right. Must be non-negative.  |
| `bottom: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the amount of insets to remove from the bottom. Must be non-negative. |

|                                                  Returns                                                   |
|------------------------------------------------------------------------------------------------------------|------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat) | the inset insets |

### isConsumed

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

```
fun isConsumed(): Boolean
```

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[fitSystemWindows](https://developer.android.com/reference/android/view/View.html#fitSystemWindows(android.graphics.Rect)).  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|----------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | 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)  

```
fun isRound(): Boolean
```

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](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the window is round |

### isVisible

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

```
fun isVisible(typeMask: Int): Boolean
```

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[IME](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type#ime())type, which currently only works when running on devices with SDK level 23 and above.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| `typeMask: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Bit mask of[Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)s to query visibility status. |

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | `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)  

```
fun [replaceSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#replaceSystemWindowInsets(android.graphics.Rect))(systemWindowInsets: Rect): WindowInsetsCompat
```
| **This function is deprecated.**   
|
| use[WindowInsetsCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Builder)with[setSystemWindowInsets](https://developer.android.com/reference/kotlin/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                                            |
|--------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| `systemWindowInsets: `[Rect](https://developer.android.com/reference/android/graphics/Rect.html) | New system window insets. Each field is the inset in pixels for that edge |

|                                                  Returns                                                   |
|------------------------------------------------------------------------------------------------------------|--------------------------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/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)  

```
fun [replaceSystemWindowInsets](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat#replaceSystemWindowInsets(int,int,int,int))(left: Int, top: Int, right: Int, bottom: Int): WindowInsetsCompat
```
| **This function is deprecated.**   
|
| use[WindowInsetsCompat.Builder](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Builder)with[setSystemWindowInsets](https://developer.android.com/reference/kotlin/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                                       |
|---------------------------------------------------------------------------------------|----------------------------|
| `left: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)   | New left inset in pixels   |
| `top: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)    | New top inset in pixels    |
| `right: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)  | New right inset in pixels  |
| `bottom: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | New bottom inset in pixels |

|                                                  Returns                                                   |
|------------------------------------------------------------------------------------------------------------|--------------------------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/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)  

```
@RequiresApi(value = 20)
fun toWindowInsets(): WindowInsets?
```

Return the source[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html)instance used in this[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat).  

|                                          Returns                                          |
|-------------------------------------------------------------------------------------------|-----------------------------------|
| [WindowInsets](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)  

```
@RequiresApi(value = 20)
java-static fun toWindowInsetsCompat(insets: WindowInsets): WindowInsetsCompat
```

Wrap an instance of[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html)into a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat).

This version of the function does not allow the resulting[WindowInsetsCompat](https://developer.android.com/reference/kotlin/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[Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)s will be incorrect.

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

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|-----------------------|
| `insets: `[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html) | source insets to wrap |

|                                                  Returns                                                   |
|------------------------------------------------------------------------------------------------------------|----------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat) | the wrapped instance |

### toWindowInsetsCompat

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

```
@RequiresApi(value = 20)
java-static fun toWindowInsetsCompat(insets: WindowInsets, view: View?): WindowInsetsCompat
```

Wrap an instance of[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html)into a[WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat).

This version of the function allows the resulting[WindowInsetsCompat](https://developer.android.com/reference/kotlin/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[Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)s to return correct values when used on devices running Android 10 and before.  

|                                            Parameters                                            |
|--------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| `insets: `[WindowInsets](https://developer.android.com/reference/android/view/WindowInsets.html) | source insets to wrap                                                                                                                         |
| `view: `[View](https://developer.android.com/reference/android/view/View.html)`?`                | 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                                                   |
|------------------------------------------------------------------------------------------------------------|----------------------|
| [WindowInsetsCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat) | the wrapped instance |