from

Create a WindowInsetsWrapper from an existing windowInsets.

Compatibility Guidelines:

If your app needs to be compatible with the notch screen that may appear on devices below Android 9, you need to set the window parameter, this parameter usually comes from Activity.getWindow, otherwise it can be null.

If your app is targeting Android 10 and below, we recommend to set the window parameter at all times.

Return

WindowInsetsWrapper

Parameters

windowInsets

the window insets.

window

the window, default is null.

See also


fun from(view: View, window: Window? = null): <Error class: unknown class>

Create a WindowInsetsWrapper from view or Window.getDecorView.

Compatibility Guidelines:

If your app needs to be compatible with the notch screen that may appear on devices below Android 9, you need to set the window parameter, this parameter usually comes from Activity.getWindow, otherwise it can be null.

If your app is targeting Android 10 and below, we recommend to set the window parameter at all times.

Return

WindowInsetsWrapper or null.

Parameters

view

the view.

window

the window, default is null.