class PaneScaffoldDirective(
val maxHorizontalPartitions: Int,
val horizontalPartitionSpacerSize: Dp,
val maxVerticalPartitions: Int,
val verticalPartitionSpacerSize: Dp,
val defaultPanePreferredWidth: Dp,
val defaultPanePreferredHeight: Dp,
val excludedBounds: List<Rect>,
@get:JvmName("shouldAutoFocusCurrentDestination") val shouldAutoFocusCurrentDestination: Boolean,
)
Top-level directives about how a pane scaffold should be arranged and spaced, like how many partitions the layout can be split into and what should be the gutter size.
Secondary Constructors
constructor(
maxHorizontalPartitions: Int,
horizontalPartitionSpacerSize: Dp,
maxVerticalPartitions: Int,
verticalPartitionSpacerSize: Dp,
defaultPanePreferredWidth: Dp,
excludedBounds: List<Rect>,
) : this(
maxHorizontalPartitions = maxHorizontalPartitions,
horizontalPartitionSpacerSize = horizontalPartitionSpacerSize,
maxVerticalPartitions = maxVerticalPartitions,
verticalPartitionSpacerSize = verticalPartitionSpacerSize,
defaultPanePreferredWidth = defaultPanePreferredWidth,
defaultPanePreferredHeight = DefaultPreferredHeight,
excludedBounds = excludedBounds,
)
constructor(
maxHorizontalPartitions: Int,
horizontalPartitionSpacerSize: Dp,
maxVerticalPartitions: Int,
verticalPartitionSpacerSize: Dp,
defaultPanePreferredWidth: Dp,
defaultPanePreferredHeight: Dp,
excludedBounds: List<Rect>,
) : this(
maxHorizontalPartitions = maxHorizontalPartitions,
horizontalPartitionSpacerSize = horizontalPartitionSpacerSize,
maxVerticalPartitions = maxVerticalPartitions,
verticalPartitionSpacerSize = verticalPartitionSpacerSize,
defaultPanePreferredWidth = defaultPanePreferredWidth,
defaultPanePreferredHeight = defaultPanePreferredHeight,
excludedBounds = excludedBounds,
shouldAutoFocusCurrentDestination = true,
)
Functions
copy
fun copy(
maxHorizontalPartitions: Int = this.maxHorizontalPartitions,
horizontalPartitionSpacerSize: Dp = this.horizontalPartitionSpacerSize,
maxVerticalPartitions: Int = this.maxVerticalPartitions,
verticalPartitionSpacerSize: Dp = this.verticalPartitionSpacerSize,
defaultPanePreferredWidth: Dp = this.defaultPanePreferredWidth,
excludedBounds: List<Rect> = this.excludedBounds,
defaultPanePreferredHeight: Dp = this.defaultPanePreferredHeight,
): PaneScaffoldDirective
Returns a new copy of PaneScaffoldDirective with specified fields overwritten. Use this method to create a custom PaneScaffoldDirective from the default instance or the result of calculatePaneScaffoldDirective.
Parameters
| maxHorizontalPartitions | the max number of partitions along the horizontal axis the layout can be split into. |
| horizontalPartitionSpacerSize | Size of the spacers between horizontal partitions. It's equivalent to the left/right margins the horizontal partitions. |
| maxVerticalPartitions | the max number of partitions along the vertical axis the layout can be split into. |
| verticalPartitionSpacerSize | Size of the spacers between vertical partitions. It's equivalent to the top/bottom margins of the vertical partitions. |
| defaultPanePreferredWidth | Default preferred width of panes that will be used by the scaffold if there's no PaneScaffoldScope.preferredWidth provided with a pane. |
| excludedBounds | the bounds of all areas in the window that the layout needs to avoid displaying anything upon it. Usually these bounds represent where physical hinges are. |
| defaultPanePreferredHeight | Default preferred height of panes that will be used by the scaffold if there's no PaneScaffoldScope.preferredHeight provided with a pane. |
copy
fun copy(
maxHorizontalPartitions: Int = this.maxHorizontalPartitions,
horizontalPartitionSpacerSize: Dp = this.horizontalPartitionSpacerSize,
maxVerticalPartitions: Int = this.maxVerticalPartitions,
verticalPartitionSpacerSize: Dp = this.verticalPartitionSpacerSize,
defaultPanePreferredWidth: Dp = this.defaultPanePreferredWidth,
excludedBounds: List<Rect> = this.excludedBounds,
): PaneScaffoldDirective
Returns a new copy of PaneScaffoldDirective with specified fields overwritten. Use this method to create a custom PaneScaffoldDirective from the default instance or the result of calculatePaneScaffoldDirective.
Parameters
| maxHorizontalPartitions | the max number of partitions along the horizontal axis the layout can be split into. |
| horizontalPartitionSpacerSize | Size of the spacers between horizontal partitions. It's equivalent to the left/right margins the horizontal partitions. |
| maxVerticalPartitions | the max number of partitions along the vertical axis the layout can be split into. |
| verticalPartitionSpacerSize | Size of the spacers between vertical partitions. It's equivalent to the top/bottom margins of the vertical partitions. |
| defaultPanePreferredWidth | Default preferred width of panes that will be used by the scaffold if there's no PaneScaffoldScope.preferredWidth provided with a pane. |
| excludedBounds | the bounds of all areas in the window that the layout needs to avoid displaying anything upon it. Usually these bounds represent where physical hinges are. |
Companion Object
Properties
val Default =
PaneScaffoldDirective(
maxHorizontalPartitions = 1,
horizontalPartitionSpacerSize = 0.dp,
maxVerticalPartitions = 1,
verticalPartitionSpacerSize = 0.dp,
defaultPanePreferredWidth = DefaultPreferredWidth,
defaultPanePreferredHeight = DefaultPreferredHeight,
excludedBounds = emptyList(),
)
A default instance of PaneScaffoldDirective that suggests a single-pane layout that occupies the full window. To create a customized PaneScaffoldDirective, you can use PaneScaffoldDirective.copy on the default instance to create a copy with custom values.