Package-level declarations

Types

Link copied to clipboard

Definition of the window size to be on the global scope.

Link copied to clipboard
sealed class Posture(val size: Size)

Represent the posture of the foldable device.

Link copied to clipboard

Defines the current orientation of the window.

Link copied to clipboard
data class WindowSize(val width: WindowType, val height: WindowType)

Window size are a set of opinionated viewport breakpoints to design, develop, and test responsive application layouts against. For more details check Support different screen sizes documentation.

Link copied to clipboard
sealed class WindowType(val dpSize: Int)

Breakpoints defines the screen type at which a layout will adapt to best fit content and conform to responsive layout requirements. A breakpoint range informs how a screen adjusts to fit its size and orientation.

Properties

Link copied to clipboard

Returns a dp size of the hinge according to the window orientation from a FoldingFeature.

Link copied to clipboard

Returns a dp size of the hinge from a FoldingFeature.

Link copied to clipboard

Returns a height dp size of the hinge from a FoldingFeature.

Link copied to clipboard

Returns a width Dp size of the hinge from a FoldingFeature.

Link copied to clipboard

Returns a width pixel size of the hinge from a FoldingFeature.

Link copied to clipboard

Returns a pixel size of the hinge from a FoldingFeature.

Link copied to clipboard

Returns a height dp size of the hinge from a FoldingFeature.

Link copied to clipboard

Returns a width Dp size of the hinge from a FoldingFeature.

Link copied to clipboard

Returns a width pixel size of the hinge from a FoldingFeature.

Link copied to clipboard

Returns whether a FoldingFeature is the book mode.

Link copied to clipboard
val FoldingFeature.isFlat: Boolean

Returns whether the state of a FoldingFeature is flat.

Link copied to clipboard

Returns whether the state of a FoldingFeature is half-opened.

Link copied to clipboard

Returns whether the orientation of a FoldingFeature is horizontal.

Link copied to clipboard

Is landscape mode enabled.

Link copied to clipboard

Calculates if a FoldingFeature should be thought of as splitting the window into multiple physical areas that can be seen by users as logically separate. Display panels connected by a hinge are always separated. Folds on flexible screens should be treated as separating when they are not FoldingFeature.State.FLAT.

Link copied to clipboard

Returns whether a FoldingFeature is the table-top mode.

Link copied to clipboard

Returns whether the orientation of a FoldingFeature is vertical.

Link copied to clipboard

Calculates the occlusion mode to determine if a FoldingFeature occludes a part of the window. This flag is useful for determining if UI elements need to be moved around so that the user can access them. For some devices occluded elements can not be accessed by the user at all.

Link copied to clipboard
Link copied to clipboard

Returns a Flow of the Posture by tracking the WindowLayoutInfo.

Link copied to clipboard

Returns a State of the Posture by tracking the WindowLayoutInfo.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Returns WindowOrientation according to the current window orientation.

Functions

Link copied to clipboard

Returns a Flow of the Posture by tracking the WindowLayoutInfo.

Link copied to clipboard

Remembers the WindowSize class for the window corresponding to the current window metrics.

Link copied to clipboard

Returns a Posture which represent the current posture of the foldable device.

Link copied to clipboard

Returns a Size spec from a FoldingFeature.