jetc.dev Newsletter Issue #254

Published: 2025-02-18

We got another Compose update, and a Compose Multiplatform update, so let’s unpack them!

After that, we try to get some focus, cast about for a lost Fleet, and play with an accordion. We look at code for hints, timelines, and idle users. Plus, we get a bit metal.

Ooooo… What Did We Get?

Reviewing the release notes for the latest Jetpack Compose update!

Google released the 2025.02.00 versions of the three Compose BOMs. The stable BOM points to 1.7.8 of the main Compose libraries, which, as usual, contain a few bug fixes, notably a crash in BasicTextField().

The beta BOM points to 1.8.0-beta02 of the main Compose libraries, which also contain some bug fixes. There are few enough of those that my guess is that we will move to an RC for 1.8.0 very soon.

Compose Material3 has a 1.4.0-alpha08 release, with a bunch of new search bar APIs, a TimePickerDialog(), and bug fixes.

Wear Compose is up to 1.4.1, with yet another bug fix.

We also received updates to several Compose-adjacent libraries:

  • androidx.fragment:fragment-compose:1.8.6
  • androidx.lifecycle:lifecycle-runtime-compose:2.9.0-alpha10
  • androidx.lifecycle:lifecycle-runtime-compose-android:2.9.0-alpha10
  • androidx.lifecycle:lifecycle-runtime-compose-jvmstubs:2.9.0-alpha10
  • androidx.lifecycle:lifecycle-runtime-compose-linuxx64stubs:2.9.0-alpha10
  • androidx.lifecycle:lifecycle-viewmodel-compose:2.9.0-alpha10
  • androidx.lifecycle:lifecycle-viewmodel-compose-android:2.9.0-alpha10
  • androidx.lifecycle:lifecycle-viewmodel-compose-desktop:2.9.0-alpha10
  • androidx.navigation:navigation-compose:2.8.7
  • androidx.navigation:navigation-compose:2.9.0-alpha06
  • androidx.navigation:navigation-fragment-compose:2.8.7
  • androidx.navigation:navigation-fragment-compose:2.9.0-alpha06
  • androidx.paging:paging-compose:3.3.6
  • androidx.paging:paging-compose-android:3.3.6
  • androidx.savedstate:savedstate-compose:1.3.0-alpha08
  • androidx.savedstate:savedstate-compose-android:1.3.0-alpha08
  • androidx.savedstate:savedstate-compose-jvmstubs:1.3.0-alpha08
  • androidx.savedstate:savedstate-compose-linuxx64stubs:1.3.0-alpha08
  • androidx.xr.compose:compose:1.0.0-alpha02
  • androidx.xr.compose:compose-testing:1.0.0-alpha02

Also, JetBrains released Compose Multiplatform 1.8.0-alpha03. Compose Multiplatform is migrated to the K2 compiler, and work is underway to support multiplatform back handlers for navigation. IdlingResource and related ComposeUiTest methods were removed from Compose for Web and Compose for iOS. We have multiplatform Clipboard support, along with lots of bug fixes.

One Off the Stack, One Off the Slack

You’ve got questions. That’s understandable!

In Nav for Compose, How Do I Get Back?

navigate() goes forward. pop...() goes back. Particular as Navigation for Compose undergoes changes, such as 2024’s introduction of type-safe parameters, you might lose track of the roles of navigate() and pop...(). That does not end well, as we see in this week’s highlighted Stack Overflow question.

Can We Please Focus on focusable()?

The focus APIs in Compose are a bit arcane, and since Compose was originally targeted mostly for touchscreens, the documentation is a bit lacking. But if you are working on Compose for Desktop, or TV Compose, focus becomes very important very quickly. Learn a bit more about what is going on with focusable() in this week’s highlighted Kotlinlang #compose Slack thread.

Composable Commentary

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

Kotlin Multiplatform Tooling – Shifting Gears

JetBrains’ Hadi Hariri (Bluesky) announced that JetBrains is focusing on the IntelliJ Platform — including Android Studio — for Kotlin Multiplatform development going forward. Fleet’s support for KMP will be discontinued. Where Kotlin Multiplatform goes, Compose Multiplatform follows, so it stands to reason that IntelliJ IDEA and Android Studio will be the lead IDEs for Compose Multiplatform development.

A Visual Guide to TopAppBar Variants in Jetpack Compose

Alex Zhukovich (Mastodon, Bluesky) walks us through various types of TopAppBar() configurations that we can create in Compose Material3, from CenterAlignedTopAppBar() to LargeFlexibleTopAppBar().

Medium: Expand & Collapse Animation for Accordion in Jetpack Compose

Having screen sections that expand and collapse is a common UI pattern. Dani Mahardhika demonstrates several different specific designs for this and how to implement them.

Be Mine and Add Interaction with Compose and Canvas

Eevis Panula (Mastodon, Bluesky) demonstrates how to respond to touch input on Canvas() elements, in this case using a Valentine’s Day theme of hearts with messages.

Brushed Metal UI in Jetpack Compose

sinasamaki (Mastodon, Bluesky) looks back to the time of skeuomorphic design, where everything gleamed of brushed metal. sinasamaki demonstrates how to render a knob in a skeuomorphic fashion, leveraging radial gradients for the brushed effect, lerp() to help render some lighting effects, and border() to hint at a chamfered edge.

Medium: Loading Initial Data properly with MVI

Maxime Michel returns to the topic of how we should initialize data in a viewmodel. While LaunchedEffect() or the viewmodel’s init() block are common approaches, Maxime (and others) advocate for using onStart() on a MutableStateFlow to trigger initialization when the UI starts observing the state.

In the land of Jetpack Compose: Creating a chained animation

Viktor Arsovski explores creating chained animations, where the next animation in series starts when the previous one ends.

Resource Roundup

100% pure code!

GitHub: angatiabenson / idle-detector-compose

Angatia Benson has published an interesting IdleDetectorProvider() composable that will alert you if the user has not interacted with your UI in a configurable time period. This might be useful for auto-save, auto-logout, or similar scenarios.

GitHub: flaringapp / ComposeCollapsingTopBar

GitHub user flaringapp brings us a CollapsingTopBarScaffold() that handles common collapsible top bar scenarios for Compose for Android, without dependencies on Compose Material or Compose Material3.

Timeline View

Vipul Asri (Mastodon) has released a library that implements timeline-style UIs using either composables or classic views.

GitHub: vitoksmile / ComposeHints

Viktor Mykhailiv offers us a tooltip library for Compose Multiplatform, supporting Android, iOS, Web, and Desktop. See this Medium post for the challenges in implementing such a thing and where this library plugs in.

Notable Releases

Maps for Android released 6.4.4 because, um, 6.4.2 and 6.4.3 kinda did not really happen.

Horologist is up to 0.7.9-alpha, moving to Kotlin 2.1.10 and making some tweaks to the Media UI model.

Circuit published 0.26.1 to fix some bugs, update some dependencies, and add some docs.