### Choreograph Complex Nested Animation Source: https://github.com/sagar-viradiya/koreography/blob/main/README.md Create a complex animation with a nested hierarchy. This example demonstrates parallel animations, with one of them containing sequential animations. ```kotlin val alphaAnimatable = remember { Animatable(0f) } val scaleAnimatable = remember { Animatable(0f) } val rotationAnimatable = remember { Animatable(0f) } val translationXAnimatable = remember { Animatble(0f) } val koreography = rememberKoreography { parallelMoves { move( animatable = alphaAnimatable, targetValue = 1f, animationSpec = tween(500) ) move( animatable = scaleAnimatable, targetValue = 2f, animationSpec = tween(500) ) sequentialMoves { move( animatable = rotationAnimatable, targetValue = 20f, animationSpec = tween(500) ) move( animatable = translationXAnimatable, targetValue = 200f, animationSpec = tween(500) ) } } } ``` -------------------------------- ### Launch Choreography on State Change Source: https://github.com/sagar-viradiya/koreography/blob/main/README.md Execute choreography sequentially based on state changes, similar to `LaunchedEffect`. Requires `Animatable` instances for animations. ```kotlin val alphaAnimatable = remember { Animatable(0f) } val scaleAnimatable = remember { Animatable(0f) } LaunchKoreography(state) { move( animatbale = alphaAnimatable, targetValue = 1f, animationSpec = tween(500) ) move( animatbale = scaleAnimatable, targetValue = 2f, animationSpec = tween(500) ) } ``` ```kotlin Image( modifier = Modifier.graphicsLayer { alpha = alphaAnimatable.value scaleX = scaleAnimatable.value }, painter = painterResource(id = R.drawable.image) ) ``` -------------------------------- ### Add Koreography Dependency Source: https://github.com/sagar-viradiya/koreography/blob/main/README.md Include the Koreography library in your project by adding the following dependency to your `build.gradle` file. Ensure you are using `mavenCentral()` repository. ```groovy implementation 'io.github.sagar-viradiya:koreography:0.3.0' ``` -------------------------------- ### Execute Choreography Once Source: https://github.com/sagar-viradiya/koreography/blob/main/README.md Run the defined choreography once. The `dance` function takes a `coroutineScope` and an optional callback for when the dance finishes. ```kotlin koreography.dance(scope = coroutineScope) { // onDanceFinished : Optional trailing lambda } ``` -------------------------------- ### Repeat Dance Choreography Source: https://github.com/sagar-viradiya/koreography/blob/main/README.md Execute a choreography a specified number of times. The `coroutineScope` is required for execution. ```kotlin koreography.repeatDance(count = 3, scope = coroutineScope) { // onDanceFinished : Optional trailing lambda } ``` -------------------------------- ### Infinite Dance Choreography Source: https://github.com/sagar-viradiya/koreography/blob/main/README.md Execute a choreography indefinitely until the composition is no longer active. Requires a `coroutineScope`. ```kotlin koreography.danceForever(scope = coroutineScope){ // onDanceFinished : Optional trailing lambda } ``` -------------------------------- ### Choreograph Sequential Animation Source: https://github.com/sagar-viradiya/koreography/blob/main/README.md Define a sequential animation where alpha is animated first, followed by scale. This snippet demonstrates how to use `rememberKoreography` with sequential `move` operations. ```kotlin val alphaAnimatable = remember { Animatable(0f) } val scaleAnimatable = remember { Animatable(0f) } val koreography = rememberKoreography { move( animatable = alphaAnimatable, targetValue = 1f, animationSpec = tween(500) ) move( animatable = scaleAnimatable, targetValue = 2f, animationSpec = tween(500) ) } ``` -------------------------------- ### Choreograph Parallel Animation Source: https://github.com/sagar-viradiya/koreography/blob/main/README.md Define a parallel animation where alpha and scale are animated simultaneously. This snippet shows how to group animations using `parallelMoves`. ```kotlin val alphaAnimatable = remember { Animatable(0f) } val scaleAnimatable = remember { Animatable(0f) } val koreography = rememberKoreography { parallelMoves { move( animatable = alphaAnimatable, targetValue = 1f, animationSpec = tween(500) ) move( animatable = scaleAnimatable, targetValue = 2f, animationSpec = tween(500) ) } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.