arch-android

//Android/br.com.arch.toolkit.android.statemachine/ViewStateMachine

ViewStateMachine

[android]
class ViewStateMachine : StateMachine<ViewStateMachine.State>

Implementation of StateMachine This implementation uses View Visibility to make State transitions

Constructors

   
ViewStateMachine [android]
constructor()

Types

Name Summary
State [android]
class State : StateMachine.State
Represents a single state in a ViewStateMachine.

Properties

Name Summary
config [android]
val config: StateMachine.Config
The configuration for this state machine.
isStarted [android]
var isStarted: Boolean
Indicates whether the machine has been started.

Functions

Name Summary
addState [android]
fun addState(key: Int, state: ViewStateMachine.State): StateMachine<ViewStateMachine.State>
Adds a new state to the machine.
changeState [android]
fun changeState(stateKey: Int, forceChange: Boolean = false, onChangeState: (Int) -> Unit? = config.onChangeState)
Changes the current state of the machine.
config [android]
inline fun config(configuration: StateMachine.Config.() -> Unit)
Provides a DSL-like way to configure the StateMachine.Config.
getCurrentStateKey [android]
fun getCurrentStateKey(): Int
Returns the key of the current state.
newStateInstance [android]
open override fun newStateInstance(): ViewStateMachine.State
Creates a new instance of the specific state type.
restoreInstanceState [android]
fun restoreInstanceState(savedInstanceState: ERROR CLASS: Symbol not found for Bundle??): StateMachine<ViewStateMachine.State>
Restores the state of the machine from a Bundle.
saveInstanceState [android]
fun saveInstanceState(): android/os/Bundle
Saves the current state of the machine into a Bundle.
setup [android]
inline fun setup(func: StateMachine<ViewStateMachine.State>.() -> Unit)
Configures and starts the StateMachine.
shutdown [android]
fun shutdown()
Shuts down the state machine, clearing states and resetting configuration.
start [android]
fun start()
Starts the state machine. This must be called after all states are added and initial configuration is set.
state [android]
inline fun state(key: Int, stateConfig: ViewStateMachine.State.() -> Unit): StateMachine<ViewStateMachine.State>
Adds a new state to the StateMachine using a DSL-like syntax.