Posted by Florina Muntenescu, Android Developer Relations Engineer
As we speak, we’re releasing model 1.1 of Jetpack Compose, Android’s trendy, native UI toolkit, persevering with to construct out our roadmap. This launch comprises new options like improved focus dealing with, contact goal sizing,
ImageVector caching, and assist for Android 12 stretch overscroll. Compose 1.1 additionally graduates a lot of beforehand experimental APIs to steady and helps newer variations of Kotlin. We have already up to date our samples, codelabs, and Accompanist library to work with Compose 1.1.
New steady options and APIs
Picture vector caching
Compose 1.1 introduces picture vector caching bringing massive efficiency enhancements. We’ve added a caching mechanism to
painterResource API to cache all cases of
ImageVectors which can be parsed with a given useful resource id and theme. The cache can be invalidated on configuration adjustments.
Contact goal sizing
With respect to Compose 1.0, Materials parts will develop their structure area to fulfill Materials accessibility pointers contact goal dimension. As an illustration, a
RadioButton's contact goal will develop to a minimal dimension of 48x48dp, even in case you set the
RadioButton‘s dimension to be smaller. This aligns Compose Materials to the identical conduct of Materials Design Elements, offering constant conduct in case you combine Views and Compose. This alteration additionally ensures that if you create your UI utilizing Compose Materials parts, minimal necessities for contact goal accessibility can be met.
In case you discover this variation breaks present structure logic, set
false to disable this conduct, however please be aware this would possibly cut back the usability of your app, and must be used with warning.
RadioButton contact goal replace
Left: Compose 1.0, proper: Compose 1.1
Experimental to steady APIs
A number of APIs graduated from experimental to steady. Highlights embody:
New experimental APIs
We’re persevering with to carry new options to Compose. Listed below are a couple of highlights:
AnimatedContentcan now be saved and restored when utilizing
LazyColumn/LazyRowmerchandise positions might be animated utilizing
- You should use the brand new
BringIntoViewAPI to ship a request to folks in order that they scroll to carry an merchandise into view.
Check out the brand new APIs utilizing
@OptIn and provides us suggestions!
Observe: Utilizing Compose 1.1 requires utilizing Kotlin 1.6.10. Try the Compose to Kotlin Compatibility Map for extra data.
Questioning what’s subsequent? Try our up to date roadmap to see the options we’re at present fascinated by and dealing on, reminiscent of lazy merchandise animations, downloadable fonts, moveable content material, and extra!
Jetpack Compose is steady, prepared for manufacturing, and continues so as to add the options you’ve been asking us for. We’ve been thrilled to see tens of hundreds of apps begin utilizing Jetpack Compose in manufacturing already and we will’t wait to see what you’ll construct!
We’re grateful for the entire bug studies and have requests submitted to our situation tracker over the Alphas and Betas – they assist us to enhance Compose and construct the APIs you want. Do proceed offering your suggestions and assist us make Compose higher!