Jetpack Compose 1.2 packs text improvements

Google toolkit for building native Android UIs toolkit enables more precise text alignment with font padding, introduces downloadable fonts API.

Jetpack Compose 1.2 packs text improvements
Jenu Prasad / Google (CC0)

Jetpack Compose 1.2, Google’s toolkit for building native Android UIs, is now generally available. Highlights of the update include text improvements such as font padding and downloadable fonts.

Jetpack Compose is the Google-recommended way to build new Android apps for phones, tablets, and foldables. The 1.2 release was declared stable on July 27.

With downloadable fonts, app developers gain new APIs to access Google Fonts asynchronously and to define fallback fonts without a complex setup. Benefits include smaller APK sizes and improved system health, Google said, because multiple apps can share the same font through a provider.

Addressing a top-voted bug in the Android issue tracker, Jetpack Compose 1.2 makes includeFontPadding a customizable parameter. Google recommends setting this value to false, which will enable more precise alignment of text within layouts. The plan is to make false the default value in a future release.

Jetpack Compose 1.2 can be accessed from the Android developers website. The Jetpack Compose 1.0 production release was published last July.

Other improvements in Jetpack Compose 1.2 include:

  • For lazy layouts, grid APIs LazyVerticalGrid and LazyHorizontalGrid have graduated out of experimental status. A new experimental API, LazyLayout, lets developers implement custom layouts.
  • A WindowInsets class provides modifiers such as windowInsetsPadding, systemBarsPadding, and windowInsetsTopHeight to deal with insets of a device.
  • Modifer.nestedScroll offers nested scroll interoperability with views.
  • Easing curves help write animations efficiently.
  • Mouse support has been improved.
  • Bugs have been fixed such as allowing animations to follow the system-defined “Animation duration scale” and allowing scolling of lazy laouts to be disabled by adding a userScrollEnabled parameter.
  • Compose for the Wear OS 1.0 smartwatch platform is now generally available.

Copyright © 2022 IDG Communications, Inc.