Newsletter Issue #13

Published: 2020-05-12

This week, we take a look at units of measure, FABs, and arrows. But, we start off by trying to get a bit of focus.

One Off the Stack, One Off the Slack

You’ve got questions. That’s understandable!

Managing Focus

Particularly for keyboard-friendly devices like Chromebooks, focus management is an important part of usability. In Compose, focus is still a work in progress, like most things, but here we see a bit of how to detect focus changes and how to proactively set the focus.

A Matter of Units

Dealing with varying dimension units can be painful, but Compose tries to make them a first-class citizen within the APIs.

Composable Commentary

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

Jetpack Compose - Explore Android’s Modern Toolkit for Bulding Native UI

GDG Perth brings us a brief conference video, led by Hassas Abid, with an introduction to Compose.

Google Codelab: Jetpack Compose Basics

Google has released an official codelab for Jetpack Compose, mostly taking you through the basic syntax.

Jetpack Compose: Beginners Guide to Declarative UI in Android

Sagar Chapagain offers another brief introduction to Compose, for newcomers to the topic.

Exploring Jetpack Compose: Arrangement

Joe Birch continues his tour of the Compose API, turning now to the Arrangement interface and its various sub-types, that containers often use for organizing their contents.

Floating Action Button with Compose

Brian Gardner is back, this time taking a look at the ever-popular FAB and how we implement one in Compose.

Resource Roundup

100% pure code!

GitHub: QArtur99 - Compose-ShoppingList

Artur Gniewowski brings us a nice-sized Compose demo, in the form of a shopping list app, showing Compose in conjunction with a lot of Jetpack libraries.

GitHub: jitinsharma - android-conferences

This is another Compose demo, this time maintaining a list of Android conferences, to examine how Compose works for your typical multi-screen sort of app.

GitHub: MindorksOpenSource - Jetpack-Compose-WhatsApp-Clone

MindOrks offers a larger project — a WhatsApp-style chat app — showing off a wide range of Compose UI elements.

GitHub: 47degrees - jetpack-compose-arrow-talk

This project is in support of a May 6 presentation for the Arrow Kotlin London meetup, showing how Compose and Arrow can be used together.

…And One More Thing

The question comes up on Slack a lot: “so, when is Compose going to be production-ready?”

Google is famous for not providing roadmap details, so the fact that there is no official statement on this subject should not be surprising. Moreover, I suspect that even Google does not know when Compose will reach, say, beta status. Not only is Compose a very large project that is breaking new ground, but COVID-19 has scrambled lots of development schedules — just see the one-month delay in Android R. That makes it even less likely that Google would elect to state a planned release timeline.

In theory, if Compose is doing what you want it to do today, there is nothing stopping you from using it for production work. In theory, I have hair. As you can tell by my balding pate, theory does not always hold up well.

In the long term, Jetpack Compose is likely to become a major foundational piece of Android app development. Today, it is not. It is an experiment and a demonstration of capabilities, nothing more. More importantly, today it does not solve any user problems compared to the existing View-based UI system. Users do not benefit from using Compose today. The maintenance cost of rewriting Compose code a dozen times over outweighs any near-term development speed advantage, and given the limited documentation I doubt that Compose development is faster anyway right now. Tomorrow’s advantages are for tomorrow’s code.

If you are developing tools, libraries, or similar things for Jetpack Compose developers, then clearly you are going to be playing with these dev releases with an eye towards getting stuff to market before Compose ships a stable version. That’s reasonable. But IMHO using it for production work on ordinary end-user apps is a frightening prospect.

If all goes well, you will have a decade-plus to relish in the joys of writing UIs in Compose. Don’t rush it for production use today.