NavGraphKt

public final class NavGraphKt


Summary

Public methods

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

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

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

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

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

Returns the destination with id.

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

Returns the destination with route.

static final void

Removes node from this navigation graph.

static final void

Adds a destination to this NavGraph.

static final void

Add all destinations from another collection to this one.

Public methods

NavGraphKt.contains

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

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

NavGraphKt.contains

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

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

NavGraphKt.get

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

Returns the destination with id.

Throws
kotlin.IllegalArgumentException

if no destination is found with that id.

NavGraphKt.get

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

Returns the destination with route.

Throws
kotlin.IllegalArgumentException

if no destination is found with that route.

NavGraphKt.minusAssign

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

Removes node from this navigation graph.

NavGraphKt.plusAssign

public static final void NavGraphKt.plusAssign(NavGraph receiver, 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
NavDestination node

destination to add

NavGraphKt.plusAssign

public static final void NavGraphKt.plusAssign(NavGraph receiver, 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
NavGraph other

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