public static enum Screen.ScreenRotation extends Enum<Screen.ScreenRotation>
Note: there is difference between tablet default rotation and phone default rotation.
resolve(int)| Enum Constant and Description |
|---|
ROTATION_0
|
ROTATION_180
Rotation indicating screen rotation by 180 degrees:
phone:
REVERSE_PORTRAIT orientation
tablet: REVERSE_LANDSCAPE orientation
System constant: Surface.ROTATION_180 |
ROTATION_270
Rotation indicating screen rotation by 270 degrees:
phone:
REVERSE_LANDSCAPE orientation
tablet: PORTRAIT orientation
System constant: Surface.ROTATION_270 |
ROTATION_90
Rotation indicating screen rotation by 90 degrees:
phone:
LANDSCAPE orientation
tablet: REVERSE_PORTRAIT orientation
System constant: Surface.ROTATION_90 |
UNKNOWN
Indicates that the screen rotation is unknown due to some error or the current screen data
are unavailable.
|
| Modifier and Type | Field and Description |
|---|---|
int |
degrees
The value of degrees specific for this screen rotation.
|
int |
systemConstant
The flag provided by
Surface for this screen rotation. |
| Modifier and Type | Method and Description |
|---|---|
static Screen.ScreenRotation |
resolve(int systemConstant)
Resolves an instance of ScreenRotation according to the given systemConstant from
the current set of ScreenRotation values.
|
static Screen.ScreenRotation |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Screen.ScreenRotation[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Screen.ScreenRotation UNKNOWN
public static final Screen.ScreenRotation ROTATION_0
public static final Screen.ScreenRotation ROTATION_90
LANDSCAPE orientationREVERSE_PORTRAIT orientationSurface.ROTATION_90public static final Screen.ScreenRotation ROTATION_180
REVERSE_PORTRAIT orientationREVERSE_LANDSCAPE orientationSurface.ROTATION_180public static final Screen.ScreenRotation ROTATION_270
REVERSE_LANDSCAPE orientationPORTRAIT orientationSurface.ROTATION_270public final int degrees
public final int systemConstant
Surface for this screen rotation.public static Screen.ScreenRotation[] values()
for (Screen.ScreenRotation c : Screen.ScreenRotation.values()) System.out.println(c);
public static Screen.ScreenRotation valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static Screen.ScreenRotation resolve(int systemConstant)
systemConstant - The id (systemConstant) of the desired screen rotation to
resolve.UNKNOWN if there is
no screen rotation with the requested constant.