Fashionably late
I’ve been working on Android apps professionally since 2013, and with that I’ve experienced the windy road of different trends in Android app development: the classic “multi Activity” structure, CursorLoaders, Fragments, the switch in focus to Kotlin, AndroidX introducing lifecycle aware reactivity and a formalization of MVVM with LiveData and ViewModel, and now Compose.
Since Compose was announced in 2019, I’ve maintained a “healthy” (I’d argue) skepticism - we all know how willing to kill its darlings Google can be, and I’d seen the pain caused by Angular 1 to 2 rewrites. I was, and I still am working on a very mature and very large app, so any migration would need to wait until we saw Compose mature anyway.
This January, I took some time to play around with some toy apps for myself and decided to finally give it a go. What follows is what made me happy, and what made me sad.
@Preview
feature is amazing, although it’s not quite clear why it couldn’t have worked for standard Android views, and I’m salty that they haven’t ported it over.foundation
package Composables (like BasicText
etc.) and CompositionLocal
for theming.AndroidComposeTestRule
. That said…
ComposeTestRule
to interact with Composables in tests (you can’t use Espresso) which means that the tests are locked in to the implementation somewhat, and you’re always going to have to change tests when migrating to Compose. The only alternative to avoiding these costs/risks would be to use UIAutomator.Unit
and “emit” views (as opposed to returning some kind of Composable super type) feels uncomfortable to me.