NavigatorProvider

In package com.nhaarman.acorn.android.navigation

class com.nhaarman.acorn.android.navigation.NavigatorProvider

An interface that provides a Navigator instance to be used in the Activity.

Implementations generally need to cache a created Navigator to deliver the same instance to multiple Activities.

Methods

abstract fun navigatorFor(savedState: NavigatorState?): Navigator

Returns the Navigator instance to work with. If one needs to be created, given savedState can be used to restore any state, if applicable.

Parameters:
  • savedState: NavigatorState?

    If not null, the saved state for the Navigator as returned by saveNavigatorState.

abstract fun newInstance(savedState: NavigatorState?): Navigator

Unlike navigatorFor, this function should always return a new Navigator instance.

Parameters:
  • savedState: NavigatorState?

    If not null, the saved state for the Navigator as returned by saveNavigatorState.

abstract fun saveNavigatorState(): NavigatorState?

Returns the saved state for the Navigator as returned by navigatorFor. Implementations can add extra data to the resulting state to suit their needs.

Parameters:
  • No parameters