jetc.dev Newsletter Issue #43
Compose is up to
alpha08, so this week we explore what that means. We also
peek at the new “Arctic Fox” edition of Android Studio, try to remember when
we need to
remember(), and look at design systems and themes. Plus, we get
yet another reminder that we need to be patient as Compose has its API reviewed
alpha08 requires Kotlin 1.4.20, whereas previous versions
did not support 1.4.20. Also note that
androidx.ui packages, such as
ui-test, are now in the
androidx.compose.ui artifact group.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Using Navigation for Compose seems like a natural fit for a
However, ideally, if you are showing a drawer, the top bar icon switches from
a menu (to open the drawer) and a back arrow (if the user can navigate back/up).
A bit of state can help us switch between those icons, as we see in this week’s
highlighted Stack Overflow question.
remember() seems important. However, it is not necessarily always clear what
should and should not be wrapped in
remember() to retain an object across
compositions. In this week’s highlighted Kotlinlang Slack thread, we explore that
issue and its relationship to
derivedStateOf() and snapshots.
Posts, videos, and other new information related to Jetpack Compose!
A week ago, Google updated Android Studio 4.2 to its first beta release. The
Tools team elected not to continue Compose
@Preview support in the 4.2 betas,
akin to how they dropped it from 4.1 earlier. As a result, your choice is to either
stick with the final canary build of 4.2 or jump into Android Studio 2020.3.1,
code-named “Arctic Fox”. This IDE, formerly known as Android Studio 4.3, uses
the new IDEA-based very wordy naming-and-numbering system. It is the new home
@Preview support… at least in theory (early reports indicate
that there are some bugs).
Lint is going to start yelping about adhering to Compose API guidelines,
specifically about the names and positions of composable function type (lambda)
parameters. In particular, the trailing lambda parameter is supposed to be named
Also, ambients now get
Ambient as a prefix, not a suffix.
maxLines had hardly showed up for
CoreTextField when it got moved to
On the flip side, we now have
BasicTextField and related composables.
A bunch of other things are getting renamed (e.g.,
VectorAsset is now
and a bunch of deprecated things are outright removed (e.g.,
We have better gesture detector support, plus a slew of bug fixes and other changes.
A seemingly infinite number of things are being renamed, moved into new packages, or both. We now can find out what modifier keys (e.g., Shift) were pressed when a key event occurs. Even more gesture detectors were added, including ones based around multitouch (e.g., pinch-to-zoom).
JetBrains continues their own release train, with a new build of Compose for Desktop for us to play with! It now supports macOS 10.13 and higher, plus supports the new Apple Silicon. There is better interoperability with Swing code, and vector drawables are now supported.
Adam Bennett returns with the first part of a blog post series looking at design systems and their Compose implementations. Specifically, he reviews how his team took their existing design system for classic views and how how they approached creating a Compose counterpart.
Bill Phillips reviews three theming mechanisms: classic Android resource-based themes,
a custom themeing system that Cash created for their app, and Compose UI’s theming system. He provides samples plus pros and cons for each approach, working from the basis that themes are dependencies to be injected into app code.
100% pure code!
…And One More Thing
The renaming and refactoring is continuing at a brisk pace, and we should expect more of the same in upcoming alphas.
The good news is that these decisions are being made by an “API council”. Presumably, that group is responsible for setting naming standards, helping to identify what needs to be changed, and dealing with one-off naming concerns.
The release notes suggest that they are codifying their naming standards, which will add some measure of predictability to upcoming changes. Plus, for “new construction”, hopefully they will use these standards at the outset and therefore be less likely to have to be altered later.
Still, this makes keeping up with the alpha releases annoying — each new update means a new round of figuring out what is moved, what is deprecated, etc. This time around, that is on top of having to decide which Android Studio version to use (4.2 Canary 16? 4.2 Beta 1? 2020.3.1 Canary 1 Arctic Fox “Omaha!”?)
As always, patience is the watchword.
- 2021-10-12: Overscroll! Responsive layouts! Accessibility! Reorderable lists! Foldables! Testing with an Espresso wrapper! And... testing with robots?!?
- 2021-10-05: 1.0.3! 1.1.0-alpha05! Scopes! Compose in production! rememberUpdatedState()! And... particles of Compose?!?
- 2021-09-28: @androidamanda on declarative UIs! Keyboard handling! Swapping themes! Pickers, pickers, and more pickers! And... LED matrix displays?