jetc.dev Newsletter Issue #4

Published: 2020-03-10

The Jetpack Compose team released dev06 this week, with your usual round of tweaks both to the Compose framework itself and the Android UI set of composables.

Beyond that, this week we will look at reacting to visibility, rich text, and other FAB-ulous stuff!

One Off the Stack, One Off the Slack

You’ve got questions. That’s understandable!

How to Center Elements Inside a Column

It will take us a while to get used to the Compose approach for aligning contents within containers…

Reacting to What the User Can See

Sometimes, we need to optimize some other processing based upon what is happening in the UI, such as stopping power-draining services if the user no longer needs them. Our approaches for doing that in Compose will be somewhat different than how we handle it in classic view hierarchies.

Note: to view this, you need to be a member of the Kotlin Slack workspace — sign up at https://slack.kotlinlang.org/!

Composable Commentary

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

Compose dev06 Release Notes

One binary-breaking change to how Compose generates code for composables, but otherwise this seems to be a quiet update.

Compose UI dev06 Release Notes

A bunch of changes, including replacing AppBarIcon with IconButton and adding BottomNavigation.

Migrating From dev05 to dev06

Ian Warwick took some notes about what he needed to do to upgrade his app from dev05 to dev06, as a supplement to the official release notes.

Exploring Jetpack Compose: Floating Action Button

Joe Birch is back with another composable overview, this time looking at Compose’s support for floating action buttons (FABs).

Resource Roundup

100% pure code!

GitHub - android/compose-samples

These are Google’s official samples for Compose, presently focused on the JetNews sample.

GitHub - zach-klippenstein/compose-richtext

Zach Klippenstein has been experimenting with a rich text DSL with Compose, to make it simpler to render formatted prose.

…And One More Thing

Remember: Make sure that you set the kotlinCompilerExtensionVersion value in the composeOptions closure to the same version that you are using for your dependencies. So, if you bump your dependencies to dev06, update the kotlinCompilerExtensionVersion to match. You might consider defining a Gradle constant that you can use with string interpolation, so you can declare this value in one spot.