ImmersiveMode

open class ImmersiveMode : TrustedWebActivityDisplayMode
kotlin.Any
   ↳ androidx.browser.trusted.TrustedWebActivityDisplayMode.ImmersiveMode

Immersive mode: both the browser controls and the system UI (status bar, navigation bar) is hidden while the user is on a verified origin. See https://developer.android.com/training/system-ui/immersive Using this mode is different from using the JavaScript Fullscreen API in that the immersive mode will be entered immediately, before the page has loaded. If the app uses a splash screen, it will be displayed in immersive mode. It is not recommended to use both this API and the JavaScript API simultaneously.

Summary

Constants

static String

Bundle key for layoutInDisplayCutoutMode.

static String

Bundle key for isSticky.

Inherited constants

Public constructors

<init>(isSticky: Boolean, layoutInDisplayCutoutMode: Int)

Constructor.

Public methods

open Boolean

Returns whether sticky immersive mode is enabled.

open Int

Returns the cutout mode.

open Bundle

Constants

KEY_CUTOUT_MODE

static val KEY_CUTOUT_MODE: String

Bundle key for layoutInDisplayCutoutMode.

Value: "androidx.browser.trusted.displaymode.KEY_CUTOUT_MODE"

KEY_STICKY

static val KEY_STICKY: String

Bundle key for isSticky.

Value: "androidx.browser.trusted.displaymode.KEY_STICKY"

Public constructors

<init>

ImmersiveMode(isSticky: Boolean, layoutInDisplayCutoutMode: Int)

Constructor.

Parameters
isSticky Boolean: Whether the Trusted Web Activity should be in sticky immersive mode, see https://developer.android.com/training/system-ui/immersive#sticky-immersive
layoutInDisplayCutoutMode Boolean: The constant defining how to deal with display cutouts. See android.view.WindowManager.LayoutParams#layoutInDisplayCutoutMode and https://developer.android.com/guide/topics/display-cutout

Public methods

isSticky

open fun isSticky(): Boolean

Returns whether sticky immersive mode is enabled.

layoutInDisplayCutoutMode

open fun layoutInDisplayCutoutMode(): Int

Returns the cutout mode.

toBundle

@NonNull open fun toBundle(): Bundle