Newsletter Issue #202

Published: 2024-02-13

We got a new Compiler, a new BOM, and new Glance artifacts — so we take a peek at them!

We also examine the latest Compose Material3, blend Circuit with Compose Multiplatform, and play with robots. We also render some Markdown, almost like how this newsletter gets published.

Ooooo… What Did We Get?

Reviewing the release notes for the latest Jetpack Compose update!

The Compose BOM is up to 2024.02.00, corresponding to the 1.6.1 patch release of most artifacts. 1.6.1 consists mostly of bug fixes, befitting a patch release.

We also got a 1.7.0-alpha02 release of the most artifacts. This too seems to be mostly bug fixes and promotion of experimental APIs to stable status. It also adds a new LocalLinkTextStyle composition local for styles associated with links in text.

Compose Compiler is up to 1.5.9 with a few bug fixes.

Glance has a new 1.1.0-alpha01 release, with quite a few changes. Of particular note are new artifacts focused on unit testing and previews, to build up the infrastructure around Glance-powered app widgets.

Wear Compose has a 1.4.0-alpha02 release, with bug fixes.

In addition, the following Compose-adjacent updates are available:

  • androidx.activity:activity-compose:1.9.0-alpha03
  • androidx.fragment:fragment-compose:1.7.0-alpha10
  • androidx.hilt:hilt-navigation-compose:1.2.0-rc01
  • androidx.navigation:navigation-compose:2.7.7
  • androidx.navigation:navigation-compose:2.8.0-alpha02
  • androidx.paging:paging-compose:3.3.0-alpha03
  • androidx.paging:paging-compose-android:3.3.0-alpha03

One Off the Stack, One Off the Slack

You’ve got questions. That’s understandable!

How Can I Control Multiple Animations?

Sometimes, we want to animate several disparate elements. To keep them in sync, it would be good to have a “single source of truth” for how far in the animation we are. To that end, Compose offers a family of lerp() functions for various types, as we see in this week’s highlighted Stack Overflow question.

How Can We Auto-Size Text?

A significant missing piece of Compose UI is an official way to auto-size text. This is not a simple problem to solve, especially if you are trying to not skip frames. See a few possible approaches for this in this week’s highlighted Kotlinlang #compose Slack thread.

Composable Commentary

Posts, videos, and other new information related to Jetpack Compose!

Material Design 3 for Compose 1.2

James Williams looks at what changed in Compose Material3 version 1.2.0: new composables, newly-stable APIs, and more!

Compose Multiplatform Made easy with Circuit

Eric Ampire reviews Circuit, a Slack library that provides an MVI-esque framework for Kotlin apps, powered by the Compose engine. Eric looks at how Circuit can help implement a Compose Multiplatform app, including navigation between screens.

Medium: Making Your Android App Accessible: Semantic Properties and Screen Orientation

Karol Wrótniak explores the world of semantic properties in Compose UI, to help guide TalkBack and other accessibility services. This includes liveRegion (changes get announced even if the composable is not focused), heading() (to denote a composable that represents a heading), and error() (to denote a composable that contains error information).

Medium: End-To-End Testing With Robot Pattern And Jetpack Compose

Tomáš Repčík reviews the robot testing pattern, where each screen gets a “robot” class that exposes functions that mimic user behavior: filling in fields, clicking buttons, etc. The robot can also package up common assertions that might be used by multiple tests. Tests then employ an instance of the robot, leading to more readable test code.

Medium: Transforming Android XML Vector drawables into Compose Multiplatform ImageVectors

Sergio Belda reviews the Compose Vectorize library that allows Compose Multiplatform projects to better utilize Android’s vector drawables, courtesy of a compiler plugin.

Medium: Custom Theming in Android Jetpack Compose

Diego Ramírez examines how you can add custom categories of values, such as dimensions, to a MaterialTheme, by means of a custom composition local.

Introducing ComposeRecyclerView

The Canopas team walks us through their ComposeRecylerView library, which simplifies using composables for items in a RecyclerView. In addition for possible uses during migration from views to composables, RecyclerView has better-understood performance characteristics and may help with lazy containers under-perform.

Medium: Crafting Typewrite Text Animation & Custom Quote Card with Jetpack Compose

Medium user Kappdev explains how to create a “typed text” animation, where text appears one character at a time, as if somebody was typing it in. The resulting TypewriteText() composable can then be used like Text(), including being wrapped in stylized containers, such as a QuoteCard().

Jetpack Compose: Divider

Alex Zhukovich explores the humble divider, including the differences between the Material Divider() and the Material3 HorizontalDivider() and VerticalDivider() and how to implement a totally custom divider.

Resource Roundup

100% pure code!

GitHub: baec23 / ludwig

Changmin Bae published a set of libraries with a variety of composables, from an AnimatedVector() that morphs between vectors, time and date pickers, fades for scrollable containers, and more.

GitHub: ilyasipek / easy-mvi

ilyas ipek brings us an MVI implementation for Compose UI, powered by an mvi() delegate for your viewmodel that handles reducing your custom state based upon your custom actions.

GitHub: mikepenz / multiplatform-markdown-renderer

Mike Penz created a Markdown renderer for Compose Multiplatform, including support for custom styles, custom list bullets and order labels, and more.

GitHub: Varsha-Kulkarni / scrollablebarchart-compose

Varsha Kulkarni offers us LTRScrollableBarChart() and RTLScrollableBarChart() composables that render a classic bar chart in a horizontally-scrolling container.

Notable Releases

JetBrains published 1.6.0-beta02 of Compose Multiplatform. iOS targets now have basic accessibility support plus double- and triple-tap support for Text() composables.

Saket Narayan updated the swipe library to 1.3.0. This adds Compose Multiplatform support to the swipe composable framework.