jetc.dev Newsletter Issue #30
alpha02 is out! While it is small overall, we look at some breaking changes.
We also look at early attempts at paginating Compose UI lists, working with multi-screen
devices, and dumping your composable hierarchy to text for debugging. Plus: codelabs!
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Part of the challenge of working with Compose UI is knowing what is possible
and where to get it. All too frequently, the things that you need are in top-level
functions that defeat auto-complete. In this week’s highlighted Stack Overflow
question, we see that the trick to having a
Scaffold drawer that you can toggle
rememberScaffoldState() function, so you can more easily reference that state
and use it to open and close the drawer.
Posts, videos, and other new information related to Jetpack Compose!
In the “Alpha Announcements” section of last week’s newsletter, I failed to mention the codelabs that Google has produced, to help lead you through the creation of Compose projects for hands-on experiences with Compose. Google’s Jose Alcérreca pointed out the omission. I sincerely apologize for failing to mention the codelabs and I encourage you to visit those codelabs.
If you are building (or are consuming) libraries containing composable functions,
those libraries need to be recompiled to work with
alpha02. They changed the
way that the Compose compiler plugin handles calls to composable functions,
and while this does not affect your source code, it does affect your compiled
code. Also, note that
onPreCommit() is deprecated (use
LazyColumnFor supports long lists, that implies that you already have the
data for the long list. That may or may not be the case, based both on the
data source (e.g., paged Web service API) and simple memory limitations. For the
former, Damian Petla demonstrates how
can be used to trigger the loading of additional data into the list.
Microsoft’s Surface Duo is an upcoming dual-screen hinged device. Apps can work with both screens at once, and this blog post from Joy Liu outlines how to do that in the context of a Compose UI project!
100% pure code!
Square adds to the ever-growing fleet of Android libraries! This one, Radiography,
emits the structure of a
View hierarchy or composable tree in text. This is
designed for use in crash reports, failed instrumented tests, or other diagnostic situations.
Baljeet Singh brings us a demonstration of assembling a Gmail-style inbox screen using Compose UI. This goes along with a similar project demonstrating a Twitter-style UI.
…And One More Thing
Did I mention that there are codelabs?
- 2023-01-24: Locales! Relay! Effects! Paging! Foldables! Permissions! Date pickers! Bi-directional scrolling! And what your MaterialTheme means... for your SwiftUI code?!?
- 2023-01-17: New Compose patches and alphas! Dealing with Navigation for Compose! Scaffolds! QR codes! Server-defined UI! And @email@example.com has joined the BOM squad! 😁 💥
- 2023-01-10: onNewIntent() and composables! ContactsContract and composables! Balloons! QR codes! Pencils! And a focus on focus!