Class Navigator
-
- All Implemented Interfaces:
public final class Navigator
-
-
Field Summary
Fields Modifier and Type Field Description private final AngularNativeDestinationcurrentDestinationprivate final Stringlocationprivate final StringpreviousLocationprivate final Sessionsessionprivate final NavigatorHosthostprivate final NavigatorConfigurationconfigurationprivate final AngularNativeActivityactivity
-
Constructor Summary
Constructors Constructor Description Navigator(NavigatorHost host, NavigatorConfiguration configuration, AngularNativeActivity activity)
-
Method Summary
Modifier and Type Method Description final AngularNativeDestinationgetCurrentDestination()Retrieves the currently active AngularNativeDestination on the backstack. final StringgetLocation()Gets the location for the current destination. final StringgetPreviousLocation()Gets the location for the previous destination on the backstack. final SessiongetSession()The Session instance that is shared with all destinations that are hosted inside this NavigatorHost. final NavigatorHostgetHost()final NavigatorConfigurationgetConfiguration()final AngularNativeActivitygetActivity()final BooleanisReady()Returns whether the navigator and its host are ready for navigation. final BooleanisAtStartDestination()Returns whether the current destination is the only backstack entry. final Unitpop()Pops the backstack to the previous destination. final Unitroute(String location, VisitOptions options, Bundle bundle, FragmentNavigator.Extras extras, NavOptions navigationOptions)Routes to the specified location. final UnitclearAll(Function0<Unit> onCleared)Clears the navigation backstack to the start destination. final Unitreset(Function0<Unit> onReset)Resets the Navigator along with its NavigatorHost and Session instance. final NavigatorHostfindNavigatorHost(@IdRes() Integer navigatorHostId)Finds the registered navigator host associated with the provided resource ID. -
-
Constructor Detail
-
Navigator
Navigator(NavigatorHost host, NavigatorConfiguration configuration, AngularNativeActivity activity)
-
-
Method Detail
-
getCurrentDestination
final AngularNativeDestination getCurrentDestination()
Retrieves the currently active AngularNativeDestination on the backstack.
-
getLocation
final String getLocation()
Gets the location for the current destination.
-
getPreviousLocation
final String getPreviousLocation()
Gets the location for the previous destination on the backstack.
-
getSession
final Session getSession()
The Session instance that is shared with all destinations that are hosted inside this NavigatorHost.
-
getHost
final NavigatorHost getHost()
-
getConfiguration
final NavigatorConfiguration getConfiguration()
-
getActivity
final AngularNativeActivity getActivity()
-
isReady
final Boolean isReady()
Returns whether the navigator and its host are ready for navigation. It is not ready for navigation if the host view is not attached or the start destination has not been created yet.
-
isAtStartDestination
final Boolean isAtStartDestination()
Returns whether the current destination is the only backstack entry.
-
route
final Unit route(String location, VisitOptions options, Bundle bundle, FragmentNavigator.Extras extras, NavOptions navigationOptions)
Routes to the specified location. The resulting destination and its presentation will be determined using the path configuration rules.
- Parameters:
location- The location to navigate to.options- Visit options to apply to the visit.bundle- Bundled arguments to pass to the destination.extras- Extras that can be passed to enable Fragment specific behavior.
-
clearAll
final Unit clearAll(Function0<Unit> onCleared)
Clears the navigation backstack to the start destination.
-
reset
final Unit reset(Function0<Unit> onReset)
Resets the Navigator along with its NavigatorHost and Session instance. The entire navigation graph is reset to its original starting point.
-
findNavigatorHost
final NavigatorHost findNavigatorHost(@IdRes() Integer navigatorHostId)
Finds the registered navigator host associated with the provided resource ID.
- Returns:
The NavigatorHost instance if it's view has been created and it has been registered with the Activity, otherwise
null.
-
-
-
-