HomeMobileJetpack Compose 1.1 is now secure!

Jetpack Compose 1.1 is now secure!



Posted by Florina Muntenescu, Android Developer Relations Engineer

Blue background with phone icon

At the moment, we’re releasing model 1.1 of Jetpack Compose, Android’s fashionable, 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 help for Android 12 stretch overscroll. Compose 1.1 additionally graduates various beforehand experimental APIs to secure 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 secure 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 situations of ImageVectors which might be parsed with a given useful resource id and theme. The cache shall be invalidated on configuration modifications.

Contact goal sizing

With respect to Compose 1.0, Materials elements will increase their format area to fulfill Materials accessibility tips contact goal measurement. As an example, a RadioButton's contact goal will increase to a minimal measurement of 48x48dp, even in case you set the RadioButton‘s measurement to be smaller. This aligns Compose Materials to the identical habits of Materials Design Elements, offering constant habits in case you combine Views and Compose. This variation additionally ensures that while you create your UI utilizing Compose Materials elements, minimal necessities for contact goal accessibility shall be met.

In the event you discover this modification breaks present format logic, set LocalMinimumTouchTargetEnforcement to false to disable this habits, however please be aware this would possibly cut back the usability of your app, and must be used with warning.

RadioButton touch target update 
Left: Compose 1.0, right: Compose 1.1 
 

RadioButton contact goal replace
Left: Compose 1.0, proper: Compose 1.1

Experimental to secure APIs

A number of APIs graduated from experimental to secure. Highlights embrace:

New experimental APIs

We’re persevering with to convey new options to Compose. Listed below are a number of highlights:

  • AnimatedContent can now be saved and restored when utilizing rememberSaveable.
  • LazyColumn/LazyRow merchandise positions could be animated utilizing Modifier.animateItemPlacement().
  • You should use the brand new BringIntoView API to ship a request to oldsters in order that they scroll to convey an merchandise into view.

Check out the brand new APIs utilizing @OptIn and provides us suggestions!

Word: Utilizing Compose 1.1 requires utilizing Kotlin 1.6.10. Try the Compose to Kotlin Compatibility Map for extra info.

Questioning what’s subsequent? Try our up to date roadmap to see the options we’re at the moment serious about and dealing on, corresponding to lazy merchandise animations, downloadable fonts, moveable content material, and extra!

Jetpack Compose is secure, 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 are able to’t wait to see what you’ll construct!

We’re grateful for the entire bug experiences and have requests submitted to our subject 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!

Joyful composing!



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments