SceneDispatcher

In package com.nhaarman.acorn.android.dispatching

class com.nhaarman.acorn.android.dispatching.SceneDispatcher

A SceneDispatcher is responsible for bridging between Activity instances and the Navigator, handling changes of Scene instances, and ensuring the UI is properly updated.

Methods

abstract fun dispatchScenesFor(navigator: Navigator): DisposableHandle

Starts dispatching the Scene instances for given navigator.

By disposing the resulting DisposableHandle one can stop the dispatching.

Parameters:
abstract fun onUIVisible()

To be invoked when the application's UI becomes visible to the user. A good place to invoke this would be in Activity.onStart.

Parameters:
  • No parameters
abstract fun onUINotVisible()

To be invoked when the application's UI becomes invisible to the user. A good place to invoke this would be in Activity.onStop.

Parameters:
  • No parameters
abstract fun onBackPressed(): Boolean

Invoked when the user presses the back button.

Implementations can consume the event by returning true and stop further propagation of the event.

Parameters:
  • No parameters
abstract fun onActivityResult(resultCode: Int, data: ?)

To be invoked when the Activity receives an invocation to its Activity.onActivityResult method.

Parameters:
  • resultCode: Int
  • data: ?
abstract fun saveInstanceState(): SavedState

Saves any state for this SceneDispatcher.

Parameters:
  • No parameters