Paul Krill
Editor at Large

Jetpack Compose 1.2 packs text improvements

news
Jul 28, 20222 mins

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

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 <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/package-summary#LazyVerticalGrid(androidx.compose.foundation.lazy.grid.GridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.grid.LazyGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,kotlin.Function1)" rel="nofollow">LazyVerticalGrid</a> and <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/grid/package-summary#LazyHorizontalGrid(androidx.compose.foundation.lazy.grid.GridCells,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.grid.LazyGridState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Horizontal,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,kotlin.Function1)" rel="nofollow">LazyHorizontalGrid</a> have graduated out of experimental status. A new experimental API, <a href="https://developer.android.com/reference/kotlin/androidx/compose/foundation/lazy/layout/package-summary?hl=en#LazyLayout(androidx.compose.foundation.lazy.layout.LazyLayoutItemsProvider,androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.layout.LazyLayoutPrefetchState,kotlin.Function2)" rel="nofollow">LazyLayout</a>, 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.
Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author