Author/Android developer relations Engineer Florina Muntenescu
As always, we’ve built our product roadmap and have now released version 1.1 of Jetpack Compose, a modern native interface toolkit for Android. This release adds features such as optimized focus handling, touch target values, ImageVector caching, and support for Android 12 stretch and scroll. Compose 1.1 also stabilised many of the previously experimental apis and supports a new version of Kotlin. We have updated the sample, Codelab and CSIST development libraries for you to use with Compose 1.1.
New stabilization features and apis
Image vector cache
Compose 1.1 introduces the Image vector cache, which brings significant performance improvements. We added a caching mechanism to the painterResource API to cache all instances of ImageVectors resolved with a given resource ID and topic. The cache will be invalidated when the configuration changes.
Touch the target value
Relative to Compose 1.0, the Material component expands its layout space to meet the Material Accessibility guide’s touch target value requirements. For example, even if you lower the RadioButton’s size, the RadioButton’s touch target will expand to at least 48x48DP. This will align the behavior of the Compose Material with that of the Material Design component to provide consistent behavior when mixing views and Compose. This change also ensures that minimum accessibility requirements for touch targets are met when you create an interface using the Compose Material component.
If you find this change destroys the existing logical layout, please send LocalMinimumTouchTargetEnforcement set to false to disable this behavior, but this may reduce the availability of the application, so need your special attention, and carefully use.
△ RadioButton touch target for Compose 1.0, for Compose 1.1
API from experimental to stable
Some apis have transitioned from experimental to stable versions. Mainly include:
- Animation apis, such as EnterTransition, ExitTransition, and some AnimatedVisibility apis
- Vector related apis: rememberVectorPainter, VectorProperty, VectorConfig and RenderVectorGroup
New experimental API
We’ve been adding new features to Compose, including the following highlights:
- You are using
rememberSaveable
At the same time, can be saved and restoredAnimatedContent
. - You can useModifier.animateItemPlacement() 为
LazyColumn/LazyRow
Animate the project location. - You can use brand new
BringIntoView
The API sends a request to the parent for the parent to scroll and bring the item into the view.
You can use @optin to try out these new apis and give us feedback!
Note: Kotlin 1.6.10 is required to use Compose 1.1. For more information, check out Compose’s compatibility correspondence with Kotlin.
Want to know your future plans? You can check out the latest roadmap to see what features we are currently evaluating and developing, such as lazy-loading project animations, downloadable fonts, mobile content, and more!
Jetpack Compose is now available in a stable version for use in production environments and will continue to add the features you want. We’re excited to see thousands of applications already using Jetpack Compose in production, and we can’t wait to see what you’ll build!
We appreciate the bug reports and feature requests that developers submitted through the issue tracker page during Alpha and Beta that helped us improve Compose and build the API you needed. You’re welcome to continue sharing your feedback with us and help us make Compose even better! You are also welcome to continue to follow the “Android Developer “wechat official account to learn more about the latest content.
Please click here to submit your feedback to us, or share your favorite content or questions. Your feedback is very important to us, thank you for your support!