-
public final class WindowInsetsCompat.Builder
Builder for WindowInsetsCompat.
-
-
Constructor Summary
Constructors Constructor Description WindowInsetsCompat.Builder()
Creates a builder where all insets are initially consumed. WindowInsetsCompat.Builder(WindowInsetsCompat insets)
Creates a builder where all insets are initialized from WindowInsetsCompat.
-
Method Summary
Modifier and Type Method Description WindowInsetsCompat.Builder
setSystemWindowInsets(@NonNull() Insets insets)
Sets system window insets in pixels. WindowInsetsCompat.Builder
setSystemGestureInsets(@NonNull() Insets insets)
Sets system gesture insets in pixels. WindowInsetsCompat.Builder
setMandatorySystemGestureInsets(@NonNull() Insets insets)
Sets mandatory system gesture insets in pixels. WindowInsetsCompat.Builder
setTappableElementInsets(@NonNull() Insets insets)
Sets tappable element insets in pixels. WindowInsetsCompat.Builder
setInsets(int typeMask, @NonNull() Insets insets)
Sets the insets of a specific window type in pixels. WindowInsetsCompat.Builder
setInsetsIgnoringVisibility(int typeMask, @NonNull() Insets insets)
Sets the insets a specific window type in pixels, while ignoring its visibility state. WindowInsetsCompat.Builder
setVisible(int typeMask, boolean visible)
Sets whether windows that can cause insets are currently visible on screen. WindowInsetsCompat.Builder
setStableInsets(@NonNull() Insets insets)
Sets the stable insets in pixels. WindowInsetsCompat.Builder
setDisplayCutout(@Nullable() DisplayCutoutCompat displayCutout)
Sets the display cutout. WindowInsetsCompat
build()
Builds a WindowInsetsCompat instance. -
-
Constructor Detail
-
WindowInsetsCompat.Builder
WindowInsetsCompat.Builder()
Creates a builder where all insets are initially consumed.
-
WindowInsetsCompat.Builder
WindowInsetsCompat.Builder(WindowInsetsCompat insets)
Creates a builder where all insets are initialized from WindowInsetsCompat.- Parameters:
insets
- the instance to initialize from.
-
-
Method Detail
-
setSystemWindowInsets
@Deprecated()@NonNull() WindowInsetsCompat.Builder setSystemWindowInsets(@NonNull() Insets insets)
Sets system window insets in pixels.
The system window inset represents the area of a full-screen window that ispartially or fully obscured by the status bar, navigation bar, IME or other systemwindows.
-
setSystemGestureInsets
@Deprecated()@NonNull() WindowInsetsCompat.Builder setSystemGestureInsets(@NonNull() Insets insets)
Sets system gesture insets in pixels.
The system gesture insets represent the area of a window where system gestures havepriority and may consume some or all touch input, e.g. due to the a system baroccupying it, or it being reserved for touch-only gestures.
The insets passed will only take effect when running on API 29 and above.
-
setMandatorySystemGestureInsets
@Deprecated()@NonNull() WindowInsetsCompat.Builder setMandatorySystemGestureInsets(@NonNull() Insets insets)
Sets mandatory system gesture insets in pixels.
The mandatory system gesture insets represent the area of a window where mandatorysystem gestures have priority and may consume some or all touch input, e.g. due to the asystem bar occupying it, or it being reserved for touch-only gestures.
In contrast to regular system gestures,mandatory system gestures cannot be overridden by setSystemGestureExclusionRects.
The insets passed will only take effect when running on API 29 and above.
-
setTappableElementInsets
@Deprecated()@NonNull() WindowInsetsCompat.Builder setTappableElementInsets(@NonNull() Insets insets)
Sets tappable element insets in pixels.
The tappable element insets represent how much tappable elements must at leastbe inset to remain both tappable and visually unobstructed by persistent system windows.
The insets passed will only take effect when running on API 29 and above.
-
setInsets
@NonNull() WindowInsetsCompat.Builder setInsets(int typeMask, @NonNull() 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 bythe system windows identified by
{@code typeMask}
.- Parameters:
typeMask
- The bitmask of Type to set the insets for.insets
- The insets to set.
-
setInsetsIgnoringVisibility
@NonNull() WindowInsetsCompat.Builder setInsetsIgnoringVisibility(int typeMask, @NonNull() Insets insets)
Sets the insets a specific window type in pixels, while ignoring its visibility state.
The insets represents the area of a a window that that may be partiallyor fully obscured by the system window identified by
{@code typeMask}
. This value doesnot change based on the visibility state of those elements. For example, if the statusbar is normally shown, but temporarily hidden, the inset returned here will stillprovide the inset associated with the status bar being shown.- Parameters:
typeMask
- The bitmask of Type to set the insets for.insets
- The insets to set.
-
setVisible
@NonNull() WindowInsetsCompat.Builder setVisible(int typeMask, boolean visible)
Sets whether windows that can cause insets are currently visible on screen.
- Parameters:
typeMask
- The bitmask of Type to set the visibility for.visible
- Whether to mark the windows as visible or not.
-
setStableInsets
@Deprecated()@NonNull() WindowInsetsCompat.Builder setStableInsets(@NonNull() Insets insets)
Sets the stable insets in pixels.
The stable inset represents the area of a full-screen window that may bepartially or fully obscured by the system UI elements. This value does not changebased on the visibility state of those elements; for example, if the status bar isnormally shown, but temporarily hidden, the stable inset will still provide the insetassociated with the status bar being shown.
The insets passed will only take effect when running on API 29 and above.
-
setDisplayCutout
@NonNull() WindowInsetsCompat.Builder setDisplayCutout(@Nullable() DisplayCutoutCompat displayCutout)
Sets the display cutout.
The cutout passed will only take effect when running on API 29 and above.
- Parameters:
displayCutout
- the display cutout or null if there is none
-
build
@NonNull() WindowInsetsCompat build()
Builds a WindowInsetsCompat instance.
-
-
-
-