TrustedWebActivityDisplayMode.ImmersiveMode

public class TrustedWebActivityDisplayMode.ImmersiveMode implements 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

static final String
KEY_CUTOUT_MODE = "androidx.browser.trusted.displaymode.KEY_CUTOUT_MODE"

Bundle key for layoutInDisplayCutoutMode.

static final String
KEY_STICKY = "androidx.browser.trusted.displaymode.KEY_STICKY"

Bundle key for isSticky.

Public constructors

ImmersiveMode(boolean isSticky, int layoutInDisplayCutoutMode)

Constructor.

Public methods

boolean

Returns whether sticky immersive mode is enabled.

int

Returns the cutout mode.

@NonNull Bundle

Packs the object into a Bundle.

Inherited Constants

From androidx.browser.trusted.TrustedWebActivityDisplayMode
static final 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
public static final String KEY_CUTOUT_MODE = "androidx.browser.trusted.displaymode.KEY_CUTOUT_MODE"

Bundle key for layoutInDisplayCutoutMode.

KEY_STICKY

Added in 1.2.0
public static final String KEY_STICKY = "androidx.browser.trusted.displaymode.KEY_STICKY"

Bundle key for isSticky.

Public constructors

ImmersiveMode

Added in 1.2.0
public ImmersiveMode(boolean isSticky, int layoutInDisplayCutoutMode)

Constructor.

Parameters
boolean isSticky

Whether the Trusted Web Activity should be in sticky immersive mode, see https://developer.android.com/training/system-ui/immersive#sticky-immersive

int layoutInDisplayCutoutMode

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

Public methods

isSticky

Added in 1.2.0
public boolean isSticky()

Returns whether sticky immersive mode is enabled.

layoutInDisplayCutoutMode

Added in 1.2.0
public int layoutInDisplayCutoutMode()

Returns the cutout mode.

toBundle

Added in 1.8.0
public @NonNull Bundle toBundle()

Packs the object into a Bundle.