pub enum ScreenOrientation {
Show 16 variants
Unspecified,
Behind,
Landscape,
Portrait,
ReverseLandscape,
ReversePortrait,
SensorLandscape,
SensorPortrait,
UserLandscape,
UserPortrait,
Sensor,
FullSensor,
Nosensor,
User,
FullUser,
Locked,
}
Expand description
The orientation of the activity’s display on the device.
Variants§
Unspecified
The default value
. The system chooses the orientation. The policy it uses, and
therefore the choices made in specific contexts, may differ from device to
device.
Behind
The same orientation as the activity that’s immediately beneath it in the activity stack.
Landscape
Landscape orientation (the display is wider than it is tall).
Portrait
Portrait orientation (the display is taller than it is wide).
ReverseLandscape
Landscape orientation in the opposite direction from normal landscape.
Added in API level 9.
ReversePortrait
Portrait orientation in the opposite direction from normal portrait.
Added in API level 9.
SensorLandscape
Landscape orientation, but can be either normal or reverse landscape based on the device sensor. The sensor is used even if the user has locked sensor-based rotation.
Added in API level 9.
SensorPortrait
Portrait orientation, but can be either normal or reverse portrait based on the device sensor. The sensor is used even if the user has locked sensor-based rotation.
Added in API level 9.
UserLandscape
Landscape orientation, but can be either normal or reverse landscape based on the device sensor and the user’s preference.
Added in API level 18.
UserPortrait
Portrait orientation, but can be either normal or reverse portrait based on the device sensor and the user’s preference.
Added in API level 18.
Sensor
The orientation is determined by the device orientation sensor. The orientation of
the display depends on how the user is holding the device; it changes when the
user rotates the device. Some devices, though, will not rotate to all four
possible orientations, by default. To allow all four orientations, use
“fullSensor
” The sensor is used even if the user locked sensor-based rotation.
FullSensor
The orientation is determined by the device orientation sensor for any of the 4
orientations. This is similar to “sensor
” except this allows any of the 4
possible screen orientations, regardless of what the device will normally do
(for example, some devices won’t normally use reverse portrait or reverse
landscape, but this enables those).
Added in API level 9.
Nosensor
The orientation is determined without reference to a physical orientation sensor. The sensor is ignored, so the display will not rotate based on how the user moves the device.
User
The user’s current preferred orientation.
FullUser
If the user has locked sensor-based rotation, this behaves the same as user,
otherwise it behaves the same as fullSensor
and allows any of the 4 possible
screen orientations.
Added in API level 18.
Locked
Locks the orientation to its current rotation, whatever that is.
Added in API level 18.
Trait Implementations§
source§impl Clone for ScreenOrientation
impl Clone for ScreenOrientation
source§fn clone(&self) -> ScreenOrientation
fn clone(&self) -> ScreenOrientation
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ScreenOrientation
impl Debug for ScreenOrientation
source§impl Default for ScreenOrientation
impl Default for ScreenOrientation
source§fn default() -> ScreenOrientation
fn default() -> ScreenOrientation
source§impl<'de> Deserialize<'de> for ScreenOrientation
impl<'de> Deserialize<'de> for ScreenOrientation
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<ScreenOrientation> for ScreenOrientation
impl PartialEq<ScreenOrientation> for ScreenOrientation
source§fn eq(&self, other: &ScreenOrientation) -> bool
fn eq(&self, other: &ScreenOrientation) -> bool
self
and other
values to be equal, and is used
by ==
.