NavGraphKt

public final class NavGraphKt


Summary

Public methods

static final boolean
NavGraphKt.contains(@NonNull NavGraph receiver, @IdRes int id)

Returns true if a destination with id is found in this navigation graph.

static final boolean

Returns true if a destination with route is found in this navigation graph.

static final @NonNull NavDestination
NavGraphKt.get(@NonNull NavGraph receiver, @IdRes int id)

Returns the destination with id.

static final @NonNull NavDestination

Returns the destination with route.

static final void
NavGraphKt.minusAssign(
    @NonNull NavGraph receiver,
    @NonNull NavDestination node
)

Removes node from this navigation graph.

static final void
NavGraphKt.plusAssign(
    @NonNull NavGraph receiver,
    @NonNull NavDestination node
)

Adds a destination to this NavGraph.

static final void

Add all destinations from another collection to this one.

Public methods

NavGraphKt.contains

@NonNull
public static final boolean NavGraphKt.contains(@NonNull NavGraph receiver, @IdRes int id)

Returns true if a destination with id is found in this navigation graph.

NavGraphKt.contains

@NonNull
public static final boolean NavGraphKt.contains(@NonNull NavGraph receiver, @NonNull String route)

Returns true if a destination with route is found in this navigation graph.

NavGraphKt.get

@NonNull
public static final NavDestination NavGraphKt.get(@NonNull NavGraph receiver, @IdRes int id)

Returns the destination with id.

Throws
kotlin.IllegalArgumentException

if no destination is found with that id.

NavGraphKt.get

@NonNull
public static final NavDestination NavGraphKt.get(@NonNull NavGraph receiver, @NonNull String route)

Returns the destination with route.

Throws
kotlin.IllegalArgumentException

if no destination is found with that route.

NavGraphKt.minusAssign

@NonNull
public static final void NavGraphKt.minusAssign(
    @NonNull NavGraph receiver,
    @NonNull NavDestination node
)

Removes node from this navigation graph.

NavGraphKt.plusAssign

@NonNull
public static final void NavGraphKt.plusAssign(
    @NonNull NavGraph receiver,
    @NonNull NavDestination node
)

Adds a destination to this NavGraph. The destination must have an id set.

The destination must not have a parent set. If the destination is already part of a NavGraph, call NavGraph.remove before calling this method.

Parameters
@NonNull NavDestination node

destination to add

NavGraphKt.plusAssign

@NonNull
public static final void NavGraphKt.plusAssign(@NonNull NavGraph receiver, @NonNull NavGraph other)

Add all destinations from another collection to this one. As each destination has at most one parent, the destinations will be removed from the given NavGraph.

Parameters
@NonNull NavGraph other

collection of destinations to add. All destinations will be removed from the parameter graph after being added to this graph.