ScreenOrientation

public final class ScreenOrientation


Represents screenOrientationLock type value of a Trusted Web Activity: https://www.w3.org/TR/screen-orientation/#screenorientation-interface

Summary

Constants

static final int
ANY = 5

Any is an orientation that means the screen can be locked to any one of portrait-primary, portrait-secondary, landscape-primary and landscape-secondary.

static final int

The default screen orientation is the set of orientations to which the screen is locked when there is no current orientation lock.

static final int

Landscape is an orientation where the screen width is greater than the screen height and depending on platform convention locking the screen to landscape can represent landscape-primary, landscape-secondary or both.

static final int

Landscape-primary is an orientation where the screen width is greater than the screen height.

static final int

Landscape-secondary is an orientation where the screen width is greater than the screen height.

static final int

Natural is an orientation that refers to either portrait-primary or landscape-primary depending on the device's usual orientation.

static final int

Portrait is an orientation where the screen width is less than or equal to the screen height and depending on platform convention locking the screen to portrait can represent portrait-primary, portrait-secondary or both.

static final int

Portrait-primary is an orientation where the screen width is less than or equal to the screen height.

static final int

Portrait-secondary is an orientation where the screen width is less than or equal to the screen height.

Constants

ANY

Added in 1.3.0
public static final int ANY = 5

Any is an orientation that means the screen can be locked to any one of portrait-primary, portrait-secondary, landscape-primary and landscape-secondary.

DEFAULT

Added in 1.3.0
public static final int DEFAULT = 0

The default screen orientation is the set of orientations to which the screen is locked when there is no current orientation lock.

LANDSCAPE

Added in 1.3.0
public static final int LANDSCAPE = 6

Landscape is an orientation where the screen width is greater than the screen height and depending on platform convention locking the screen to landscape can represent landscape-primary, landscape-secondary or both.

LANDSCAPE_PRIMARY

Added in 1.3.0
public static final int LANDSCAPE_PRIMARY = 3

Landscape-primary is an orientation where the screen width is greater than the screen height. If the device's natural orientation is landscape, then it is in landscape-primary when held in that position.

LANDSCAPE_SECONDARY

Added in 1.3.0
public static final int LANDSCAPE_SECONDARY = 4

Landscape-secondary is an orientation where the screen width is greater than the screen height. If the device's natural orientation is landscape, it is in landscape-secondary when rotated 180° from its natural orientation.

NATURAL

Added in 1.3.0
public static final int NATURAL = 8

Natural is an orientation that refers to either portrait-primary or landscape-primary depending on the device's usual orientation. This orientation is usually provided by the underlying operating system.

PORTRAIT

Added in 1.3.0
public static final int PORTRAIT = 7

Portrait is an orientation where the screen width is less than or equal to the screen height and depending on platform convention locking the screen to portrait can represent portrait-primary, portrait-secondary or both.

PORTRAIT_PRIMARY

Added in 1.3.0
public static final int PORTRAIT_PRIMARY = 1

Portrait-primary is an orientation where the screen width is less than or equal to the screen height. If the device's natural orientation is portrait, then it is in portrait-primary when held in that position.

PORTRAIT_SECONDARY

Added in 1.3.0
public static final int PORTRAIT_SECONDARY = 2

Portrait-secondary is an orientation where the screen width is less than or equal to the screen height. If the device's natural orientation is portrait, then it is in portrait-secondary when rotated 180° from its natural position.