OrientationUtil
object OrientationUtil
Utility class for querying the device's orientation.
Functions
Link copied to clipboard
Calculates how far from the natural orientation the device currently is in degrees.
Link copied to clipboard
Calculates the current orientation of the device as either landscape or portrait.
Link copied to clipboard
Calculates the 'natural' orientation of the device, often Configuration.ORIENTATION_PORTRAIT for phones and Configuration.ORIENTATION_LANDSCAPE for tablets. NOTE: This value is fixed for the device, unlike its current orientation which changes depending on how the device is held.
Link copied to clipboard
Calculates the Surface.X in 0, 90, 180, 270 degrees off the 'natural' device orientation.
Link copied to clipboard