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?
If you encounter problems in subscribing, let us know!
- 2021-01-12: layout()! Navigation with Parcelables! Custom drawers! Compose for Desktop! And Compose... for iOS?!?
- 2021-01-05: Navigation arguments! ViewModel? Shapes! GraphQL and Compose! More shimmers! In-browser Compose! And the power of names!
- 2020-12-22: alpha09! @chrisbanes on how Compose impacts APK complexity and build times! Scaffold()! Staggered grids! Calendars! Design systems! And... mistakes were made!