jetc.dev Newsletter Issue #18

Published: 2020-06-16

This week we got the dev13 release and Android Studio 4.2 Canary 1, as part of “Developer Preview 2” of Jetpack Compose. In addition, we look at Romain Guy’s #android11 presentation, complete with his sample code and a look at the Compose roadmap for release.

One Off the Stack, One Off the Slack

You’ve got questions. That’s understandable!

Function References in Compose: Not Yet

Lots of Compose calls take lambda expressions that themselves are @Composable, so they can call @Composable functions. However, as we discovered in this Stack Overflow question, we cannot (yet) substitute function references for those lambda expressions, even when both fulfill the parameter’s requested function type.

Beware Unplanned Composition Loops

Having a @Composable be called repeatedly is what you want, except when it is not what you want. In a Slack thread, we discovered that it is important to keep using the same state object, if you do not want an unplanned composition loop.

Composable Commentary

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

Android Studio 4.2 Canary 1

As we saw when 4.0 went to beta, 4.1’s move to beta means that Compose support is dropped. Instead, if you are working with the developer previews, you need to migrate to Android Studio 4.2 Canary 1 if you want to keep up to date with IDE changes. On the plus side, we get a few new Compose-related features, such as the ability to not only see a @Preview in the IDE, but to actually launch it standalone on a device.

Compose dev13 Release Notes

No API changes were noted for this release.

Compose UI dev13 Release Notes

Similarly, no API changes were noted for this release.

#android11 Release Presentation

Google I|O was replaced by a series of #android11 videos. Romain Guy handled the one for Jetpack Compose, highlighting our current status and… providing a roadmap! More on that later in the newsletter!

Android Studio 4.1/4.2 New Project Bug

Both Android Studio 4.1 Canary 10 and Android Studio 4.2 Canary 1 have a bug, where creating a new project results in an unusable project. 🙃 My primary workaround has been to create the new project in Android Studio 4.0, then import it into the canary version of Studio. This is supposed to be fixed in 4.2 Canary 2.

Awesome Jetpack Compose

Naveen T P is maintaining a roster of Jetpack Compose resources, in the semi-standard “awesome” list format.

MVI (State machine) and Jetpack Compose

Oscar Sequeiros has an article describing how Compose’s unidirectional data flow support can be used for handling the common loading/empty/content/error set of states for rendering content obtained from a repository.

Resource Roundup

100% pure code!

GitHub: romainguy / sample-materials-shop

In his #android11 presentation on Jetpack Compose, Romain Guy demoed a few things using a sample app — this is that app!

GitHub: Akashkamble / Newzz-Compose

Akash Kamble has another take on the JetNews-style news reader app, in Compose.

…And One More Thing

We have a roadmap!

In Romain Guy’s #android11 presentation on Jetpack Compose, he provided some light details of their expected release schedule:

  • Right now, we have “Developer Preview 2”. Based on a Slack discussion, this is dev13, Android Studio 4.2 Canary 1, and perhaps a bit more documentation. In other words, it’s a branding thing more than a major milestone.

  • “Summer 2020”, they plan to release an alpha version of Compose. In theory, this means we will get the alpha within the next few months. In a pinch, they can claim that they really meant summer in the Southern Hemisphere, so we might not get an alpha until December. 😜

  • In 2021, they plan to release 1.0, which I assume means a stable release, after the planned alpha and a presumed beta.

This is roughly in line with what I had been expecting, albeit perhaps a bit slower, courtesy of a pandemic. Still, it is good to have an official statement about the timing. Early adopters will be in position to start “kicking the tires” more later this year, and we can start planning for production usage next year.