ScreenOrientation

The ScreenOrientation interface of the Screen Orientation API provides information about the current orientation of the document.

MDN Reference

Properties

Link copied to clipboard

The angle read-only property of the ScreenOrientation interface returns the document's current orientation angle.

Link copied to clipboard

The type read-only property of the ScreenOrientation interface returns the document's current orientation type, one of portrait-primary, portrait-secondary, landscape-primary, or landscape-secondary.

Functions

Link copied to clipboard
Link copied to clipboard
inline suspend fun ScreenOrientation.lock(orientation: OrientationLockType)

The lock() method of the ScreenOrientation interface locks the orientation of the containing document to the specified orientation.

Link copied to clipboard

The lock() method of the ScreenOrientation interface locks the orientation of the containing document to the specified orientation.

Link copied to clipboard
fun unlock()

The unlock() method of the ScreenOrientation interface unlocks the orientation of the containing document, effectively locking it to the default screen orientation.

Link copied to clipboard