Posture
-
Cmn
class Posture
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 |
|
|---|---|
|
create an instance of |
Cmn
|
Public properties |
||
|---|---|---|
List<HingeInfo> |
a list of all hinges that are relevant to the posture. |
Cmn
|
Boolean |
|
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 properties
isTabletop
val isTabletop: 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. 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.allHorizontalHingeBounds: List<Rect>
Returns the list of all horizontal hinge bounds.
allVerticalHingeBounds
val Posture.allVerticalHingeBounds: List<Rect>
Returns the list of all vertical hinge bounds.
occludingHorizontalHingeBounds
val Posture.occludingHorizontalHingeBounds: List<Rect>
Returns the list of horizontal hinge bounds that are occluding.
occludingVerticalHingeBounds
val Posture.occludingVerticalHingeBounds: List<Rect>
Returns the list of vertical hinge bounds that are occluding.
separatingHorizontalHingeBounds
val Posture.separatingHorizontalHingeBounds: List<Rect>
Returns the list of horizontal hinge bounds that are separating.
separatingVerticalHingeBounds
val Posture.separatingVerticalHingeBounds: List<Rect>
Returns the list of vertical hinge bounds that are separating.