DynamicFragmentNavigator.Destination

public final class DynamicFragmentNavigator.Destination extends NavDestination, FragmentNavigator.Destination


Destination for dynamic feature navigator.

Summary

Public fields

final @NonNull Map<@NonNull String, @NonNull NavArgument>

The arguments supported by this destination.

final @NonNull String

The Fragment's class name associated with this destination

final int

The destination's unique ID.

final @Nullable CharSequence

The descriptive label of this destination.

final @Nullable String
final @NonNull String

The name associated with this destination's Navigator.

final @Nullable NavGraph

Gets the NavGraph that contains this destination.

final @Nullable String

The destination's unique route.

Public constructors

Public methods

boolean
int
void

Called when inflating a destination from a resource.

Inherited methods

From class FragmentNavigator.Destination
final @NonNull FragmentNavigator.Destination

Set the Fragment class name associated with this destination

@NonNull String
From class NavDestination
final void
addArgument(@NonNull String argumentName, @NonNull NavArgument argument)

Sets an argument type for an argument name

final void

Add a deep link to this destination.

final void
addDeepLink(@NonNull String uriPattern)

Add a deep link to this destination.

final @Nullable NavAction
getAction(@IdRes int id)

Returns the NavAction for the given action ID.

boolean
hasDeepLink(@NonNull Uri deepLink)

Checks the given deep link Uri, and determines whether it matches a Uri pattern added to the destination by a call to addDeepLink .

boolean

Checks the given NavDeepLinkRequest, and determines whether it matches a NavDeepLink added to the destination by a call to addDeepLink.

final void
putAction(@IdRes int actionId, @NonNull NavAction action)

Sets the NavAction destination for an action ID.

final void
putAction(@IdRes int actionId, @IdRes int destId)

Creates a NavAction for the given destId and associates it with the actionId.

final void
removeAction(@IdRes int actionId)

Unsets the NavAction for an action ID.

final void
removeArgument(@NonNull String argumentName)

Unsets the argument type for an argument name.

Public fields

arguments

@NonNull
public final @NonNull Map<@NonNull String, @NonNull NavArgumentarguments

The arguments supported by this destination. Returns a read-only map of argument names to NavArgument objects that can be used to check the type, default value and nullability of the argument.

To add and remove arguments for this NavDestination use addArgument and removeArgument.

Returns
@NonNull Map<@NonNull String, @NonNull NavArgument>

Read-only map of argument names to arguments.

className

@NonNull
public final @NonNull String className

The Fragment's class name associated with this destination

Throws
kotlin.IllegalStateException

when no Fragment class was set.

id

@NonNull
public final int id

The destination's unique ID. This should be an ID resource generated by the Android resource system.

label

@Nullable
public final @Nullable CharSequence label

The descriptive label of this destination.

moduleName

@Nullable
public final @Nullable String moduleName
@NonNull
public final @NonNull String navigatorName

The name associated with this destination's Navigator.

parent

@Nullable
public final @Nullable NavGraph parent

Gets the NavGraph that contains this destination. This will be set when a destination is added to a NavGraph via NavGraph.addDestination.

route

@Nullable
public final @Nullable String route

The destination's unique route. Setting this will also update the id of the destinations so custom destination ids should only be set after setting the route.

Returns
@Nullable String

this destination's route, or null if no route is set

Throws
kotlin.IllegalArgumentException

is the given route is empty

Public constructors

Destination

public final Destination(@NonNull NavigatorProvider navigatorProvider)

Destination

public final Destination(
    @NonNull Navigator<@NonNull FragmentNavigator.Destination> fragmentNavigator
)

Public methods

equals

@NonNull
public boolean equals(@Nullable Object other)

hashCode

@NonNull
public int hashCode()

onInflate

@NonNull
public void onInflate(@NonNull Context context, @NonNull AttributeSet attrs)

Called when inflating a destination from a resource.

Parameters
@NonNull Context context

local context performing inflation

@NonNull AttributeSet attrs

attrs to parse during inflation