PaneScaffoldMotionDataProvider


Scope for performing pane motions within a pane scaffold. It provides the spec and necessary info to decide a pane's EnterTransition and ExitTransition, as well as how bounds morphing will be performed.

Parameters
<Role : Any?>

the pane scaffold role class used to specify panes in the associated pane scaffold; see ThreePaneScaffoldRole, ListDetailPaneScaffoldRole, and SupportingPaneScaffoldRole.

Summary

Public functions

operator PaneMotionData
get(index: Int)

Returns PaneMotionData associated with the given index, in the left-to-right order of the panes in the scaffold.

Cmn
operator PaneMotionData
get(role: Role)

Returns PaneMotionData associated with the given pane scaffold role.

Cmn
Role
getRoleAt(index: Int)

Returns the role of the pane at the given index.

Cmn

Public properties

Int

The number of PaneMotionData stored in the provider.

Cmn
IntSize

The scaffold's current size.

Cmn

Extension functions

inline Unit

Perform actions on each PaneMotionData, in the left-to-right order of the panes in the scaffold.

Cmn
inline Unit

Perform actions on each PaneMotionData, in the right-to-left order of the panes in the scaffold.

Cmn

Public functions

get

operator fun get(index: Int): PaneMotionData

Returns PaneMotionData associated with the given index, in the left-to-right order of the panes in the scaffold.

The size and the offset info provided by motion data will only be update during the measurement stage of the scaffold. Before the first measurement, their values will be IntSize.Zero and IntOffset.Zero.

Note that the aforementioned variable fields are NOT backed by snapshot states and they are supposed to be only read proactively by the motion logic "on-the-fly" when the scaffold motion is happening. Using them elsewhere may cause unexpected behavior.

Parameters
index: Int

the index of the associated pane

Throws
kotlin.IndexOutOfBoundsException

if index is larger than or equals to count

get

operator fun get(role: Role): PaneMotionData

Returns PaneMotionData associated with the given pane scaffold role.

The size and the offset info provided by motion data will only be update during the measurement stage of the scaffold. Before the first measurement, their values will be IntSize.Zero and IntOffset.Zero.

Note that the aforementioned variable fields are NOT backed by snapshot states and they are supposed to be only read proactively by the motion logic "on-the-fly" when the scaffold motion is happening. Using them elsewhere may cause unexpected behavior.

Parameters
role: Role

the role of the associated pane

getRoleAt

fun getRoleAt(index: Int): Role

Returns the role of the pane at the given index.

Parameters
index: Int

the index of the associated pane

Throws
kotlin.IndexOutOfBoundsException

if index is larger than or equals to count

Public properties

count

val countInt

The number of PaneMotionData stored in the provider.

scaffoldSize

val scaffoldSizeIntSize

The scaffold's current size. Note that the value of the field will only be updated during measurement of the scaffold and before the first measurement the value will be IntSize.Zero.

Note that this field is not backed by snapshot states so it's supposed to be only read proactively by the motion logic "on-the-fly" when the scaffold motion is happening.

Extension functions

@ExperimentalMaterial3AdaptiveApi
inline fun <Role : Any?> PaneScaffoldMotionDataProvider<Role>.forEach(
    action: (Role, PaneMotionData) -> Unit
): Unit

Perform actions on each PaneMotionData, in the left-to-right order of the panes in the scaffold.

Parameters
action: (Role, PaneMotionData) -> Unit

action to perform on each PaneMotionData.

@ExperimentalMaterial3AdaptiveApi
inline fun <Role : Any?> PaneScaffoldMotionDataProvider<Role>.forEachReversed(
    action: (Role, PaneMotionData) -> Unit
): Unit

Perform actions on each PaneMotionData, in the right-to-left order of the panes in the scaffold.

Parameters
action: (Role, PaneMotionData) -> Unit

action to perform on each PaneMotionData.