HalfOpened

sealed interface HalfOpened : ScreenClassifier

Indicates that the device has a foldable screen, and that it is folded into one of several possible postures:

  • Book mode

  • Tabletop mode

Inheritors

Types

Link copied to clipboard
data class BookMode(val hingePosition: Rect, val hingeSeparationRatio: Float, val isSeparating: Boolean, val occlusionType: FoldingFeature.OcclusionType) : ScreenClassifier.HalfOpened

Indicates the device is in book mode, where the hinge runs from top to bottom and the device is in a folded position, like the natural use of a book.

Link copied to clipboard
data class TableTopMode(val hingePosition: Rect, val hingeSeparationRatio: Float, val isSeparating: Boolean, val occlusionType: FoldingFeature.OcclusionType) : ScreenClassifier.HalfOpened

Indicates the device is in tabletop mode, where the hinge runs from left to right and device is in a folded position, much like how a laptop would sit on a table.

Properties

Link copied to clipboard
abstract val hingePosition: Rect

Indicates the DP position through which the hinge cuts through the physical screen, whether it is horizontal a vertical.

Link copied to clipboard

Number between 0 and 1 indicating where the hinge lives. Often is 0.5 for most foldable devices with apps in full-screen mode, since most hinges run down the center of the screen. Apps in floating window mode will see this value change as the app is dragged around, moving its position relative to the device's hinge. Does not indicate the up/down or left/right direction of the hinge. See hingePosition for information on that.

Link copied to clipboard
abstract val isSeparating: Boolean

Indicates whether the hinge is visually diving the screen (like Microsoft Surface Duo) or seamless (like Samsung Galaxy Z Fold + Z Flip).

Link copied to clipboard

Indicates if the screen is or is not obscured in any way by the hinge.