{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}
public static class WindowInsets.Companion
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final boolean WindowInsetsKt.getAreNavigationBarsVisible(
@NonNull WindowInsets.Companion receiver
)
true
when the navigationBars
are being displayed, irrespective of whether they intersects with the Window.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final boolean WindowInsetsKt.getAreStatusBarsVisible(
@NonNull WindowInsets.Companion receiver
)
true
when the statusBars
are being displayed, irrespective of whether they intersects with the Window.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final boolean WindowInsetsKt.getAreSystemBarsVisible(
@NonNull WindowInsets.Companion receiver
)
true
when the systemBars
are being displayed, irrespective of whether they intersects with the Window.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getCaptionBar(@NonNull WindowInsets.Companion receiver)
For the WindowInsetsCompat.Type.captionBar
.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getCaptionBarIgnoringVisibility(
@NonNull WindowInsets.Companion receiver
)
The insets that the WindowInsetsCompat.Type.captionBar
will consume if shown. If it cannot be shown then this will be empty.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getDisplayCutout(
@NonNull WindowInsets.Companion receiver
)
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.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getIme(@NonNull WindowInsets.Companion receiver)
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
.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getImeAnimationSource(
@NonNull WindowInsets.Companion receiver
)
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.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getImeAnimationTarget(
@NonNull WindowInsets.Companion receiver
)
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.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getMandatorySystemGestures(
@NonNull WindowInsets.Companion receiver
)
For the WindowInsetsCompat.Type.mandatorySystemGestures
. These insets represents the space where system gestures have priority over application gestures.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getNavigationBars(
@NonNull WindowInsets.Companion receiver
)
For the WindowInsetsCompat.Type.navigationBars
. These insets represent where system UI places navigation bars. Interactive UI should avoid the navigation bars area.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getNavigationBarsIgnoringVisibility(
@NonNull WindowInsets.Companion receiver
)
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.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getSafeContent(@NonNull WindowInsets.Companion receiver)
The insets that include all areas that may be drawn over or have gesture confusion, including everything in safeDrawing
and safeGestures
.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getSafeDrawing(@NonNull WindowInsets.Companion receiver)
The insets that include areas where content may be covered by other drawn content. This includes all system bars
, display cutout
, and soft keyboard
.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getSafeGestures(
@NonNull WindowInsets.Companion receiver
)
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
.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getStatusBars(@NonNull WindowInsets.Companion receiver)
For the WindowInsetsCompat.Type.statusBars
.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getStatusBarsIgnoringVisibility(
@NonNull WindowInsets.Companion receiver
)
The insets that WindowInsetsCompat.Type.statusBars
will consume if shown. If the status bar can never be shown, then this will be empty.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getSystemBars(@NonNull WindowInsets.Companion receiver)
For the WindowInsetsCompat.Type.systemBars
.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getSystemBarsIgnoringVisibility(
@NonNull WindowInsets.Companion receiver
)
The insets that WindowInsetsCompat.Type.systemBars
will consume if shown.
If system bars can never be shown, then this will be empty.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getSystemGestures(
@NonNull WindowInsets.Companion receiver
)
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getTappableElement(
@NonNull WindowInsets.Companion receiver
)
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getTappableElementIgnoringVisibility(
@NonNull WindowInsets.Companion receiver
)
The insets that WindowInsetsCompat.Type.tappableElement
will consume if active.
If there are never tappable elements then this is empty.
@Composable
@NonRestartableComposable
public static final @NonNull WindowInsets WindowInsetsKt.getWaterfall(@NonNull WindowInsets.Companion receiver)
The insets for the curved areas in a waterfall display.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final boolean WindowInsetsKt.isCaptionBarVisible(
@NonNull WindowInsets.Companion receiver
)
true
when the caption bar
is being displayed, irrespective of whether it intersects with the Window.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final boolean WindowInsetsKt.isImeVisible(@NonNull WindowInsets.Companion receiver)
true
when the soft keyboard
is being displayed, irrespective of whether it intersects with the Window.
@ExperimentalLayoutApi
@Composable
@NonRestartableComposable
public static final boolean WindowInsetsKt.isTappableElementVisible(
@NonNull WindowInsets.Companion receiver
)
true
when the tappableElement
is being displayed, irrespective of whether they intersects with the Window.