Represents the edge of a resizable pane that is docked, i.e. the edge that will stay in the same position during resizing.

For example if the edge is DockedEdge.Top, the top edge of the pane won't move and the bottom edge will be moveable to resize the pane.

Note that PaneScaffoldScope.dragToResize and DragToResizeState only supports resizing along one orientation according to their DockedEdge. For example if DockedEdge.Top or DockedEdge.Bottom has been set, the resizing can only happen along the vertical axis.

import androidx.compose.material3.Scaffold
import androidx.compose.material3.adaptive.layout.AdaptStrategy
import androidx.compose.material3.adaptive.layout.AnimatedPane
import androidx.compose.material3.adaptive.layout.DockedEdge
import androidx.compose.material3.adaptive.layout.PaneExpansionAnchor
import androidx.compose.material3.adaptive.layout.PaneExpansionState
import androidx.compose.material3.adaptive.layout.SupportingPaneScaffold
import androidx.compose.material3.adaptive.layout.SupportingPaneScaffoldDefaults
import androidx.compose.material3.adaptive.layout.rememberDragToResizeState
import androidx.compose.material3.adaptive.layout.rememberPaneExpansionState
import androidx.compose.material3.adaptive.navigation.rememberSupportingPaneScaffoldNavigator
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp

val coroutineScope = rememberCoroutineScope()
val scaffoldNavigator =
    rememberSupportingPaneScaffoldNavigator<NavItemData>(
        adaptStrategies =
            SupportingPaneScaffoldDefaults.adaptStrategies(
                extraPaneAdaptStrategy =
                    AdaptStrategy.Levitate(
                        strategy = AdaptStrategy.Levitate.Strategy.SinglePaneOnly,
                        alignment = Alignment.BottomCenter,
                    )
            )
    )
val extraItems = listOf("Extra content")
val selectedItem = NavItemData(index = 0, showExtra = true)

SupportingPaneScaffold(
    directive = scaffoldNavigator.scaffoldDirective,
    scaffoldState = scaffoldNavigator.scaffoldState,
    mainPane = {
        AnimatedPane {
            MainPaneContent(
                scaffoldNavigator = scaffoldNavigator,
                hasExtraPane = true,
                coroutineScope = coroutineScope
            )
        }
    },
    supportingPane = {
        AnimatedPane(modifier = Modifier.preferredWidth(200.dp)) { SupportingPaneContent() }
    },
    extraPane = {
        AnimatedPane(
            modifier =
                Modifier.preferredWidth(480.dp)
                    .preferredHeight(412.dp)
                    .dragToResize(rememberDragToResizeState(dockedEdge = DockedEdge.Bottom))
        ) {
            ExtraPaneContent(
                extraItems = extraItems,
                selectedItem = selectedItem,
                scaffoldNavigator = scaffoldNavigator,
                coroutineScope = coroutineScope
            )
        }
    },
    paneExpansionState =
        rememberPaneExpansionState(
            keyProvider = scaffoldNavigator.scaffoldValue,
            anchors = PaneExpansionAnchors
        ),
    paneExpansionDragHandle = { state -> PaneExpansionDragHandleSample(state) }
)

Summary

Enum Values

Bottom

The bottom edge of the pane is fixed, and resizing happens by moving the top edge.

End

The end edge of the pane is fixed, and resizing happens by moving the start edge.

Start

The start edge of the pane is fixed, and resizing happens by moving the end edge.

Top

The top edge of the pane is fixed, and resizing happens by moving the bottom edge.

Public functions

DockedEdge
valueOf(value: String)

Returns the enum constant of this type with the specified name.

Cmn
Array<DockedEdge>

Returns an array containing the constants of this enum type, in the order they're declared.

Cmn

Public properties

EnumEntries<DockedEdge>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Cmn

Enum Values

Bottom

val DockedEdge.BottomDockedEdge

The bottom edge of the pane is fixed, and resizing happens by moving the top edge.

End

val DockedEdge.EndDockedEdge

The end edge of the pane is fixed, and resizing happens by moving the start edge.

Start

val DockedEdge.StartDockedEdge

The start edge of the pane is fixed, and resizing happens by moving the end edge.

Top

val DockedEdge.TopDockedEdge

The top edge of the pane is fixed, and resizing happens by moving the bottom edge.

Public functions

valueOf

fun valueOf(value: String): DockedEdge

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Throws
kotlin.IllegalArgumentException

if this enum type has no constant with the specified name

values

fun values(): Array<DockedEdge>

Returns an array containing the constants of this enum type, in the order they're declared.

This method may be used to iterate over the constants.

Public properties

entries

val entriesEnumEntries<DockedEdge>

Returns a representation of an immutable list of all enum entries, in the order they're declared.

This method may be used to iterate over the enum entries.