transitionTo

abstract fun transitionTo(targetState: ViewportState, transition: ViewportTransition? = null, completionListener: CompletionListener? = null)

Executes a transition to requested state.

When called, the status goes to ViewportTransition and to the final ViewportState when ended.

Transitioning to state 'x' when the current status is 'ViewportStatus.State(x)' invokes completionListener synchronously with true and does not modify ViewportPlugin.status.

Transitioning to state 'x' when the current status is 'ViewportStatus.Transition(_, x)' invokes completionListener synchronously with false and does not modify ViewportPlugin.status.

If transition is failed or canceled, status goes to ViewportStatus.Idle.

Parameters

targetState

The target ViewportState to transition to.

transition

The ViewportTransition that's used to transition to target state, if not specified, the ViewportPlugin.defaultTransition will be used. Defaults to null.

completionListener

The listener that's invoked when the transition ends, defaults to null.