NavEntryDecoratorKt

Added in 1.0.0-alpha02

public final class NavEntryDecoratorKt


Summary

Public methods

static final void
@Composable
<T extends Object> DecorateNavEntry(
    @NonNull NavEntry<@NonNull T> entry,
    @NonNull List<@NonNull NavEntryDecorator<@NonNull ?>> entryDecorators
)

Wraps a NavEntry with the list of NavEntryDecorator in the order that the decorators were added to the list and invokes the content of the wrapped entry.

static final @NonNull NavEntryDecorator<@NonNull T>
<T extends Object> navEntryDecorator(
    @NonNull Function1<@NonNull ObjectUnit> onPop,
    @Composable @NonNull Function1<@NonNull NavEntry<@NonNull T>, Unit> decorator
)

Function to provide information to all the NavEntry that are integrated with a DecoratedNavEntryProvider.

Public methods

@Composable
public static final void <T extends Object> DecorateNavEntry(
    @NonNull NavEntry<@NonNull T> entry,
    @NonNull List<@NonNull NavEntryDecorator<@NonNull ?>> entryDecorators
)

Wraps a NavEntry with the list of NavEntryDecorator in the order that the decorators were added to the list and invokes the content of the wrapped entry.

public static final @NonNull NavEntryDecorator<@NonNull T> <T extends Object> navEntryDecorator(
    @NonNull Function1<@NonNull ObjectUnit> onPop,
    @Composable @NonNull Function1<@NonNull NavEntry<@NonNull T>, Unit> decorator
)

Function to provide information to all the NavEntry that are integrated with a DecoratedNavEntryProvider.

Parameters
@NonNull Function1<@NonNull ObjectUnit> onPop

a callback that provides the key of a NavEntry that has been popped from the backStack and is leaving composition. This optional callback should to be used to clean up states that were used to decorate the NavEntry3

@Composable @NonNull Function1<@NonNull NavEntry<@NonNull T>, Unit> decorator

the composable function to provide information to a NavEntry. Note that this function only gets invoked for NavEntries that are actually getting rendered (i.e. by invoking the NavEntry.content.)