AcornSceneDispatcher

In package com.nhaarman.acorn.android.dispatching

class com.nhaarman.acorn.android.dispatching.AcornSceneDispatcher

A default SceneDispatcher implementation that utilizes a UIHandler and an ActivityHandler to dispatch Scenes.

Methods

fun dispatchScenesFor(navigator: Navigator): DisposableHandle

Starts dispatching the Scene instances for given navigator.

By disposing the resulting DisposableHandle one can stop the dispatching.

Parameters:
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
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
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
fun onActivityResult(resultCode: Int, data: ?)

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

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

Saves any state for this SceneDispatcher.

Parameters:
  • No parameters