{% setvar book_path %}/reference/kotlin/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

WindowInsets.Companion


Summary

Extension properties

Boolean

true when the navigationBars are being displayed, irrespective of whether they intersects with the Window.

android
Boolean

true when the statusBars are being displayed, irrespective of whether they intersects with the Window.

android
Boolean

true when the systemBars are being displayed, irrespective of whether they intersects with the Window.

android
WindowInsets

For the WindowInsetsCompat.Type.captionBar.

android
WindowInsets

The insets that the WindowInsetsCompat.Type.captionBar will consume if shown.

android
WindowInsets

For the WindowInsetsCompat.Type.displayCutout.

android
WindowInsets

For the WindowInsetsCompat.Type.ime.

android
WindowInsets

The WindowInsets for the IME before the IME started animating in.

android
WindowInsets

The WindowInsets for the IME when the animation completes, if it is allowed to complete successfully.

android
Boolean

true when the caption bar is being displayed, irrespective of whether it intersects with the Window.

android
Boolean

true when the soft keyboard is being displayed, irrespective of whether it intersects with the Window.

android
Boolean

true when the tappableElement is being displayed, irrespective of whether they intersects with the Window.

android
WindowInsets

For the WindowInsetsCompat.Type.mandatorySystemGestures.

android
WindowInsets

For the WindowInsetsCompat.Type.navigationBars.

android
WindowInsets

The insets that WindowInsetsCompat.Type.navigationBars will consume if shown.

android
WindowInsets

The insets that include all areas that may be drawn over or have gesture confusion, including everything in safeDrawing and safeGestures.

android
WindowInsets

The insets that include areas where content may be covered by other drawn content.

android
WindowInsets

The insets that include areas where gestures may be confused with other input, including system gestures, mandatory system gestures, rounded display areas, and tappable areas.

android
WindowInsets

For the WindowInsetsCompat.Type.statusBars.

android
WindowInsets

The insets that WindowInsetsCompat.Type.statusBars will consume if shown.

android
WindowInsets

For the WindowInsetsCompat.Type.systemBars.

android
WindowInsets

The insets that WindowInsetsCompat.Type.systemBars will consume if shown.

android
WindowInsets

For the WindowInsetsCompat.Type.systemGestures.

android
WindowInsets

For the WindowInsetsCompat.Type.tappableElement.

android
WindowInsets

The insets that WindowInsetsCompat.Type.tappableElement will consume if active.

android
WindowInsets

The insets for the curved areas in a waterfall display.

android

Extension properties

areNavigationBarsVisible

@ExperimentalLayoutApi
val WindowInsets.Companion.areNavigationBarsVisibleBoolean

true when the navigationBars are being displayed, irrespective of whether they intersects with the Window.

areStatusBarsVisible

@ExperimentalLayoutApi
val WindowInsets.Companion.areStatusBarsVisibleBoolean

true when the statusBars are being displayed, irrespective of whether they intersects with the Window.

areSystemBarsVisible

@ExperimentalLayoutApi
val WindowInsets.Companion.areSystemBarsVisibleBoolean

true when the systemBars are being displayed, irrespective of whether they intersects with the Window.

captionBarIgnoringVisibility

@ExperimentalLayoutApi
val WindowInsets.Companion.captionBarIgnoringVisibilityWindowInsets

The insets that the WindowInsetsCompat.Type.captionBar will consume if shown. If it cannot be shown then this will be empty.

displayCutout

val WindowInsets.Companion.displayCutoutWindowInsets

For the WindowInsetsCompat.Type.displayCutout. This insets represents the area that the display cutout (e.g. for camera) is and important content should be excluded from.

ime

val WindowInsets.Companion.imeWindowInsets

For the WindowInsetsCompat.Type.ime. On API level 23 (M) and above, the soft keyboard can be detected and ime will update when it shows. On API 30 (R) and above, the ime insets will animate synchronously with the actual IME animation.

Developers should set android:windowSoftInputMode="adjustResize" in their AndroidManifest.xml file and call WindowCompat.setDecorFitsSystemWindows(window, false) in their android.app.Activity.onCreate.

imeAnimationSource

@ExperimentalLayoutApi
val WindowInsets.Companion.imeAnimationSourceWindowInsets

The WindowInsets for the IME before the IME started animating in. The current animated value is WindowInsets.Companion.ime.

This will be the same as imeAnimationTarget when there is no IME animation in progress.

imeAnimationTarget

@ExperimentalLayoutApi
val WindowInsets.Companion.imeAnimationTargetWindowInsets

The WindowInsets for the IME when the animation completes, if it is allowed to complete successfully. The current animated value is WindowInsets.Companion.ime.

This will be the same as imeAnimationSource when there is no IME animation in progress.

isCaptionBarVisible

@ExperimentalLayoutApi
val WindowInsets.Companion.isCaptionBarVisibleBoolean

true when the caption bar is being displayed, irrespective of whether it intersects with the Window.

isImeVisible

@ExperimentalLayoutApi
val WindowInsets.Companion.isImeVisibleBoolean

true when the soft keyboard is being displayed, irrespective of whether it intersects with the Window.

isTappableElementVisible

@ExperimentalLayoutApi
val WindowInsets.Companion.isTappableElementVisibleBoolean

true when the tappableElement is being displayed, irrespective of whether they intersects with the Window.

mandatorySystemGestures

val WindowInsets.Companion.mandatorySystemGesturesWindowInsets

For the WindowInsetsCompat.Type.mandatorySystemGestures. These insets represents the space where system gestures have priority over application gestures.

navigationBars

val WindowInsets.Companion.navigationBarsWindowInsets

For the WindowInsetsCompat.Type.navigationBars. These insets represent where system UI places navigation bars. Interactive UI should avoid the navigation bars area.

navigationBarsIgnoringVisibility

@ExperimentalLayoutApi
val WindowInsets.Companion.navigationBarsIgnoringVisibilityWindowInsets

The insets that WindowInsetsCompat.Type.navigationBars will consume if shown. These insets represent where system UI places navigation bars. Interactive UI should avoid the navigation bars area. If navigation bars cannot be shown, then this will be empty.

safeContent

val WindowInsets.Companion.safeContentWindowInsets

The insets that include all areas that may be drawn over or have gesture confusion, including everything in safeDrawing and safeGestures.

safeDrawing

val WindowInsets.Companion.safeDrawingWindowInsets

The insets that include areas where content may be covered by other drawn content. This includes all system bars, display cutout, and soft keyboard.

safeGestures

val WindowInsets.Companion.safeGesturesWindowInsets

The insets that include areas where gestures may be confused with other input, including system gestures, mandatory system gestures, rounded display areas, and tappable areas.

statusBarsIgnoringVisibility

@ExperimentalLayoutApi
val WindowInsets.Companion.statusBarsIgnoringVisibilityWindowInsets

The insets that WindowInsetsCompat.Type.statusBars will consume if shown. If the status bar can never be shown, then this will be empty.

systemBarsIgnoringVisibility

@ExperimentalLayoutApi
val WindowInsets.Companion.systemBarsIgnoringVisibilityWindowInsets

The insets that WindowInsetsCompat.Type.systemBars will consume if shown.

If system bars can never be shown, then this will be empty.

tappableElementIgnoringVisibility

@ExperimentalLayoutApi
val WindowInsets.Companion.tappableElementIgnoringVisibilityWindowInsets

The insets that WindowInsetsCompat.Type.tappableElement will consume if active.

If there are never tappable elements then this is empty.

waterfall

val WindowInsets.Companion.waterfallWindowInsets

The insets for the curved areas in a waterfall display.