TrustedWebActivityDisplayMode.ImmersiveMode


class TrustedWebActivityDisplayMode.ImmersiveMode : TrustedWebActivityDisplayMode


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

const String!
KEY_CUTOUT_MODE = "androidx.browser.trusted.displaymode.KEY_CUTOUT_MODE"

Bundle key for layoutInDisplayCutoutMode.

const String!
KEY_STICKY = "androidx.browser.trusted.displaymode.KEY_STICKY"

Bundle key for isSticky.

Public constructors

ImmersiveMode(isSticky: Boolean, layoutInDisplayCutoutMode: Int)

Constructor.

Public functions

Boolean

Returns whether sticky immersive mode is enabled.

Int

Returns the cutout mode.

Bundle

Packs the object into a Bundle.

Inherited Constants

From androidx.browser.trusted.TrustedWebActivityDisplayMode
const String!
KEY_ID = "androidx.browser.trusted.displaymode.KEY_ID"

Bundle key for the integer identifying the mode.

Constants

KEY_CUTOUT_MODE

Added in 1.2.0
const val KEY_CUTOUT_MODE = "androidx.browser.trusted.displaymode.KEY_CUTOUT_MODE": String!

Bundle key for layoutInDisplayCutoutMode.

KEY_STICKY

Added in 1.2.0
const val KEY_STICKY = "androidx.browser.trusted.displaymode.KEY_STICKY": String!

Bundle key for isSticky.

Public constructors

ImmersiveMode

Added in 1.2.0
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: Int

The constant defining how to deal with display cutouts. See layoutInDisplayCutoutMode and https://developer.android.com/guide/topics/display-cutout

Public functions

isSticky

Added in 1.2.0
fun isSticky(): Boolean

Returns whether sticky immersive mode is enabled.

layoutInDisplayCutoutMode

Added in 1.2.0
fun layoutInDisplayCutoutMode(): Int

Returns the cutout mode.

toBundle

Added in 1.8.0
fun toBundle(): Bundle

Packs the object into a Bundle.