sealed interface PaneScaffoldScope
The base scope of pane scaffolds, which provides scoped functions that supported by pane scaffolds.
Properties
val saveableStateHolder: SaveableStateHolder
The saveable state holder to save pane states across their visibility life-cycles. The default pane implementations like AnimatedPane are supposed to use it to store states.
Functions
preferredWidth
fun Modifier.preferredWidth(width: Dp): Modifier
This modifier specifies the preferred width for a pane in Dps, and the pane scaffold implementation will try its best to respect this width when the associated pane is rendered as a fixed pane, i.e., a pane that are not stretching to fill the remaining spaces. In case the modifier is not set or set to Dp.Unspecified, the default preferred widths provided by PaneScaffoldDirective are supposed to be used.
Note that the preferred width may not be applied when the associated pane has a higher priority than the rest of panes (for example, primary pane v.s. secondary pane) so it stretches to fill the available width, or when there are hinges to avoid intersecting with the scaffold, so the pane will be shrunk or expanded to respect the hinge areas.
Also note that if multiple PaneScaffoldScope.preferredWidth modifiers are applied, the last applied one will override all the previous settings.
preferredWidth
fun Modifier.preferredWidth(@FloatRange(0.0, 1.0) proportion: Float): Modifier
This modifier specifies the preferred width for a pane as a proportion of the overall scaffold width. The value is a float ranging from 0.0 to 1.0.
The pane scaffold implementation will endeavor to respect this width when the associated pane is rendered as a fixed pane, i.e., a pane that is not stretching to fill the remaining spaces.
If this modifier is not set, the default preferred width defined by PaneScaffoldDirective.defaultPanePreferredWidth will be used.
Note that the preferred width may not be applied when the associated pane has a higher priority than the rest of panes (for example, primary pane v.s. secondary pane) so it stretches to fill the available width, or when there are hinges to avoid intersecting with the scaffold, so the pane will be shrunk or expanded to respect the hinge areas.
Also note that if multiple PaneScaffoldScope.preferredWidth modifiers are applied, the last applied one will override all the previous settings.
preferredHeight
fun Modifier.preferredHeight(height: Dp): Modifier
This modifier specifies the preferred height for a pane in Dps, and the pane scaffold implementation will try its best to respect this height when the associated pane is rendered as a reflowed or a levitated pane. In case the modifier is not set or set to Dp.Unspecified, the default preferred heights provided by PaneScaffoldDirective are supposed to be used.
Note that the preferred height may not be applied when the associated pane is an expanded pane so it stretches to fill the available height, or when there are hinges to avoid intersecting with the scaffold, so the pane will be shrunk or expanded to respect the hinge areas.
Also note that if multiple PaneScaffoldScope.preferredHeight modifiers are applied, the last applied one will override all the previous settings.
preferredHeight
fun Modifier.preferredHeight(@FloatRange(0.0, 1.0) proportion: Float): Modifier
This modifier specifies the preferred height for a pane as a proportion of the overall scaffold height. The value is a float ranging from 0.0 to 1.0.
The pane scaffold implementation will endeavor to respect this height when the associated pane is rendered in its PaneAdaptedValue.Reflowed or PaneAdaptedValue.Levitated state.
If this modifier is not set, the default preferred height defined by PaneScaffoldDirective.defaultPanePreferredHeight will be used.
Note that the preferred height may not be applied when the associated pane is an expanded pane so it stretches to fill the available height, or when there are hinges to avoid intersecting with the scaffold, so the pane will be shrunk or expanded to respect the hinge areas.
Also note that if multiple PaneScaffoldScope.preferredHeight modifiers are applied, the last applied one will override all the previous settings.
paneExpansionDraggable
fun Modifier.paneExpansionDraggable(
state: PaneExpansionState,
minTouchTargetSize: Dp,
interactionSource: MutableInteractionSource,
semanticsProperties: (SemanticsPropertyReceiver.() -> Unit)? = null,
): Modifier
The modifier that should be applied on a drag handle composable so the drag handle can be dragged and operate on the provided PaneExpansionState properly. By default this modifier supports two types of user interactions:
- Dragging the handle horizontally within the pane scaffold.
- Accessibility actions provided via semanticsProperties.
Besides that, this modifier also sets up other necessary behaviors of a pane expansion drag handle, like excluding system gestures and ensuring minimum touch target size.
Parameters
| state | the PaneExpansionState that controls the pane expansion of the associated pane scaffold |
| minTouchTargetSize | the minimum touch target size of the drag handle |
| interactionSource | the MutableInteractionSource to address user interactions |
| semanticsProperties | the optional semantics setup working with accessibility services; a default implementation will be used if nothing is provided. |
paneMargins
@ExperimentalMaterial3AdaptiveApi
@Composable
fun Modifier.paneMargins(vararg insets: RectRulers): Modifier
This modifier specifies the associated pane's margins according to the provided RectRulers as insets. Note that if multiple inset rulers are provided, the scaffold will decide the actual margins by taking the union of these insets - i.e. the one creating the largest margins will be used.
Parameters
| insets | the insets the pane wants to respect. |
paneMargins
@ExperimentalMaterial3AdaptiveApi
@Composable
fun Modifier.paneMargins(fixedMargins: PaddingValues, vararg insets: RectRulers): Modifier
This modifier specifies the associated pane's margins according to specified fixed margins and the provided RectRulers as insets, if any. Note that the scaffold will decide the actual margins by taking the union of the fixed margins and the provided insets - i.e. the one creating the largest margins will be used.
Parameters
| fixedMargins | fixed margins to use for the pane; note that the margins will only be applied against the pane scaffold's bounds - for example if the scaffold is showing a dual-pane layout, in common situations, the spacer size between two panes won't be decided by either the left pane's right margin or the right pane's left margin, instead, PaneScaffoldDirective.horizontalPartitionSpacerSize will be used. |
| insets | the insets the pane wants to respect. |