SceneStateKt

Added in 1.0.0-alpha10

public final class SceneStateKt


Summary

Public methods

static final @NonNull SceneState<@NonNull T>
@Composable
<T extends Object> rememberSceneState(
    @NonNull List<@NonNull NavEntry<@NonNull T>> entries,
    @NonNull SceneStrategy<@NonNull T> sceneStrategy,
    @NonNull Function1<@NonNull IntegerUnit> onBack
)

Returns a SceneState that is remembered across compositions based on the parameters.

Public methods

rememberSceneState

@Composable
public static final @NonNull SceneState<@NonNull T> <T extends Object> rememberSceneState(
    @NonNull List<@NonNull NavEntry<@NonNull T>> entries,
    @NonNull SceneStrategy<@NonNull T> sceneStrategy,
    @NonNull Function1<@NonNull IntegerUnit> onBack
)

Returns a SceneState that is remembered across compositions based on the parameters.

This calculates all of the scenes and provides them in a SceneState.

Parameters
@NonNull List<@NonNull NavEntry<@NonNull T>> entries

all of the entries that are associated with this state

@NonNull SceneStrategy<@NonNull T> sceneStrategy

the SceneStrategy to determine which scene to render a list of entries.

@NonNull Function1<@NonNull IntegerUnit> onBack

a callback for handling system back press. The passed Int refers to the number of entries to pop from the end of the backstack, as calculated by the sceneStrategy.