View profile

jetc.dev Newsletter - Issue #119

jetc.dev Newsletter - Issue #119
By Mark Murphy, CommonsWare • Issue #119 • View online
This week, we peek at beta03… and it feels like we are getting close to an RC!
Beyond that, we look at AlertDialog() and navigation. We explore what it took to wrap Google Maps in Compose and what it takes to get Twitter teams to develop composables. We examine design systems, slot APIs, and a few templates for helping get composables set up. And, I worry a bit about how libraries are supposed to deal with Compose Foundation and Compose Material and Compose Material3.

Beta Breakdown
Reviewing the release notes for the latest Jetpack Compose update!
1.2.0-beta03 of Compose shipped, and it mostly seems to be bug fixes.
We did get a new IntervalList/MutableIntervalList pair of classes, with an eye towards Lazy...()-style DSLs (item/items). It will be interesting to see if these classes move to Core or another Jetpack library, as they seem to be not very Compose-specific. We also got some improvements to keyboard handling, including support for injecting key events. But, with this limited amount of API changes, it feels like we will be moving to an RC in the coming weeks.
Wear Compose is also shipped a fresh beta, 1.0.0-beta03. ScalingLazyColumn() now works with @Preview-annotated composables. Also, a couple of compatibility notes:
  • ScalingLazyColumn now defaults to CenterHorizontally for horizontalAlignment — manually switch to Start if you need the old functionality
  • Be prepared for larger chips, as CompactChip has too small of a touch target, so it will get more padding in a future release
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
How Do We Use AlertDialog() with Navigation?
Composable Commentary
Posts, videos, and other new information related to Jetpack Compose!
Medium: Diving Into Compose — Lessons Learned While Building Maps Compose
Video: Composing an API with Kotlin
Slides: Branching out to Jetpack Compose
Video: Implement your own design system with Jetpack Compose
Medium: When Jetpack’s Glance met his fellow worker, Work Manager
Practical Compose Slot API example
Medium: Accordion Menu in Jetpack Compose
Medium: Jetpack Compose Power Navigation
Resource Roundup
100% pure code!
Other Interesting Links
…And One More Thing
The ReadMoreTextView family of libraries mentioned in the “Resource Roundup” section illustrate a problem with Compose UI: libraries wind up with lots of extra complexity, or they wind up “picking a side” when it comes to design system foundations.
In principle, the “read more” scenario is simple: show some text, then show replacement text when the original text is clicked upon. But, this requires three libraries and three sets of composables to cover just what’s in Compose UI:
  • One library offers BasicReadMoreText() as a wrapper around BasicText() from Compose Foundation
  • A separate library offers ReadMoreText() as a wrapper around BasicReadMoreText() that applies Compose Material styles
  • A third library offers ReadMoreText() as a wrapper around BasicReadMoreText() that applies Compose Material3 styles
That is a lot of overhead just to support everything from Compose UI. The reason why this is somewhat practical for this library is because the functionality is so simple. For a library with more complex widgets, the overhead may become too great, and the developer will pick one and call it good… and, most of the time, that seems to be Compose Material. This hampers projects that elect not to use Compose Material, as either they have far fewer libraries to reuse or they need to settle for pulling in Compose Material and the impacts that has on code completion, build times, etc.
This particular library would make for a fascinating case study for Google to explain how library developers should be approaching this problem.
Did you enjoy this issue?
Mark Murphy, CommonsWare

Jetpack Compose news and notes.

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Powered by Revue