Language

WindowInsets Class

Definition

Describes a set of insets for window content.

[Android.Runtime.Register("android/view/WindowInsets", DoNotGenerateAcw=true)]
public sealed class WindowInsets : Java.Lang.Object
[<Android.Runtime.Register("android/view/WindowInsets", DoNotGenerateAcw=true)>]
type WindowInsets = class
    inherit Object
Inheritance
WindowInsets
Attributes

Remarks

Describes a set of insets for window content.

WindowInsets 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 WindowInsets instance with the adjusted properties.

Note: Before android.os.Build.VERSION_CODES#P P, WindowInsets instances were only immutable during a single layout pass (i.e. would return the same values between View#onApplyWindowInsets and View#onLayout, but could return other values otherwise). Starting with android.os.Build.VERSION_CODES#P P, WindowInsets are always immutable and implement equality.

Java documentation for android.view.WindowInsets.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

Name Description
WindowInsets(WindowInsets)

Construct a new WindowInsets, copying all values from a source WindowInsets.

Properties

Name Description
Class

Returns the runtime class of this Object.

(Inherited from Object)
Consumed

A WindowInsets instance for which #isConsumed() returns true.

DisplayCutout

Returns the display cutout if there is one.

DisplayShape

Returns the display shape in the coordinate space of the window.

Frame

Returns the assumed size of the window, relative to which the #getInsets and #getBoundingRects have been calculated.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
HasInsets

Returns true if this WindowInsets has any nonzero insets.

HasStableInsets

Returns true if this WindowInsets has nonzero stable insets.

HasSystemWindowInsets

Returns true if this WindowInsets has nonzero system window insets.

IsConsumed

Check if these insets have been fully consumed.

IsRound

Returns true if the associated window has a round shape.

JniIdentityHashCode

Gets the identity hash code assigned to this Java peer by the interop runtime.

(Inherited from Object)
JniManagedPeerState (Inherited from JavaObject)
JniPeerMembers

Gets the JNI peer metadata used by the .NET for Android binding runtime.

MandatorySystemGestureInsets

This method was deprecated in API level 30. Use getInsets(int) with Type.mandatorySystemGestures() instead.

PeerReference

Gets the JNI object reference for this Java peer.

(Inherited from Object)
PrivacyIndicatorBounds

Returns the Rect of the maximum bounds of the system privacy indicator, for the current orientation, in relative coordinates, or null if the bounds have not been loaded yet.

StableInsetBottom

Returns the bottom stable inset in pixels.

StableInsetLeft

Returns the left stable inset in pixels.

StableInsetRight

Returns the right stable inset in pixels.

StableInsets

Returns the stable insets in pixels.

StableInsetTop

Returns the top stable inset in pixels.

SystemGestureInsets

This method was deprecated in API level 30. Use getInsets(int) with Type.systemGestures() instead.

SystemWindowInsetBottom

Returns the bottom system window inset in pixels.

SystemWindowInsetLeft

Returns the left system window inset in pixels.

SystemWindowInsetRight

Returns the right system window inset in pixels.

SystemWindowInsets

Returns the system window insets in pixels.

SystemWindowInsetTop

Returns the top system window inset in pixels.

TappableElementInsets

This method was deprecated in API level 30. Use getInsets(int) with Type.tappableElement() instead.

ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)
ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

(Inherited from Object)

Methods

Name Description
Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Construct(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
ConsumeDisplayCutout()

Returns a copy of this WindowInsets with the cutout fully consumed.

ConsumeStableInsets()

Returns a copy of this WindowInsets with the stable insets fully consumed.

ConsumeSystemWindowInsets()

Returns a copy of this WindowInsets with the system window insets fully consumed.

Dispose()

Releases the resources held by this Java peer.

(Inherited from Object)
Dispose(Boolean)

Releases the resources held by this Java peer.

(Inherited from Object)
DisposeUnlessReferenced() (Inherited from JavaObject)
Equals(Object) (Inherited from JavaObject)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetBoundingRects(Int32)

Returns a list of Rects, each of which is the bounding rectangle for an area that is being partially or fully obscured inside the window.

GetBoundingRectsIgnoringVisibility(Int32)

Returns a list of Rects, each of which is the bounding rectangle for an area that can be partially or fully obscured inside the window, regardless of whether that type is currently visible or not.

GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
GetInsets(Int32)

Returns the insets of a specific set of windows causing insets, denoted by the typeMask bit mask of Types.

GetInsetsIgnoringVisibility(Int32)

Returns the insets a specific set of windows can cause, denoted by the typeMask bit mask of Types, regardless of whether that type is currently visible or not.

GetRoundedCorner(Int32)

Returns the RoundedCorner of the given position if there is one.

Inset(Insets)

Returns a copy of this instance inset in the given directions.

Inset(Int32, Int32, Int32, Int32)

Returns a copy of this instance inset in the given directions.

IsVisible(Int32)

Returns whether a set of windows that may cause insets is currently visible on screen, regardless of whether it actually overlaps with this window.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
ReplaceSystemWindowInsets(Int32, Int32, Int32, Int32)

Returns a copy of this WindowInsets with selected system window insets replaced with new values.

ReplaceSystemWindowInsets(Rect)

Returns a copy of this WindowInsets with selected system window insets replaced with new values.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetPeerReference(JniObjectReference, JniObjectReferenceOptions) (Inherited from JavaObject)
ToArray<T>()

Creates a managed array from this Java array wrapper.

(Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime()

Unregisters this Java peer from the interop runtime.

(Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

Name Description
IJavaPeerable.Disposed() (Inherited from JavaObject)
IJavaPeerable.Finalized() (Inherited from JavaObject)
IJavaPeerable.JniObjectReferenceControlBlock (Inherited from JavaObject)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from JavaObject)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from JavaObject)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from JavaObject)

Extension Methods

Name Description
GetJniTypeName(IJavaPeerable)

Gets the JNI name of the type of the instance self.

JavaAs<TResult>(IJavaPeerable)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
TryJavaCast<TResult>(IJavaPeerable, TResult)

Try to coerce self to type TResult, checking that the coercion is valid on the Java side.

Applies to