Set of methods for navigating between screens. Each set of files (jsx and js) in the view folder generates a screen. It is possible to navigate through these screens using the methods described here.

Hierarchy

  • Navigation

Methods

  • Adds a back handler to intercept user back navigation.

    The backHandler pool is a stack with bubbling propagation support.

    All handlers are cleared during navigation using the navigate method.

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    Returns void

  • Performs a navigation back to one or several previous screens

    Example:

    Eitri.navigation.back()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    • steps: number

      Number of screens to go back (optional)

    Returns void

  • Performs navigation back to the first screen in the navigation stack

    Example:

    Eitri.navigation.backToTop()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns void

  • Remove all back handlers.

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Returns void

  • Stop onResume listeners from running in background.

    Compatibility Control

    • API LEVEL 6 - Functionality added

    Returns Promise<void>

  • Closes the current eitri-app

    Example:

    Eitri.navigation.close()
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    Returns Promise<void>

  • Navigates to another screen contained in the views folder

    Examples:

    Simple navigation to a View in the folder:

    Eitri.navigation.navigate({path: '/AnotherView'})
    

    Navigation passing a state object from one view to another:

    Eitri.navigation.navigate({path: '/AnotherView', state: { name: 'Pedro Álvares Cabral' }})
    

    Use replace = true to indicate that the view will be replaced by the next one:

    Eitri.navigation.navigate({path: '/AnotherView', replace: true})
    

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    Returns Promise<void>

  • Opens an eitri-app

    Example:

    Eitri.navigation.open({
    slug: 'checkout',
    initParams: {item: 'Refrigerator', id: 999987},
    restorationContext: {screen: 'categories/appliances'}
    })

    Compatibility Control

    • API LEVEL 1 - Functionality added

    Parameters

    Returns Promise<void>

  • Creates a listener to receive events when your eitri-app returns to user's attention from certain situations.

    This event will be triggered when:

    1 - You return from another app or the home screen.

    2 - The app uses a setup with multiple eitri-machines. When the top eitri-machine is stopped, the current eitri-app of the previous eitri-machine in the stack will be notified.

    3 - Apps using EitriBottomTabView switch tabs

    It won't be fired when transitioning between eitri-apps using Eitri.navigation.open() or Eitri.navigation.close()

    Example:

    Eitri.navigation.setOnResumeListener(() => { console.log("eitri-app was resumed") })
    

    Compatibility Control

    • API LEVEL 6 - Functionality added
    • API LEVEL 14 - EitriBottomTabView full compatibility

    Parameters

    • callback: (() => void)
        • (): void
        • Returns void

    Returns Promise<void>

Generated using TypeDoc