androidx.compose.material3.adaptive.layout
calculateThreePaneScaffoldValueExperimental
Function · from org.jetbrains.compose.material3.adaptive:adaptive-layout:1.3.0
No hand-written docs yet.
Calculates the current adapted value of ThreePaneScaffold according to the given maxHorizontalPartitions, adaptStrategies and currentDestination. The returned value can be used as a unique representation of the current layout structure.
With currentDestinationExperimental
fun calculateThreePaneScaffoldValue(
maxHorizontalPartitions: Int,
adaptStrategies: ThreePaneScaffoldAdaptStrategies,
currentDestination: ThreePaneScaffoldDestinationItem<*>?,
maxVerticalPartitions: Int = 1,
): ThreePaneScaffoldValue
maxHorizontalPartitions: IntRequired
maxHorizontalPartitions: IntRequiredThe maximum allowed partitions along the horizontal axis, i.e., how many expanded panes can be shown at the same time.
adaptStrategies: ThreePaneScaffoldAdaptStrategiesRequired
adaptStrategies: ThreePaneScaffoldAdaptStrategiesRequiredThe adapt strategies of each pane role that ThreePaneScaffold supports, the default value will be ThreePaneScaffoldDefaults.adaptStrategies.
currentDestination: ThreePaneScaffoldDestinationItem<*>?Required
currentDestination: ThreePaneScaffoldDestinationItem<*>?RequiredThe current destination item, which will be treated as having the highest priority, can be null.
maxVerticalPartitions: IntOptionalSince 1.2
maxVerticalPartitions: IntOptionalSince 1.2Default: 1
The maximum allowed partitions along the vertical axis, by default it will be 1 and in this case no reflowed panes will be allowed; if the value equals to or larger than 2, reflowed panes are allowed, besides the expanded pane in the same horizontal partition.
With destinationHistoryExperimental
fun calculateThreePaneScaffoldValue(
maxHorizontalPartitions: Int,
adaptStrategies: ThreePaneScaffoldAdaptStrategies,
destinationHistory: List<ThreePaneScaffoldDestinationItem<*>>,
maxVerticalPartitions: Int = 1,
): ThreePaneScaffoldValue
destinationHistory: List<ThreePaneScaffoldDestinationItem<*>>Required
destinationHistory: List<ThreePaneScaffoldDestinationItem<*>>RequiredThe history of past destination items. The last destination will have the highest priority, and the second last destination will have the second highest priority, and so forth until all panes have a priority assigned. Note that the last destination is supposed to be the last item of the provided list.
Same as above: maxHorizontalPartitions, adaptStrategies, maxVerticalPartitions.
Library docs
Calculates the current adapted value of ThreePaneScaffold according to the given
maxHorizontalPartitions, adaptStrategies and currentDestination. The returned value can be
used as a unique representation of the current layout structure.
The function will treat the current destination as the highest priority and then adapt the rest
panes according to the order of ThreePaneScaffoldRole.Primary,
ThreePaneScaffoldRole.Secondary and ThreePaneScaffoldRole.Tertiary. If there are still
remaining partitions to put the pane, the pane will be set as PaneAdaptedValue.Expanded,
otherwise it will be adapted according to its associated AdaptStrategy.