Navigation

Ashera supports navigation between fragments. NavController class is provided in javascript which is proxy of NavController class in android and NavController functionality is simulated in other platforms. nav_graph.xml is used for declaring fragments and connecting the fragment to the layout. nav_graph.xml gives a visual flow of your application. Please note that there can be only one nav_graph.xml in Ashera.

Child Fragment

Ashera supports child fragments. You can embed fragment of type "androidx.navigation.fragment.NavHostFragment" and associate it with navigation graph xml to achieve navigation for portion of a screen. This is very useful in scenarios where the app has a fixed bottom tab bar and each of the menu in the tab bar is associated with a different flow.

Example of child navigation is shown below:

Ashera also supports fragment of type "com.ashera.core.GenericFragment". The layout attribute can be specified to display the xml and replace method on the fragment can be used to replace the current layout being displayed.

Example of simple fragment embedding is shown below: