jetc.dev Newsletter Issue #18
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!
Lots of Compose calls take lambda expressions that themselves are
@Composable, so they
@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.
@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.
Posts, videos, and other new information related to Jetpack Compose!
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.
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!
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.
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.
100% pure code!
In his #android11 presentation on Jetpack Compose, Romain Guy demoed a few things using a sample app — this is that app!
…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.
- 2022-09-13: Compose updates! Tracking down and fixing recompositions! Maestro! Redwood! Molecule! And Twitter's rules for composables!
- 2022-09-06: Snapshots! A Glance support library! Measuring and drawing! Swipe-to-dismiss! Speed dials! And... a redwood sighting?!?
- 2022-08-30: Android 13 per-app language support! Performance optimizations! Expandable lists! MVI! Zooming! Steppers! And... another Compose beta? Already?!?