WindowInsetsCompat.Builder

public static final class WindowInsetsCompat.Builder
extends Object

java.lang.Object
   ↳ androidx.core.view.WindowInsetsCompat.Builder


Builder for WindowInsetsCompat.

Summary

Public constructors

Builder()

Creates a builder where all insets are initially consumed.

Builder(WindowInsetsCompat insets)

Creates a builder where all insets are initialized from WindowInsetsCompat.

Public methods

WindowInsetsCompat build()

Builds a WindowInsetsCompat instance.

WindowInsetsCompat.Builder setDisplayCutout(DisplayCutoutCompat displayCutout)

Sets the display cutout.

WindowInsetsCompat.Builder setInsets(int typeMask, Insets insets)

Sets the insets of a specific window type in pixels.

WindowInsetsCompat.Builder setInsetsIgnoringVisibility(int typeMask, Insets insets)

Sets the insets a specific window type in pixels, while ignoring its visibility state.

WindowInsetsCompat.Builder setMandatorySystemGestureInsets(Insets insets)

This method is deprecated. Use setInsets(int, Insets) with WindowInsetsCompat.Type.mandatorySystemGestures().

WindowInsetsCompat.Builder setStableInsets(Insets insets)

This method is deprecated. Use setInsetsIgnoringVisibility(int, Insets) with WindowInsetsCompat.Type.systemBars().

WindowInsetsCompat.Builder setSystemGestureInsets(Insets insets)

This method is deprecated. Use setInsets(int, Insets) with WindowInsetsCompat.Type.systemGestures().

WindowInsetsCompat.Builder setSystemWindowInsets(Insets insets)

This method is deprecated. Use setInsets(int, Insets) with WindowInsetsCompat.Type.systemBars().

WindowInsetsCompat.Builder setTappableElementInsets(Insets insets)

This method is deprecated. Use setInsets(int, Insets) with WindowInsetsCompat.Type.tappableElement().

WindowInsetsCompat.Builder setVisible(int typeMask, boolean visible)

Sets whether windows that can cause insets are currently visible on screen.

Inherited methods

Public constructors

Builder

public Builder ()

Creates a builder where all insets are initially consumed.

Builder

public Builder (WindowInsetsCompat insets)

Creates a builder where all insets are initialized from WindowInsetsCompat.

Parameters
insets WindowInsetsCompat: the instance to initialize from.

Public methods

build

public WindowInsetsCompat build ()

Builds a WindowInsetsCompat instance.

Returns
WindowInsetsCompat the WindowInsetsCompat instance.

setDisplayCutout

public WindowInsetsCompat.Builder setDisplayCutout (DisplayCutoutCompat displayCutout)

Sets the display cutout.

The cutout passed will only take effect when running on API 29 and above.

Parameters
displayCutout DisplayCutoutCompat: the display cutout or null if there is none

Returns
WindowInsetsCompat.Builder itself

setInsets

public WindowInsetsCompat.Builder setInsets (int typeMask, 
                Insets insets)

Sets the insets of a specific window type in pixels.

The insets represents the area of a a window that is partially or fully obscured by the system windows identified by