@ExperimentalMaterial3AdaptiveApi
sealed interface PaneScaffoldMotionDataProvider<Role : PaneScaffoldRole>
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 | the pane scaffold role class used to specify panes in the associated pane scaffold; see ThreePaneScaffoldRole, ListDetailPaneScaffoldRole, and SupportingPaneScaffoldRole. |
Properties
val scaffoldSize: IntSize
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.
val count: Int
The number of PaneMotionData stored in the provider.
Functions
getRoleAt
fun getRoleAt(index: Int): Role
Returns the role of the pane at the given index.
Parameters
| index | the index of the associated pane |
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 | the role of the associated pane |
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 | the index of the associated pane |