Common
@ExperimentalMaterial3AdaptiveApi
class MutableThreePaneScaffoldState(initialScaffoldValue: ThreePaneScaffoldValue) :
ThreePaneScaffoldState()
The seekable state of a three pane scaffold. It serves as the SeekableTransitionState to manipulate the Transition between ThreePaneScaffoldValues.
Functions
snapTo
suspend fun snapTo(targetState: ThreePaneScaffoldValue)
Sets currentState and targetState to targetState and snaps all values to those at that state. The transition will not have any animations running after running snapTo.
Parameters
| targetState | The ThreePaneScaffoldValue state to snap to. |
seekTo
suspend fun seekTo(
@FloatRange(from = 0.0, to = 1.0) fraction: Float,
targetState: ThreePaneScaffoldValue = this.targetState,
isPredictiveBackInProgress: Boolean = false,
)
Seeks the transition to targetState with fraction used to indicate the progress towards targetState.
Parameters
| fraction | The fractional progress of the transition. |
| targetState | The ThreePaneScaffoldValue state to seek to. |
| isPredictiveBackInProgress | whether this seek is associated with a predictive back gesture on the scaffold. |
animateTo
suspend fun animateTo(
targetState: ThreePaneScaffoldValue = this.targetState,
animationSpec: FiniteAnimationSpec<Float>? = null,
isPredictiveBackInProgress: Boolean = false,
)
Updates the current targetState to targetState with an animation to the new state.
Parameters
| targetState | The ThreePaneScaffoldValue state to animate towards. |
| animationSpec | If provided, is used to animate the animation fraction. If null, the transition is linearly traversed based on the duration of the transition. |
| isPredictiveBackInProgress | whether this animation is associated with a predictive back gesture on the scaffold. |