WindowInsetsCompat.Builder
class WindowInsetsCompat.Builder
Builder for WindowInsetsCompat.
Summary
Public constructors |
|---|
Builder()Creates a builder where all insets are initially consumed. |
Builder(insets: WindowInsetsCompat)Creates a builder where all insets are initialized from |
Public constructors
Builder
Builder(insets: WindowInsetsCompat)
Creates a builder where all insets are initialized from WindowInsetsCompat.
| Parameters | |
|---|---|
insets: WindowInsetsCompat |
the instance to initialize from. |
Public functions
build
fun build(): WindowInsetsCompat
Builds a WindowInsetsCompat instance.
| Returns | |
|---|---|
WindowInsetsCompat |
the |
setDisplayCutout
fun setDisplayCutout(displayCutout: DisplayCutoutCompat?): WindowInsetsCompat.Builder
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 |
| See also | |
|---|---|
getDisplayCutout |
setInsets
fun setInsets(typeMask: Int, insets: Insets): WindowInsetsCompat.Builder
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 typeMask.
| Parameters | |
|---|---|
typeMask: Int |
The bitmask of |
insets: Insets |
The insets to set. |
| Returns | |
|---|---|
WindowInsetsCompat.Builder |
itself |
| See also | |
|---|---|
getInsets |
setInsetsIgnoringVisibility
fun setInsetsIgnoringVisibility(typeMask: Int, insets: Insets): WindowInsetsCompat.Builder
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 partially or fully obscured by the system window identified by typeMask. 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 inset returned here will still provide the inset associated with the status bar being shown.
| Parameters | |
|---|---|
typeMask: Int |
The bitmask of |
insets: Insets |
The insets to set. |
| Returns | |
|---|---|
WindowInsetsCompat.Builder |
itself |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
If |
| See also | |
|---|---|
getInsetsIgnoringVisibility |
funsetMandatorySystemGestureInsets(insets: Insets): WindowInsetsCompat.Builder
Sets mandatory system gesture insets in pixels.
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.
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.
| Returns | |
|---|---|
WindowInsetsCompat.Builder |
itself |
| See also | |
|---|---|
getMandatorySystemGestureInsets |
setPrivacyIndicatorBounds
fun setPrivacyIndicatorBounds(bounds: Rect?): WindowInsetsCompat.Builder
Sets the bounds of the system privacy indicator.
| Parameters | |
|---|---|
bounds: Rect? |
The bounds of the system privacy indicator, or null if they don't exist or the bounds have been consumed. |
setRoundedCorner
fun setRoundedCorner(position: Int, roundedCorner: RoundedCornerCompat?): WindowInsetsCompat.Builder
Sets the rounded corner of given position.
| Parameters | |
|---|---|
position: Int |
the position of this rounded corner |
roundedCorner: RoundedCornerCompat? |
the rounded corner or null if there is none |
| Returns | |
|---|---|
WindowInsetsCompat.Builder |
itself |
| See also | |
|---|---|
getRoundedCorner |
funsetStableInsets(insets: Insets): WindowInsetsCompat.Builder
Sets the stable insets 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.
The insets passed will only take effect when running on API 29 and above.
| Returns | |
|---|---|
WindowInsetsCompat.Builder |
itself |
| See also | |
|---|---|
getStableInsets |
funsetSystemGestureInsets(insets: Insets): WindowInsetsCompat.Builder
Sets system gesture insets in pixels.
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.
The insets passed will only take effect when running on API 29 and above.
| Returns | |
|---|---|
WindowInsetsCompat.Builder |
itself |
| See also | |
|---|---|
getSystemGestureInsets |
funsetSystemWindowInsets(insets: Insets): WindowInsetsCompat.Builder
Sets system window insets in pixels.
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.
| Returns | |
|---|---|
WindowInsetsCompat.Builder |
itself |
| See also | |
|---|---|
getSystemWindowInsets |
funsetTappableElementInsets(insets: Insets): WindowInsetsCompat.Builder
Sets tappable element insets in pixels.
The tappable element insets represent how much tappable elements must at least be 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.
| Returns | |
|---|---|
WindowInsetsCompat.Builder |
itself |
| See also | |
|---|---|
getTappableElementInsets |
setVisible
fun setVisible(typeMask: Int, visible: Boolean): WindowInsetsCompat.Builder
Sets whether windows that can cause insets are currently visible on screen.
| Parameters | |
|---|---|
typeMask: Int |
The bitmask of |
visible: Boolean |
Whether to mark the windows as visible or not. |
| Returns | |
|---|---|
WindowInsetsCompat.Builder |
itself |
| See also | |
|---|---|
isVisible |