🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

ThreePaneScaffoldValue

The adapted value of ThreePaneScaffold.

Source set: Common
public class ThreePaneScaffoldValue internal constructor(
    public val primary: PaneAdaptedValue,
    public val secondary: PaneAdaptedValue,
    public val tertiary: PaneAdaptedValue,
    internal val currentDestination: ThreePaneScaffoldRole?,
) : PaneScaffoldValue<ThreePaneScaffoldRole>, PaneExpansionStateKeyProvider

The adapted value of ThreePaneScaffold. It contains each pane's adapted value. ThreePaneScaffold will use the adapted values to decide which panes should be displayed and how they should be displayed. With other input parameters of ThreePaneScaffold fixed, each possible instance of this class should represent a unique state of ThreePaneScaffold and developers can compare two ThreePaneScaffoldValue to decide if there is a layout structure change.

For a Material-opinionated layout, it's suggested to use calculateThreePaneScaffoldValue to calculate the current scaffold value.

Parameters

primary PaneAdaptedValue of the primary pane of ThreePaneScaffold
secondary PaneAdaptedValue of the secondary pane of ThreePaneScaffold
tertiary PaneAdaptedValue of the tertiary pane of ThreePaneScaffold

Properties

paneExpansionStateKey

Source set: Common
public override val paneExpansionStateKey: PaneExpansionStateKey by
        lazy(LazyThreadSafetyMode.SYNCHRONIZED) {
            if (expandedCount != 2) {
                PaneExpansionStateKey.Default
            } else {
                val expandedPanes = Array<ThreePaneScaffoldRole?>(2) { null }
                var count = 0
                forEach { role, value ->
                    if (value == PaneAdaptedValue.Expanded) {
                        expandedPanes[count++] = role
                    }
                }
                TwoPaneExpansionStateKeyImpl(expandedPanes[0]!!, expandedPanes[1]!!)
            }
        }

Content updated: