FragmentNavigator.Destination

@NavDestination.ClassType(value = Fragment) public class FragmentNavigator.Destination extends NavDestination

Known direct subclasses
DynamicFragmentNavigator.Destination

Destination for dynamic feature navigator.


NavDestination specific to FragmentNavigator

Construct a new fragment destination. This destination is not valid until you set the Fragment via setClassName.

Summary

Public fields

final @NonNull String

The Fragment's class name associated with this destination

Public constructors

Destination(NavigatorProvider navigatorProvider)

Construct a new fragment destination.

Public methods

boolean
equals(Object other)
int
@CallSuper void
onInflate(Context context, AttributeSet attrs)

Called when inflating a destination from a resource.

final @NonNull FragmentNavigator.Destination
setClassName(String className)

Set the Fragment class name associated with this destination

@NonNull String

Inherited methods

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

Sets an argument type for an argument name

final void
addDeepLink(NavDeepLink navDeepLink)

Add a deep link to this destination.

final void
addDeepLink(String uriPattern)

Add a deep link to this destination.

final NavAction
getAction(@IdRes int id)

Returns the NavAction for the given action ID.

boolean
hasDeepLink(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, 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(String argumentName)

Unsets the argument type for an argument name.

Public fields

className

public final @NonNull String className

The Fragment's class name associated with this destination

Throws
kotlin.IllegalStateException

when no Fragment class was set.

Public constructors

Destination

public final Destination(NavigatorProvider navigatorProvider)

Construct a new fragment destination. This destination is not valid until you set the Fragment via setClassName.

Parameters
NavigatorProvider navigatorProvider

The NavController which this destination will be associated with.

Destination

public final Destination(
    Navigator<FragmentNavigator.Destination> fragmentNavigator
)
Parameters
Navigator<FragmentNavigator.Destination> fragmentNavigator

The FragmentNavigator which this destination will be associated with. Generally retrieved via a NavController's NavigatorProvider.getNavigator method.

Public methods

equals

public boolean equals(Object other)

hashCode

public int hashCode()

onInflate

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

Called when inflating a destination from a resource.

Parameters
Context context