Exercise
When adding animations to your app, you should make sure that they behave the way you want them to. Android Studio allows you to examine every frame of an animation in the Animation Preview. If a composable function with animations can be inspected using the Animation Preview, you will spot an icon labeled Start Animation Preview (Figure 8.4). Which APIs are supported depends on your Android Studio version.
Figure 8.4 – Launching the Animation Preview
Let’s try this cool feature. Please open the CrossfadeAnimationDemo()
composable in the Animation Preview (Figure 8.5)
Figure 8.5 – Animation Preview showing CrossfadeAnimationDemo()
You can then inspect every frame by moving the handle in the timeline, change the animation parameters (which become visible after unfolding the corresponding animation), and start and stop all animations at once.