FoldingFeature

interface FoldingFeature extends DisplayFeature


A feature that describes a fold in the flexible display or a hinge between two physical display panels.

Summary

Nested types

FoldingFeature.OcclusionType

Represents how the hinge might occlude content.

FoldingFeature.OcclusionType.Companion
FoldingFeature.Orientation

Represents the axis for which the FoldingFeature runs parallel to.

FoldingFeature.Orientation.Companion
FoldingFeature.State

Represents the State of the FoldingFeature.

FoldingFeature.State.Companion

Public fields

abstract boolean

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.

abstract @NonNull FoldingFeature.OcclusionType

Calculates the occlusion mode to determine if a FoldingFeature occludes a part of the window.

abstract @NonNull FoldingFeature.Orientation

Returns FoldingFeature.Orientation.HORIZONTAL if the width is greater than the height, FoldingFeature.Orientation.VERTICAL otherwise.

abstract @NonNull FoldingFeature.State

Returns the FoldingFeature.State for the FoldingFeature

Public fields

isSeparating

abstract boolean isSeparating

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.

Apps may use this to determine if content should lay out around the FoldingFeature. Developers should consider the placement of interactive elements. Similar to the case of FoldingFeature.OcclusionType.FULL, when a feature is separating then consider laying out the controls around the FoldingFeature.

An example use case is to determine if the UI should be split into two logical areas. A media app where there is some auxiliary content, such as comments or description of a video, may need to adapt the layout. The media can be put on one side of the FoldingFeature and the auxiliary content can be placed on the other side.

Returns
boolean

true if the feature splits the display into two areas, false otherwise.