UIStateUIHandler

In package com.nhaarman.acorn.android.uistate

class com.nhaarman.acorn.android.uistate.UIStateUIHandler

A UIHandler that utilizes the UIState state machine to handle the UI.

Methods

fun onUIVisible()

Denotes that the UI window becomes visible to the user, for example when the Activity enters its 'started' state.

Parameters:
  • No parameters
fun onUINotVisible()

Denotes that the UI window becomes invisible to the user, for example when the Activity enters its 'stopped' state.

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 withScene(scene: Scene, viewControllerFactory: ViewControllerFactory, data: TransitionData?)

Applies given scene to the UI.

Depending on the current internal state the Scene change may occur directly or be scheduled, for example when a transition animation is running.

Parameters:
  • scene: Scene

    The new Scene to apply.

  • viewControllerFactory: ViewControllerFactory

    The ViewControllerFactory that can provide the ViewController for given scene.

  • data: TransitionData?

    Any TransitionData to be used for transitions.

fun withoutScene()

Indicates that there is no local Scene currently active.

Parameters:
  • No parameters