WindowInsetsCompat

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.

getMandatorySystemGestureInsets

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.

getStableInsetBottom

public int getStableInsetBottom ()

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

The bottom stable inset

getStableInsetLeft

public int getStableInsetLeft ()

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

The left stable inset

getStableInsetRight

public int getStableInsetRight ()

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

The right stable inset

getStableInsetTop

public int getStableInsetTop ()

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.

Returns

int

The top stable inset

getStableInsets

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.

getSystemGestureInsets

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.

hasInsets

When running on platforms with API 19 and below, this method always returns false.

Returns

boolean

true if any inset values are nonzero

hasStableInsets

public boolean hasStableInsets ()

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

true if any of the stable inset values are nonzero

hasSystemWindowInsets

public boolean hasSystemWindowInsets ()

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.

isConsumed

public boolean isConsumed ()

Check if these insets have been fully consumed.

Insets are considered "consumed" if the applicable consume* methods
have been called such that all insets have been set to zero. This affects propagation of
insets through the view hierarchy; insets that have not been fully consumed will continue
to propagate down to child views.

isRound

public boolean isRound ()

Returns true if the associated window has a round shape.

A round window's left, top, right and bottom edges reach all the way to the
associated edges of the window but the corners may not be visible. Views responding
to round insets should take care to not lay out critical elements within the corners
where they may not be accessible.

When running on platforms with API 19 and below, this method always returns false.