jetc.dev Newsletter Issue #238
Published: 2024-10-29
This week, we try to determine when our screen is destroyed and how far @Stable
really goes.
We explore Relay and Paparazzi. And we look at a server-defined UI implementation and integration
with desktop OS trays.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Note that the Slack archive for Kotlinlang seems to be stuck again, with no updates after October 23rd. This may affect future newsletter issues.
How Do I Determine When My Screen is Destroyed?
Asking this question “opens a can of worms”, as “destroyed” is not strictly a thing in a single-activity Compose-based UI. You need to tie your logic to something else, such as a Jetpack viewmodel being cleared, as we see in this week’s highlighted Stack Overflow question.
Do I Seem @Stable
Enough?
We can declare an interface
to be @Stable
. Beyond the @Stable
contract, what restrictions
are there placed on our implementations of the interface
— for example, can we create
an anonymous instance via object
? Learn more in this week’s highlighted Kotlinlang #compose-android
Slack thread.
droidcon Lisbon 2024
droidcon Lisbon 2024 had several Compose-related talks, including:
- Bringing Your Canvas Creations to Life with Jetpack Compose
- Building the blocks of PARCH a composable architecture
- Composable Preview Driven Development: TDD-fying your UI with ease!
- How easy is it to draw on GoogleMaps using Compose?
- Jetpack Compose Slots - How to write deeply customizable UI components
- Mastering the Art of Navigation Compose
Composable Commentary
Posts, videos, and other new information related to Jetpack Compose!
Video: Studio Jewelry - Android Developers Backstage
This Android Developers Backstage episode features Google’s Sebastiano Poggi, with a discussion of where Compose for Desktop gets used in building Android Studio. They also take a look at the JetBrains Jewel design system and its Markdown renderer.
Bridging the Gap: Turning Figma Designs into Jetpack Compose Code with Google‘s Relay Plugin
Shane Barker reviews applying Relay to convert a Figma design to Compose code using a specific design system. Shane explains the good and the bad, from the style of the generated code to the performance of the result.
Medium: Why Espresso UI Tests are Holding Your App Back: Discover the Power of Paparazzi Snapshots!
Raphael Cohen gives us a tour of Paparrazi for screenshot-based composable testing, from writing the tests to storing the “golden images” to detecting test failures.
Circular Reveal Animations in Jetpack Compose
Scott Pierce demonstrates how to transition from UI state to state with a circular reveal emanating from the point where the user taps a widget. The trick involves drawing two copies of the composable (initial state and end state) and animating a circular clip.
Jetpack Compose Modifiers: Your Swiss Army Knife for UI Enhancement
The Wawandco team is back, this time giving us a tour of dozens of modifiers and how to use them for various effects.
Medium: Loading Initial Data in Jetpack Compose: Effective Strategies for Your UI
Muhamed Riyas M walks us through three approaches for loading data when you open up a screen:
SharingStarted.WhileSubscribed
on a Flow
, LaunchedEffect()
, and a simple init()
function in a viewmodel.
Other Interesting Links
- Compose Performace - Finding Regressions
- Differences & Uses Of @Immutable vs @Stable in Jetpack Compose
- How To Create a Parallax Movie Pager In Jetpack Compose
- Medium: Easy Beginner’s Guide to Using ConstraintLayout in Jetpack Compose
- Medium: Hands-On with State Management in Jetpack Compose
- Medium: Implementing Pinch to Zoom in Jetpack Compose
- Medium: Instagram story Player in Android using Media3 Exoplayer and Jetpack compose
- Medium: Jetpack Compose Tips to Increase Productivity
- Medium: Understanding MVI Architecture in Android with Orbit
- Side-Effects in Jetpack Compose
- Slides: Server Driven Compose With Firebase
- Video: Practical Tips and Tricks to Improve Your Compose Previews
Resource Roundup
100% pure code!
GitHub: vvsdevs / AndroidDynamicJetpackCompose
GitHub user vvsdevs is building a server-defined UI engine based on Compose Material3.
GitHub: easternkite / eungabi
Lee Dong-Yeon is working on a Compose Multiplatform navigation library, with an eye towards supporting platform-specific UX, such as Android’s predictive back gesture and iOS’s swipe-back gestures.
GitHub: kdroidFilter / ComposeNativeTray
GitHub user kdroidFilter is creating a Compose for Desktop library to allow apps to integrate with the system tray on Linux, macOS, and Windows. It supports tray menus defined by a DSL with items, checkable items, sub-menus, dividers, and more.
GitHub: huanshankeji / compose-html-material
GitHub user huanshankeji has published a library of Material3 components based on Compose HTML. This related library aims to create a unified API for Compose HTML and the Compose Multiplatform set of platforms.
Other Interesting Links
- GitHub: Abdo-21 / Jetpack-Compose-NumberPicker (wheel-style number, date, and time pickers)
- GitHub: cheonjaeung / wheelpicker (iOS-style wheel picker)
- GitHub: jordond / MaterialKolorBuilder (generate Material3 themes from a color)
- GitHub: kiwicom / orbit-compose (design system built atop Material3)
Notable Releases
Circuit is up to 0.25.0
,
mostly updating dependencies.
Compose Unstyled is out with a 1.18.1
release,
with some improvements to BottomSheet()
, ModalBottomSheet()
, and Dialog()
.
Also, the ImageVector Wizard plugin now supports IntelliJ IDEA in addition to Android Studio and was rewritten in Compose for Desktop.
Or, you can subscribe to the Atom feed or follow Mark Murphy in the Fediverse.
Recent Issues:
- 2024-10-29: Relay! Paparazzi! droidcon Lisbon 2024! Server-defined UI! And... desktop OS trays?!?
- 2024-10-22: Compose patch! Compose alpha! Compose Multiplatform stable! droidcon NYC! Adaptive UIs! MVI! HTML conversions! Math rendering! And... are we now Fluent in Compose?!?
- 2024-10-15: Alpha and beta BOMs! Compose Multiplatform UI testing! Compose Multiplatform camera apps! Passing data between screens in Navigation for Compose! JSON rendering!