Android Studio Chipmunk Brings Animation Preview, CPU Profiler, and More

The latest release of Google’s IDE for Android app development, Android Studio Chipmunk, includes a new Compose animation previewer, a CPU profiler, and an extended build analyzer.

The new Compose Animation Preview aims to make it simpler for developers to create animation based on Jetpack Compose. Currently, it supports animations using AnimatedVisibilitywhich allows to control the appearance and disappearance of a composable, and updateTransition. updateTransition can be used to create transitions between given states modifying multiple properties at the same time, for example the opacity and size of a composable. Those are only two of many available animations, but Google says they will introduce support for more of them in the future.

Thanks to Animation Preview, developers can pause an animation, loop it, fast forward it, or slow it down. Additionally, you can inspect the current value of animated properties at any moment. To enable previewing a composable, you can use the @Preview annotation to wrap it into a new ad-hoc composable, as in the following example:


@Preview
@Composable
fun ComposablePreview() {
    MyComposable()
}

Android Studio Chipmunk also includes a new UI flicker detector to simplify troubleshooting UI problems such as slow rendering or animation skipping frames. The new flicker/jank detector exposes frame lifecycle information in system traces, showing which frames belong to each of a number of possible states, which can help you understand how long it took for the GPU and application to render a frame, and so on. UI jank analysis involves identifying which frames took longer to render to understand which factor may be causing it.

The build analyzer in Android Studio Chipmunk has been extended to identify those cases where all of your dependencies support AndroidX natively and you do not need to force their migration to AndroidX. This will typically reduce build times by 5-10%. According to Google, the vast majority of Android Studio projects still use the Jetifier flag although most libraries are already supporting AndroidX natively, thus making the forced migration step unnecessary.

As a last note, Android Studio Chipmunk also updates its underlying IntelliJ platform, adopting IntelliJ 2021.2, featuring a new project-wide analysis tool that tracks errors before compiling; new IDE actions such as reformatting code and optimizing imports; and a new package search utility.

.

Leave a Reply

%d bloggers like this: