Interactivity powered by state machines
Interactivity is currently in it’s early stages of developement and not production ready. Please be aware that this API will change. If your state machine is not working as expected please create an issue on Github.
Creation
Learn how to create dotLotties with state machines here.
Usage
The following example demonstrates how to use a state machine with a Lottie animation in a Composable function. The state machine is controlled by a DotLottieController, which is used to load the state machine, start and stop it, and post events to it. The controller also provides a listener for state machine events.
Exploding Pigeon example
Exploding Pigeon state machine
How it works
- The state machine has three states:
pigeon
,explosion
, andfeathers
. - The state machine starts in the
pigeon
state. - When the
explosion
event is posted to the state machine, it transitions to theexplosion
state. - When the
explosion
state completes, it transitions to thefeathers
state. - When the
feathers
state completes, it transitions back to thepigeon
state.