The Android development team has announced the release of UI toolkit Jetpack Compose version 1.1. This release comes with several new features, such as improved focus handling, ImageVector caching, touch target sizing, and support for Android 12 stretch overscroll. Additionally, Compose 1.1 graduates several experimental APIs to stable as well as supports newer versions of Kotlin.
An image vector caching mechanism has been added to painterResource API in order to cache all instances of ImageVectors that are parsed with a certain resource id and theme. The cache will then be invalidated on configuration changes.
With touch target sizing, Material components will expand their layout space in order to meet Material accessibility guidelines. This works to align Compose Material to the same behavior of Material Design Components and brings consistency to behavior when mixing Views and Compose. This feature also works to ensure that minimum requirements for touch target accessibility will be met when creating a UI using Compose Material components.
In the event that a user finds that this change breaks existing layout logic, set LocalMinimumTouchTargetEnforcement to false and this behavior will be disabled. However, doing this could reduce the visibility of an application.
Among the APIs that graduated from experimental to stable with this release are:
- Animated related APIs like EnterTransition, ExitTransition, and some of the AnimatedVisibility APIs
- Vector related APIs such as rememberVectorPainter, VectorProperty, VectorConfig, and RenderVectorGroup
Compose 1.1 also brings new experimental APIs to Compose, adding several other new features, such as the ability to save and restore AnimatedContent when using rememberSaveable, animation of LazyColumn/LazyRow item positions using Modifier.animateItemPlacement(), and the use of the new BringIntoView API to send requests to patterns so that they scroll to bring an item into view.
“Jetpack Compose is stable, ready for production, and continues to add the features you’ve been asking us for. We’ve been thrilled to see tens of thousands of apps start using Jetpack Compose in production already and we can’t wait to see what you’ll build,” Florina Muntenescu, Android Developer Relations Engineer at Google, wrote in a post.