androidx.compose.material3.adaptive


Classes

HingeInfo

A class that contains the info of a hinge relevant to a Posture.

Cmn
Posture

Posture info that can help make layout adaptation decisions.

Cmn
WindowAdaptiveInfo

This class collects window info that affects adaptation decisions.

Cmn

Annotations

Top-level functions summary

Posture

Calculates the Posture for a given list of FoldingFeatures.

android
State<List<FoldingFeature>>

Collects the current window folding features from WindowInfoTracker in to a State.

android
WindowAdaptiveInfo

Calculates and returns WindowAdaptiveInfo of the provided context.

Cmn
android
IntSize

Returns and automatically update the current window size from WindowMetricsCalculator.

android

Extension properties summary

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

Top-level functions

calculatePosture

@ExperimentalMaterial3AdaptiveApi
fun calculatePosture(foldingFeatures: List<FoldingFeature>): Posture

Calculates the Posture for a given list of FoldingFeatures. This methods converts framework folding info into the Material-opinionated posture info.

collectFoldingFeaturesAsState

@ExperimentalMaterial3AdaptiveApi
@Composable
fun collectFoldingFeaturesAsState(): State<List<FoldingFeature>>

Collects the current window folding features from WindowInfoTracker in to a State.

Returns
State<List<FoldingFeature>>

a State of a FoldingFeature list.

currentWindowAdaptiveInfo

@ExperimentalMaterial3AdaptiveApi
@Composable
fun currentWindowAdaptiveInfo(): WindowAdaptiveInfo

Calculates and returns WindowAdaptiveInfo of the provided context. It's a convenient function that uses the default WindowSizeClass constructor and the default Posture calculation functions to retrieve WindowSizeClass and Posture.

Returns
WindowAdaptiveInfo

WindowAdaptiveInfo of the provided context

currentWindowSize

@ExperimentalMaterial3AdaptiveApi
@Composable
fun currentWindowSize(): IntSize

Returns and automatically update the current window size from WindowMetricsCalculator.

Returns
IntSize

an IntSize that represents the current window size.

Extension properties

allHorizontalHingeBounds

@ExperimentalMaterial3AdaptiveApi
val Posture.allHorizontalHingeBoundsList<Rect>

Returns the list of all horizontal hinge bounds.

allVerticalHingeBounds

@ExperimentalMaterial3AdaptiveApi
val Posture.allVerticalHingeBoundsList<Rect>

Returns the list of all vertical hinge bounds.

occludingHorizontalHingeBounds

@ExperimentalMaterial3AdaptiveApi
val Posture.occludingHorizontalHingeBoundsList<Rect>

Returns the list of horizontal hinge bounds that are occluding.

occludingVerticalHingeBounds

@ExperimentalMaterial3AdaptiveApi
val Posture.occludingVerticalHingeBoundsList<Rect>

Returns the list of vertical hinge bounds that are occluding.

separatingHorizontalHingeBounds

@ExperimentalMaterial3AdaptiveApi
val Posture.separatingHorizontalHingeBoundsList<Rect>

Returns the list of horizontal hinge bounds that are separating.

separatingVerticalHingeBounds

@ExperimentalMaterial3AdaptiveApi
val Posture.separatingVerticalHingeBoundsList<Rect>

Returns the list of vertical hinge bounds that are separating.