Posture info that can help make layout adaptation decisions. For example when Posture.separatingVerticalHingeBounds is not empty, the layout may want to avoid putting any content over those hinge area. We suggest to use calculatePosture to retrieve instances of this class in applications, unless you have a strong need of customization that cannot be fulfilled by the default implementation.

Note that the hinge bounds will be represent as Rect with window coordinates, instead of layout coordinate.

Summary

Public constructors

Posture(isTabletop: Boolean, hingeList: List<HingeInfo>)

create an instance of Posture

Cmn

Public functions

open operator Boolean
equals(other: Any?)
Cmn
open Int
Cmn
open String
Cmn

Public properties

List<HingeInfo>

a list of all hinges that are relevant to the posture.

Cmn
Boolean

true if the current window is considered as in the table top mode, i.e. there is one half-opened horizontal hinge in the middle of the current window.

Cmn

Extension properties

List<Rect>

Returns the list of all horizontal hinge bounds.

Cmn
List<Rect>

Returns the list of all vertical hinge bounds.

Cmn
List<Rect>

Returns the list of horizontal hinge bounds that are occluding.

Cmn
List<Rect>

Returns the list of vertical hinge bounds that are occluding.

Cmn
List<Rect>

Returns the list of horizontal hinge bounds that are separating.

Cmn
List<Rect>

Returns the list of vertical hinge bounds that are separating.

Cmn

Public constructors

Posture

Posture(isTabletop: Boolean = false, hingeList: List<HingeInfo> = emptyList())

create an instance of Posture

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

hingeList

val hingeListList<HingeInfo>

a list of all hinges that are relevant to the posture.

isTabletop

val isTabletopBoolean

true if the current window is considered as in the table top mode, i.e. there is one half-opened horizontal hinge in the middle of the current window. When this is true it usually means it's hard for users to interact with the window area around the hinge and developers may consider separating the layout along the hinge and show software keyboard or other controls in the bottom half of the window.

Extension properties

allHorizontalHingeBounds

val Posture.allHorizontalHingeBoundsList<Rect>

Returns the list of all horizontal hinge bounds.

allVerticalHingeBounds

val Posture.allVerticalHingeBoundsList<Rect>

Returns the list of all vertical hinge bounds.

occludingHorizontalHingeBounds

val Posture.occludingHorizontalHingeBoundsList<Rect>

Returns the list of horizontal hinge bounds that are occluding.

occludingVerticalHingeBounds

val Posture.occludingVerticalHingeBoundsList<Rect>

Returns the list of vertical hinge bounds that are occluding.

separatingHorizontalHingeBounds

val Posture.separatingHorizontalHingeBoundsList<Rect>

Returns the list of horizontal hinge bounds that are separating.

separatingVerticalHingeBounds

val Posture.separatingVerticalHingeBoundsList<Rect>

Returns the list of vertical hinge bounds that are separating.