jetc.dev Newsletter Issue #126
Compose 1.2.0 shipped in stable form, as did Wear Compose 1.0.0! 🎉
Beyond that, we look at gradient-filled text and supporting foldables. We examine a drag-and-drop library and faster screenshot tests. And I look at where we are with respect to the Compose release cadence and community adoption.
Reviewing the release notes for the latest Jetpack Compose update!
In addition to the stable releases, Compose Compiler 1.3.0 is already up to an
RC! The rest of Compose is out in a
1.3.0-alpha02 edition, including:
A new experimental
TextMeasurerto report the size of text, without rendering that text
Support for touch input pressure via
DrawScopefor use with things like
Your usual assortment of bug fixes
Wear Compose also has an
1.1.0-alpha02), moving their dependencies
up to Compose 1.3.0’s alpha and adding support for varying chip shapes.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
With all of the optimizations within Compose and Compose UI, you might think that they would have optimized away composables with no height or width. In truth, they do get composed, and this Stack Overflow question explores why that is the case and how to demonstrate the behavior.
A lot of people have been working on animating additions to and removals from
lazy containers like
LazyColumn(). But, how do you do the same thing with a regular
Column()? Learn more in this week’s highlighted Kotlinlang
#compose Slack thread!
Posts, videos, and other new information related to Jetpack Compose!
Google’s Kseniia Shumelchyk brings us the official announcement post for the stable release of Wear Compose 1.0.0. Of particular note, Google states:
Moving forward, Compose for Wear OS is our recommended approach for building user interfaces for Wear OS apps.
Google’s Alejandra Stamato writes about applying gradients to text, including
Brush support for
SpanStyle in Compose 1.2.0 and
previous techniques for those not ready to yet move to the now-latest stable release.
Google’s Gurupreet Singh explores supporting larger-screen devices, such as tablets
and foldables, using Compose UI, in this Android Worldwide video. Tips include
calculateWindowSizeClass() to display a UI suitable for the current screen
size and leveraging device posture support to determine how to deal with foldables.
Microsoft continues their first-class support for Compose UI, with an eye towards supporting their Surface Duo devices. This time, Joy Liu tells us about the new DragAndDrop addition to the Microsoft Compose SDK, to help make it easier to write drag-and-drop UIs both between multiple panes of a single app and between multiple apps.
Anders Ullnæss previously wrote about using Shot for screenshot testing, but he found that it runs slowly due to the need to run on hardware or an emulator. In this post, Anders explores using Paparazzi for screenshot testing, as it does not require either a device or an emulator.
Jorge Castillo writes about Jake Wharton’s Mosaic
library for implementing a console/terminal UI using Compose. Jorge dives
into the Mosaic implementation to explain how it works, from its node structure
to its custom
Applier to its approach for managing recompositions.
Other Interesting Links
- When Compose remember cannot forget
- Medium: Jetpack Compose Interaction and Indication
- How to use Custom Fonts with Jetpack Compose
- Medium: Sunsetting compose-router
- Slides: Building a navigation framework in Compose
- Creating custom shapes with paths in jetpack compose
- Quick Bites: What should you care about Recomposition?
- Medium: Customize Layout Using Measured Policy
- Medium: Bottom Navigation in Compose Way
- Medium: Snackbars in Jetpack Compose
- Jetpack Compose Navigation Drawer Example
- The compose symphony: A beginners guide to Jetpack Compose
- Medium: Creating Simple TODO App Using Jetpack Compose MVVM
- Text Clock in Android using Jetpack Compose
- Medium: Jetpack Compose vs XML for a job in 2022
100% pure code!
The SmartToolFactory team continues churning out composables! This time, they released a library with composables that show two images (or other composables) side by side, with a slider between them to illustrate the changes between those two images/composables. Honestly, the video in the GitHub README will explain this way better than I will…
…And One More Thing
The Compose 1.2.0 release comes just about a year after the initial stable 1.0.0 release. That is a fairly nice update pace: frequent enough to allow for steady improvement, but not so frequent that everyone is constantly trying to catch up. In particular, for library authors, a semi-annual release to adopt the latest Compose dependencies seems reasonable.
Overall, it feels like we are in the beginning steps of the “early majority” phase of the “technology adoption life cycle” with Compose. Compose is widespread, but it is not yet dominant. Contrast that with Kotlin for Android development, where it feels like we are squarely in the “late majority” phase. Kotlin is about four years ahead of Compose, as it was at 2017’s edition of Google I|O where official Kotlin support was announced. It will be interesting to see where we are with Compose adoption in 2026.
Fortunately, with these technologies well underway, we can focus our innovation efforts on other stuff. For example, we have only 40 years to invent flying cars that can fold into a briefcase.
- 2022-08-09: droidcon Berlin 2022! Animating text! Shimmers! Recompositions! Animations! Charts! Cameras!
- 2022-08-02: Compose 1.2.0! Wear Compose 1.0.0! Gradients and text! Foldables! Drag-and-drop! And @andersullnass on snapshot testing!
- 2022-07-26: New compiler beta! Overlapping composables! RecyclerView! movableContentOf()! JSON forms! And @anafthdev_ shows us composable picker wrappers!