Interface AngularNativeDestination
-
- All Implemented Interfaces:
-
io.github.angularwave.android.core.bridge.BridgeDestination
public interface AngularNativeDestination implements BridgeDestinationThe primary interface that a navigable Fragment implements to provide the library with the information it needs to properly navigate.
-
-
Method Summary
Modifier and Type Method Description abstract AngularNativeFragmentDelegatedelegate()Gets the delegate instance that handles the Fragment's lifecycle events. abstract ToolbartoolbarForNavigation()Returns the Toolbar used for navigation by the given view. BooleanshouldObserveTitleChanges()Specifies whether title changes should be automatically observed and update the title in the Toolbar provided from toolbarForNavigation(), if available. abstract UnitonBeforeNavigation()Called before any navigation action takes places. abstract Unitrefresh(Boolean displayProgress)Refresh the destination's contents. NavigatorcustomNavigatorForNavigation(String newLocation)Override if you're using a NestedNavigatorHostDelegate to provide sub-navigation within your current Fragment destination and would like custom behavior. Router.DecisioncustomRouteDecision(String newLocation)Override to provide a custom Router.Decisionfrom your destination.NavOptionscustomNavigationOptions(String newLocation, HashMap<String, Object> newPathProperties, VisitAction action)Override to provide a custom set of navigation options (basic enter/exit animations) for the Android Navigation component to use to execute a navigation event. ActivityResultLauncher<Intent>activityResultLauncher(Integer requestCode)Gets a registered ActivityResultContracts.StartActivityForResultactivity result launcher instance for the givenrequestCode.ActivityResultLauncher<String>activityPermissionResultLauncher(Integer requestCode)Gets a registered ActivityResultContracts.RequestPermissionactivity result launcher instance for the givenrequestCode.BooleanlaunchNativeActivity(Intent intent, Function2<Integer, Intent, Unit> result)Launches an activity result owned by this destination's native bridge. BooleanlaunchNativePermission(String permission, Function1<Boolean, Unit> result)Requests one runtime permission owned by this destination's native bridge. UnitcancelNativeActivity()Clears a pending native activity callback when its bridge request ends. UnitcancelNativePermission()Clears a pending native permission callback when its bridge request ends. abstract UnitprepareNavigation(Function0<Unit> onReady)BooleanbridgeWebViewIsReady()abstract NavigatorgetNavigator()Gets the navigator instance associated with this destination. FragmentgetFragment()Gets the fragment instance for this destination. StringgetLocation()Gets the location for this destination. HashMap<String, Object>getPathProperties()Gets the path configuration properties for the location associated with this destination. AngularNativeFragmentViewModelgetFragmentViewModel()Gets the AngularNativeFragmentViewModel associated with this destination. BooleanisActive()Specifies whether the destination fragment is currently active and added to its parent activity. BooleanisModal()Specifies whether the destination was presented in a modal context. -
-
Method Detail
-
delegate
abstract AngularNativeFragmentDelegate delegate()
Gets the delegate instance that handles the Fragment's lifecycle events.
-
toolbarForNavigation
abstract Toolbar toolbarForNavigation()
Returns the Toolbar used for navigation by the given view.
-
shouldObserveTitleChanges
Boolean shouldObserveTitleChanges()
Specifies whether title changes should be automatically observed and update the title in the Toolbar provided from toolbarForNavigation(), if available. Default is true.
-
onBeforeNavigation
abstract Unit onBeforeNavigation()
Called before any navigation action takes places. This is a useful place for state cleanup in your Fragment if necessary.
-
refresh
abstract Unit refresh(Boolean displayProgress)
Refresh the destination's contents.
- Parameters:
displayProgress- Whether progress should be displayed while refreshing.
-
customNavigatorForNavigation
Navigator customNavigatorForNavigation(String newLocation)
Override if you're using a NestedNavigatorHostDelegate to provide sub-navigation within your current Fragment destination and would like custom behavior.
Return
nullto use the defaultnavigatorinstance for navigation.
-
customRouteDecision
Router.Decision customRouteDecision(String newLocation)
Override to provide a custom
Router.Decisionfrom your destination. By default, the registered Router.RouteDecisionHandler instances are used to determine routing logic. It's recommend to use dedicated Router.RouteDecisionHandler instances for routing logic.Return
nullto use the global Router.RouteDecisionHandler instances to determine routing logic.
-
customNavigationOptions
NavOptions customNavigationOptions(String newLocation, HashMap<String, Object> newPathProperties, VisitAction action)
Override to provide a custom set of navigation options (basic enter/exit animations) for the Android Navigation component to use to execute a navigation event.
Return
nullto use the library's default destination animations.
-
activityResultLauncher
ActivityResultLauncher<Intent> activityResultLauncher(Integer requestCode)
Gets a registered
ActivityResultContracts.StartActivityForResultactivity result launcher instance for the givenrequestCode.Override to provide your own androidx.activity.result.ActivityResultLauncher instances. If your app doesn't have a matching
requestCode, you must callsuper.activityResultLauncher(requestCode)to give the library an opportunity to provide a matching result launcher.- Parameters:
requestCode- The request code for the corresponding result launcher.
-
activityPermissionResultLauncher
ActivityResultLauncher<String> activityPermissionResultLauncher(Integer requestCode)
Gets a registered
ActivityResultContracts.RequestPermissionactivity result launcher instance for the givenrequestCode.Override to provide your own androidx.activity.result.ActivityResultLauncher instances. If your app doesn't have a matching
requestCode, you must callsuper.activityPermissionResultLauncher(requestCode)to give the library an opportunity to provide a matching result launcher.- Parameters:
requestCode- The request code for the corresponding result launcher.
-
launchNativeActivity
Boolean launchNativeActivity(Intent intent, Function2<Integer, Intent, Unit> result)
Launches an activity result owned by this destination's native bridge.
-
launchNativePermission
Boolean launchNativePermission(String permission, Function1<Boolean, Unit> result)
Requests one runtime permission owned by this destination's native bridge.
-
cancelNativeActivity
Unit cancelNativeActivity()
Clears a pending native activity callback when its bridge request ends.
-
cancelNativePermission
Unit cancelNativePermission()
Clears a pending native permission callback when its bridge request ends.
-
prepareNavigation
abstract Unit prepareNavigation(Function0<Unit> onReady)
-
bridgeWebViewIsReady
Boolean bridgeWebViewIsReady()
-
getNavigator
abstract Navigator getNavigator()
Gets the navigator instance associated with this destination.
-
getFragment
Fragment getFragment()
Gets the fragment instance for this destination.
-
getLocation
String getLocation()
Gets the location for this destination.
-
getPathProperties
HashMap<String, Object> getPathProperties()
Gets the path configuration properties for the location associated with this destination.
-
getFragmentViewModel
AngularNativeFragmentViewModel getFragmentViewModel()
Gets the AngularNativeFragmentViewModel associated with this destination.
-
isActive
Boolean isActive()
Specifies whether the destination fragment is currently active and added to its parent activity.
-
-
-
-