# WindowInsetsControllerCompat

# WindowInsetsControllerCompat

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

*** ** * ** ***

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

<br />

```
class WindowInsetsControllerCompat
```

<br />

*** ** * ** ***

Provide simple controls of windows that generate insets. For SDKs \>= 30, this class is a simple wrapper around[WindowInsetsController](https://developer.android.com/reference/android/view/WindowInsetsController.html). For lower SDKs, this class aims to behave as close as possible to the original implementation.

## Summary

|                                                                                                                                                                                                                                                       ### Nested types                                                                                                                                                                                                                                                       |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `interface `[WindowInsetsControllerCompat.OnControllableInsetsChangedListener](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat.OnControllableInsetsChangedListener) Listener to be notified when the set of controllable[WindowInsetsCompat.Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)controlled by a[WindowInsetsController](https://developer.android.com/reference/android/view/WindowInsetsController.html)changes. |

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [BEHAVIOR_DEFAULT](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#BEHAVIOR_DEFAULT())` = 1` The default option for[setSystemBarsBehavior](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#setSystemBarsBehavior(int)): Window would like to remain interactive when hiding navigation bars by calling[hide](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#hide(int))or[setInsetsAndAlpha](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControllerCompat#setInsetsAndAlpha(androidx.core.graphics.Insets,float,float)).                               |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [BEHAVIOR_SHOW_BARS_BY_SWIPE](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#BEHAVIOR_SHOW_BARS_BY_SWIPE())` = 1` **This property is deprecated.** Use[BEHAVIOR_DEFAULT](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#BEHAVIOR_DEFAULT())instead. <br />                                                                                                                                                                                                                                                                                                                                                                                     |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [BEHAVIOR_SHOW_BARS_BY_TOUCH](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#BEHAVIOR_SHOW_BARS_BY_TOUCH())` = 0` **This property is deprecated.** This is not supported on Android[S](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#S())and later. <br />                                                                                                                                                                                                                                                                                                                                                                                                       |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE())` = 2` Option for[setSystemBarsBehavior](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#setSystemBarsBehavior(int)): Window would like to remain interactive when hiding navigation bars by calling[hide](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#hide(int))or[setInsetsAndAlpha](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControllerCompat#setInsetsAndAlpha(androidx.core.graphics.Insets,float,float)). |

|                                                                                                                                                                          ### Public constructors                                                                                                                                                                           |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [WindowInsetsControllerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#WindowInsetsControllerCompat(android.view.Window,android.view.View))`(window: `[Window](https://developer.android.com/reference/android/view/Window.html)`, view: `[View](https://developer.android.com/reference/android/view/View.html)`)` |

|                                                             ### Public functions                                                             |
|----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                | [addOnControllableInsetsChangedListener](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#addOnControllableInsetsChangedListener(androidx.core.view.WindowInsetsControllerCompat.OnControllableInsetsChangedListener))`(` ` listener: `[WindowInsetsControllerCompat.OnControllableInsetsChangedListener](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat.OnControllableInsetsChangedListener) `)` Adds a[WindowInsetsController.OnControllableInsetsChangedListener](https://developer.android.com/reference/android/view/WindowInsetsController.OnControllableInsetsChangedListener.html)to the window insets controller.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                | [controlWindowInsetsAnimation](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#controlWindowInsetsAnimation(int,long,android.view.animation.Interpolator,android.os.CancellationSignal,androidx.core.view.WindowInsetsAnimationControlListenerCompat))`(` ` types: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`,` ` durationMillis: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)`,` ` interpolator: `[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)`?,` ` cancellationSignal: `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal.html)`?,` ` listener: `[WindowInsetsAnimationControlListenerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControlListenerCompat) `)` Lets the application control window inset animations in a frame-by-frame manner by modifying the position of the windows in the system causing insets directly using[setInsetsAndAlpha](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControllerCompat#setInsetsAndAlpha(androidx.core.graphics.Insets,float,float))in the controller provided by the given listener. |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                  | [getSystemBarsBehavior](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#getSystemBarsBehavior())`()` Retrieves the requested behavior of system bars.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                | [hide](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#hide(int))`(types: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Makes a set of windows causing insets disappear.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                          | [isAppearanceLightNavigationBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#isAppearanceLightNavigationBars())`()` Checks if the foreground of the navigation bar is set to light.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                          | [isAppearanceLightStatusBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#isAppearanceLightStatusBars())`()` Checks if the foreground of the status bar is set to light.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                | [removeOnControllableInsetsChangedListener](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#removeOnControllableInsetsChangedListener(androidx.core.view.WindowInsetsControllerCompat.OnControllableInsetsChangedListener))`(` ` listener: `[WindowInsetsControllerCompat.OnControllableInsetsChangedListener](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat.OnControllableInsetsChangedListener) `)` Removes a[WindowInsetsController.OnControllableInsetsChangedListener](https://developer.android.com/reference/android/view/WindowInsetsController.OnControllableInsetsChangedListener.html)from the window insets controller.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                | [setAppearanceLightNavigationBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#setAppearanceLightNavigationBars(boolean))`(isLight: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` If true, changes the foreground color of the navigation bars to light so that the items on the bar can be read clearly.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                | [setAppearanceLightStatusBars](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#setAppearanceLightStatusBars(boolean))`(isLight: `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)`)` If true, changes the foreground color of the status bars to light so that the items on the bar can be read clearly.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                | [setSystemBarsBehavior](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#setSystemBarsBehavior(int))`(behavior: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Controls the behavior of system bars.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| [Unit](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-unit/index.html)                                                                | [show](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#show(int))`(types: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Makes a set of windows that cause insets appear on screen.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| `java-static `[WindowInsetsControllerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat) | `@`[RequiresApi](https://developer.android.com/reference/kotlin/androidx/annotation/RequiresApi)`(value = 30)` ~~[toWindowInsetsControllerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#toWindowInsetsControllerCompat(android.view.WindowInsetsController))~~`(` ` insetsController: `[WindowInsetsController](https://developer.android.com/reference/android/view/WindowInsetsController.html) `)` **This function is deprecated.** Use[getInsetsController](https://developer.android.com/reference/kotlin/androidx/core/view/WindowCompat#getInsetsController(android.view.Window,android.view.View))instead <br />                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

## Constants

### BEHAVIOR_DEFAULT

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

```
const val BEHAVIOR_DEFAULT = 1: Int
```

The default option for[setSystemBarsBehavior](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#setSystemBarsBehavior(int)): Window would like to remain interactive when hiding navigation bars by calling[hide](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#hide(int))or[setInsetsAndAlpha](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControllerCompat#setInsetsAndAlpha(androidx.core.graphics.Insets,float,float)).

When system bars are hidden in this mode, they can be revealed with system gestures, such as swiping from the edge of the screen where the bar is hidden from.

When the gesture navigation is enabled, the system gestures can be triggered regardless the visibility of system bars.  

### BEHAVIOR_SHOW_BARS_BY_SWIPE

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

```
const val BEHAVIOR_SHOW_BARS_BY_SWIPE = 1: Int
```
| **This property is deprecated.**   
|
| Use[BEHAVIOR_DEFAULT](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#BEHAVIOR_DEFAULT())instead.

Option for[setSystemBarsBehavior](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#setSystemBarsBehavior(int)): Window would like to remain interactive when hiding navigation bars by calling[hide](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#hide(int))or[setInsetsAndAlpha](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControllerCompat#setInsetsAndAlpha(androidx.core.graphics.Insets,float,float)).

When system bars are hidden in this mode, they can be revealed with system gestures, such as swiping from the edge of the screen where the bar is hidden from.  

### BEHAVIOR_SHOW_BARS_BY_TOUCH

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

```
const val BEHAVIOR_SHOW_BARS_BY_TOUCH = 0: Int
```
| **This property is deprecated.**   
|
| This is not supported on Android[S](https://developer.android.com/reference/android/os/Build.VERSION_CODES.html#S())and later. Use[BEHAVIOR_DEFAULT](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#BEHAVIOR_DEFAULT())or[BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE())instead.

Option for[setSystemBarsBehavior](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#setSystemBarsBehavior(int)). System bars will be forcibly shown on any user interaction on the corresponding display if navigation bars are hidden by[hide](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#hide(int))or[setInsetsAndAlpha](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControllerCompat#setInsetsAndAlpha(androidx.core.graphics.Insets,float,float)).  

### BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE

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

```
const val BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE = 2: Int
```

Option for[setSystemBarsBehavior](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#setSystemBarsBehavior(int)): Window would like to remain interactive when hiding navigation bars by calling[hide](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#hide(int))or[setInsetsAndAlpha](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControllerCompat#setInsetsAndAlpha(androidx.core.graphics.Insets,float,float)).

When system bars are hidden in this mode, they can be revealed temporarily with system gestures, such as swiping from the edge of the screen where the bar is hidden from. These transient system bars will overlay app's content, may have some degree of transparency, and will automatically hide after a short timeout.  

## Public constructors

### WindowInsetsControllerCompat

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

```
WindowInsetsControllerCompat(window: Window, view: View)
```  

## Public functions

### addOnControllableInsetsChangedListener

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

```
fun addOnControllableInsetsChangedListener(
    listener: WindowInsetsControllerCompat.OnControllableInsetsChangedListener
): Unit
```

Adds a[WindowInsetsController.OnControllableInsetsChangedListener](https://developer.android.com/reference/android/view/WindowInsetsController.OnControllableInsetsChangedListener.html)to the window insets controller.  

|                                                                                                     Parameters                                                                                                     |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|
| `listener: `[WindowInsetsControllerCompat.OnControllableInsetsChangedListener](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat.OnControllableInsetsChangedListener) | The listener to add. |

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

### controlWindowInsetsAnimation

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

```
fun controlWindowInsetsAnimation(
    types: Int,
    durationMillis: Long,
    interpolator: Interpolator?,
    cancellationSignal: CancellationSignal?,
    listener: WindowInsetsAnimationControlListenerCompat
): Unit
```

Lets the application control window inset animations in a frame-by-frame manner by modifying the position of the windows in the system causing insets directly using[setInsetsAndAlpha](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControllerCompat#setInsetsAndAlpha(androidx.core.graphics.Insets,float,float))in the controller provided by the given listener.

This method only works on API \>= 30 since there is no way to control the window in the system on prior APIs.  

|                                                                               Parameters                                                                               |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `types: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                   | The[WindowInsetsCompat.Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)s the application has requested to control.                                                                                                                                                                                                                                                                                 |
| `durationMillis: `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                                                        | Duration of animation in[MILLISECONDS](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html#MILLISECONDS), or -1 if the animation doesn't have a predetermined duration. This value will be passed to[getDurationMillis](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationCompat#getDurationMillis())                                                                                  |
| `interpolator: `[Interpolator](https://developer.android.com/reference/android/view/animation/Interpolator.html)`?`                                                    | The interpolator used for this animation, or`null `if this animation doesn't follow an interpolation curve. This value will be passed to[getInterpolator](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationCompat#getInterpolator())and used to calculate[getInterpolatedFraction](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationCompat#getInterpolatedFraction()). |
| `cancellationSignal: `[CancellationSignal](https://developer.android.com/reference/android/os/CancellationSignal.html)`?`                                              | A cancellation signal that the caller can use to cancel the request to obtain control, or once they have control, to cancel the control.                                                                                                                                                                                                                                                                                                           |
| `listener: `[WindowInsetsAnimationControlListenerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationControlListenerCompat) | The[WindowInsetsAnimationControlListener](https://developer.android.com/reference/android/view/WindowInsetsAnimationControlListener.html)that gets called when the windows are ready to be controlled, among other callbacks.                                                                                                                                                                                                                      |

|                                                                      See also                                                                      |
|----------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [getFraction](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationCompat#getFraction())                         |   |
| [getInterpolatedFraction](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationCompat#getInterpolatedFraction()) |   |
| [getInterpolator](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationCompat#getInterpolator())                 |   |
| [getDurationMillis](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsAnimationCompat#getDurationMillis())             |   |

### getSystemBarsBehavior

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

```
fun getSystemBarsBehavior(): Int
```

Retrieves the requested behavior of system bars.  

|                                   Returns                                   |
|-----------------------------------------------------------------------------|----------------------------------------------------|
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | the system bar behavior controlled by this window. |

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

### hide

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

```
fun hide(types: Int): Unit
```

Makes a set of windows causing insets disappear.

Note that if the window currently doesn't have control over a certain type, it will apply the change as soon as the window gains control. The app can listen to the event by observing[onApplyWindowInsets](https://developer.android.com/reference/android/view/View.html#onApplyWindowInsets(android.view.WindowInsets))and checking visibility with[isVisible](https://developer.android.com/reference/android/view/WindowInsets.html#isVisible(int)).  

|                                      Parameters                                      |
|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `types: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | A bitmask of[WindowInsetsCompat.Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)specifying what windows the app would like to make disappear. |

### isAppearanceLightNavigationBars

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

```
fun isAppearanceLightNavigationBars(): Boolean
```

Checks if the foreground of the navigation bar is set to light.

This method always returns false on API \<26.

If this value is being set in the theme (via[windowLightNavigationBar](https://developer.android.com/reference/android/R.attr.html#windowLightNavigationBar())), then the correct value will only be returned once attached to the window.

Once this method is called, modifying \`systemUiVisibility\` directly to change the appearance is undefined behavior.  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|---------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the foreground is light |

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

### isAppearanceLightStatusBars

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

```
fun isAppearanceLightStatusBars(): Boolean
```

Checks if the foreground of the status bar is set to light.

This method always returns false on API \<23.

If this value is being set in the theme (via[windowLightStatusBar](https://developer.android.com/reference/android/R.attr.html#windowLightStatusBar())), then the correct value will only be returned once attached to the window.

Once this method is called, modifying \`systemUiVisibility\` directly to change the appearance is undefined behavior.  

|                                       Returns                                       |
|-------------------------------------------------------------------------------------|---------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | true if the foreground is light |

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

### removeOnControllableInsetsChangedListener

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

```
fun removeOnControllableInsetsChangedListener(
    listener: WindowInsetsControllerCompat.OnControllableInsetsChangedListener
): Unit
```

Removes a[WindowInsetsController.OnControllableInsetsChangedListener](https://developer.android.com/reference/android/view/WindowInsetsController.OnControllableInsetsChangedListener.html)from the window insets controller.  

|                                                                                                     Parameters                                                                                                     |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------|
| `listener: `[WindowInsetsControllerCompat.OnControllableInsetsChangedListener](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat.OnControllableInsetsChangedListener) | The listener to remove. |

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

### setAppearanceLightNavigationBars

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

```
fun setAppearanceLightNavigationBars(isLight: Boolean): Unit
```

If true, changes the foreground color of the navigation bars to light so that the items on the bar can be read clearly. If false, reverts to the default appearance.

This method has no effect on API \<26.

Once this method is called, modifying \`systemUiVisibility\` directly to change the appearance is undefined behavior.  

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

### setAppearanceLightStatusBars

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

```
fun setAppearanceLightStatusBars(isLight: Boolean): Unit
```

If true, changes the foreground color of the status bars to light so that the items on the bar can be read clearly. If false, reverts to the default appearance.

This method has no effect on API \<23.

Once this method is called, modifying \`systemUiVisibility\` directly to change the appearance is undefined behavior.  

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

### setSystemBarsBehavior

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

```
fun setSystemBarsBehavior(behavior: Int): Unit
```

Controls the behavior of system bars.  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|----------------------------------------------------------------------|
| `behavior: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Determines how the bars behave when being hidden by the application. |

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

### show

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

```
fun show(types: Int): Unit
```

Makes a set of windows that cause insets appear on screen.

Note that if the window currently doesn't have control over a certain type, it will apply the change as soon as the window gains control. The app can listen to the event by observing[onApplyWindowInsets](https://developer.android.com/reference/android/view/View.html#onApplyWindowInsets(android.view.WindowInsets))and checking visibility with[isVisible](https://developer.android.com/reference/android/view/WindowInsets.html#isVisible(int)).  

|                                      Parameters                                      |
|--------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `types: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | A bitmask of[WindowInsetsCompat.Type](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsCompat.Type)specifying what windows the app would like to make appear on screen. |

### toWindowInsetsControllerCompat

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

```
@RequiresApi(value = 30)
java-static fun [toWindowInsetsControllerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat#toWindowInsetsControllerCompat(android.view.WindowInsetsController))(
    insetsController: WindowInsetsController
): WindowInsetsControllerCompat
```
| **This function is deprecated.**   
|
| Use[getInsetsController](https://developer.android.com/reference/kotlin/androidx/core/view/WindowCompat#getInsetsController(android.view.Window,android.view.View))instead

Wrap a[WindowInsetsController](https://developer.android.com/reference/android/view/WindowInsetsController.html)into a[WindowInsetsControllerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat)for compatibility purpose.  

|                                                           Parameters                                                           |
|--------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| `insetsController: `[WindowInsetsController](https://developer.android.com/reference/android/view/WindowInsetsController.html) | The[WindowInsetsController](https://developer.android.com/reference/android/view/WindowInsetsController.html)to wrap. |

|                                                            Returns                                                             |
|--------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [WindowInsetsControllerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat) | The provided[WindowInsetsController](https://developer.android.com/reference/android/view/WindowInsetsController.html)wrapped into a[WindowInsetsControllerCompat](https://developer.android.com/reference/kotlin/androidx/core/view/WindowInsetsControllerCompat) |