ActivityNavigator
-
android
@Navigator.Name(value = "activity")
open class ActivityNavigator : Navigator
ActivityNavigator implements cross-activity navigation.
Summary
Nested types |
|---|
@NavDestination.ClassType(value = Activity)NavDestination for activity navigation |
|
Extras that can be passed to ActivityNavigator to customize what |
|
Builder for constructing new |
Public companion functions |
||
|---|---|---|
Unit |
applyPopAnimationsToPendingTransition(activity: Activity)Apply any pop animations in the Intent of the given Activity to a pending transition. |
android
|
Public constructors |
|
|---|---|
ActivityNavigator(context: Context) |
android
|
Public functions |
||
|---|---|---|
open ActivityNavigator.Destination |
Construct a new NavDestination associated with this Navigator. |
android
|
open NavDestination? |
navigate(Navigate to a destination. |
android
|
open Boolean |
Attempt to pop this navigator's back stack, performing the appropriate navigation. |
android
|
Inherited functions |
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Inherited properties |
||||||
|---|---|---|---|---|---|---|
|
Public companion functions
applyPopAnimationsToPendingTransition
fun applyPopAnimationsToPendingTransition(activity: Activity): Unit
Apply any pop animations in the Intent of the given Activity to a pending transition. This should be used in place of Activity.overridePendingTransition to get the appropriate pop animations.
| Parameters | |
|---|---|
activity: Activity |
An activity started from the |
| See also | |
|---|---|
popEnterAnim |
|
popExitAnim |
Public constructors
Public functions
createDestination
open fun createDestination(): ActivityNavigator.Destination
Construct a new NavDestination associated with this Navigator.
Any initialization of the destination should be done in the destination's constructor as it is not guaranteed that every destination will be created through this method.
| Returns | |
|---|---|
ActivityNavigator.Destination |
a new NavDestination |
navigate
open fun navigate(
destination: ActivityNavigator.Destination,
args: Bundle?,
navOptions: NavOptions?,
navigatorExtras: Navigator.Extras?
): NavDestination?
Navigate to a destination.
Requests navigation to a given destination associated with this navigator in the navigation graph. This method generally should not be called directly; NavController will delegate to it when appropriate.
| Parameters | |
|---|---|
destination: ActivityNavigator.Destination |
destination node to navigate to |
args: Bundle? |
arguments to use for navigation |
navOptions: NavOptions? |
additional options for navigation |
navigatorExtras: Navigator.Extras? |
extras unique to your Navigator. |
| Returns | |
|---|---|
NavDestination? |
The NavDestination that should be added to the back stack or null if no change was made to the back stack (i.e., in cases of single top operations where the destination is already on top of the back stack). |
| Throws | |
|---|---|
kotlin.IllegalArgumentException |
if the given destination has no Intent |
popBackStack
open fun popBackStack(): Boolean
Attempt to pop this navigator's back stack, performing the appropriate navigation.
Implementations should return true if navigation was successful. Implementations should return false if navigation could not be performed, for example if the navigator's back stack was empty.
| Returns | |
|---|---|
Boolean |
|