public class NavEntry<T extends Object>

Known direct subclasses
NavEntryWrapper

Class that wraps a NavEntry within another NavEntry.


Entry maintains and stores the key and the content represented by that key. Entries should be created as part of a reference/androidx/navigation/NavDisplay.

Parameters
<T extends Object>

the type of the key for this NavEntry

Summary

Public constructors

<T extends Object> NavEntry(
    @NonNull T key,
    @NonNull Object contentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull T, Unit> content
)

Public methods

void

Invokes the composable content of this NavEntry with the key that was provided when instantiating this NavEntry

final @NonNull Object

A unique, stable id that uniquely identifies the content of this NavEntry.

@NonNull Map<@NonNull String, @NonNull Object>

provides information to the display

Public constructors

public <T extends Object> NavEntry(
    @NonNull T key,
    @NonNull Object contentKey,
    @NonNull Map<@NonNull String, @NonNull Object> metadata,
    @Composable @NonNull Function1<@NonNull T, Unit> content
)
Parameters
<T extends Object>

the type of the key for this NavEntry

@NonNull T key

key for this entry

@NonNull Object contentKey

A unique, stable id that uniquely identifies the content of this NavEntry. To maximize stability, it should ge derived from the key. The contentKey type must be saveable (i.e. on Android, it should be saveable via Android). Defaults to key.toString().

@NonNull Map<@NonNull String, @NonNull Object> metadata

provides information to the display

@Composable @NonNull Function1<@NonNull T, Unit> content

content for this entry to be displayed when this entry is active

Public methods

Content

Added in 1.0.0-alpha04
@Composable
public void Content()

Invokes the composable content of this NavEntry with the key that was provided when instantiating this NavEntry

getContentKey

Added in 1.0.0-alpha04
public final @NonNull Object getContentKey()

A unique, stable id that uniquely identifies the content of this NavEntry. To maximize stability, it should ge derived from the key. The contentKey type must be saveable (i.e. on Android, it should be saveable via Android). Defaults to key.toString().

getMetadata

Added in 1.0.0-alpha04
public @NonNull Map<@NonNull String, @NonNull ObjectgetMetadata()

provides information to the display