jetc.dev Newsletter Issue #252
Published: 2025-02-04
Not only did we get yet another patch release for Compose, but we got a new beta!
Beyond that, we look at testing composables, PullToRefreshBox()
, and map markers.
Plus, we see a Figma plugin for exporting vector images to ImageVector
objects.
Ooooo… What Did We Get?
Reviewing the release notes for the latest Jetpack Compose update!
We have 2025.01.01
BOMs (stable, beta, alpha). The stable BOM points to the
1.7.7
patch release, with a smattering of bug fixes.
We also got 1.8.0-beta01
, so the beta release train for 1.8.0
has left the
station! Of note:
-
ContextualFlowRow()
andContextualFlowColumn()
were deprecated — more on this later in the newsletter -
The older non-semantics-based autofill APIs were deprecated, replaced by the semantics-based ones
And, we got the following updates to Compose-related libraries:
androidx.lifecycle:lifecycle-runtime-compose:2.9.0-alpha09
androidx.lifecycle:lifecycle-runtime-compose-android:2.9.0-alpha09
androidx.lifecycle:lifecycle-runtime-compose-jvmstubs:2.9.0-alpha09
androidx.lifecycle:lifecycle-runtime-compose-linuxx64stubs:2.9.0-alpha09
androidx.lifecycle:lifecycle-viewmodel-compose:2.9.0-alpha09
androidx.lifecycle:lifecycle-viewmodel-compose-android:2.9.0-alpha09
androidx.lifecycle:lifecycle-viewmodel-compose-desktop:2.9.0-alpha09
androidx.navigation:navigation-compose:2.8.6
androidx.navigation:navigation-compose:2.9.0-alpha05
androidx.navigation:navigation-fragment-compose:2.8.6
androidx.navigation:navigation-fragment-compose:2.9.0-alpha05
androidx.savedstate:savedstate-compose:1.3.0-alpha07
androidx.savedstate:savedstate-compose-android:1.3.0-alpha07
androidx.savedstate:savedstate-compose-jvmstubs:1.3.0-alpha07
androidx.savedstate:savedstate-compose-linuxx64stubs:1.3.0-alpha07
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
How Can I Control the Scroll Speed?
There may be some scenarios where you need a container, such as a LazyVerticalGrid()
,
to scroll more slowly than it would by default. One way to handle this is by applying
a custom NestedScrollConnection
to limit swipes and flings, as we see in this
week’s highlighted Stack Overflow question.
Hey, Why Is ContextualFlowRow()
Deprecated?
Google’s Simona Milanovic
(Mastodon, Bluesky)
announced a new policy for Compose, where APIs will no longer
hang out in @Experimental
status for extended periods. Instead, Google will move
APIs more aggressively either into stable status… or deprecate them. In this case,
they are choosing to deprecate ContextualFlowRow()
and ContextualFlowColumn()
,
so prepare your forks! Learn more in this week’s highlighted Kotlinlang #compose
Slack thread.
Composable Commentary
Posts, videos, and other new information related to Jetpack Compose!
Video: Compose Tips | Testing
Google’s Alex Vanyo
(Mastodon, Bluesky)
has a short video outlining the use of Compose Preview Screenshot
Testing and DeviceConfigurationOverride
to help with testing.
Migrating to the Compose PullToRefreshBox
Joe Birch
(Mastodon)
walks us through the problems with the current pullToRefresh()
modifier
and shows us how to switch to PullToRefreshBox()
from Compose Material3.
BasicTextField bubble wrap
Zach Klippenstein
(Bluesky)
points out that implementing fields in a custom design system is
a bit of a pain. One aspect of that pain comes with padding between a border and
the BasicTextField()
itself — that padding might waste space in scrollable
multi-line fields. Zach demonstrates a hack that can allow the bottom padding to
only take effect when the text is scrolled all the way to the bottom. One limitation:
Zach’s post does not make fun popping sounds, the way actual bubble wrap does.
Medium: Using html in Android Jetpack Compose Text widget
Alireza Goodarzi demonstrates a lightweight asAnnotatedString()
converter extension
function for Spanned
. Among other possible uses, this helps you convert HTML-based
string resources into AnnotatedString
objects for use in Compose UI.
Effective Map Composables: Collections of Draggable Markers
Uli Bubenheimer
(Mastodon, Bluesky)
continues a tour of advanced Maps for Compose implementations, this time
blending the work from the previous three posts into a DraggableMarkersModel
class.
This class handles both types of marker collection state changes: changes in what
markers are in the collection and changes to the marker positions (e.g., via drag-and-drop).
Other Interesting Links
- Medium: Bottom Navigation With Nested Destinations
- Medium: Build a Connection Indicator in Jetpack Compose — Step by Step
- Medium: Confessions of a Jetpack Compose Developer: Mistakes I Make While Building the NHL App — Prioritize. Ship. Iterate.
- Medium: Handle Navigation for Android Compose
- Medium: How to Create a Reusable Premium Watermark in Jetpack Compose
- Medium: Jetpack Compose Lifecycle: Around Composition Process
- Medium: Kotlin, Jetpack Compose, and DOOM: Running a 1993 game on Android Smartwatch
- Medium: Mastering ViewModel and Lifecycle in Jetpack Compose
- Medium: Stopwatch App with MVVM, Coroutines, and Jetpack Compose
- Medium: understanding rememberCoroutineScope in Jetpack Compose
- Search with TextField in list Compose Android Jetpack
Resource Roundup
100% pure code!
Figma Plugin: SVG to Jetpack Compose Icon
Emre hamurcu published a Figma plugin to convert vector graphics to ImageVector
implementations, including preview composables.
GitHub: evergreentree97 / easy-shimmer-compose
Choi Sang Rok has published a library containing a drawShimmer()
modifier and a
Painter
implementation of a shimmer, the latter of which can serve as a placeholder
while Coil loads a real image.
GitHub: mejdi14 / KMP-Liquid-Slider
mejdi hafien brings us a LiquidSlider()
composable for choosing a value within a range,
inspired by Ramotion’s original iOS implementation.
This edition supports Compose Multiplatform.
KLocation
Addhen Limited published a library for getting location data as a Flow
or, for
Compose Multiplatform, as a State
.
Notable Releases
Maps for Compose is up to 6.4.3
,
with “minor enhancements for DraggableMarkersCollectionWithPolygonActivity”.
Redwood is out with a 0.17.0
release.
Some deprecated items were removed, some improvements for insets were added, and
some bugs were fixed.
And Compose Destinations released 1.11.9
and 2.1.0-beta16
to update dependencies.
Or, you can subscribe to the Atom feed or follow Mark Murphy in the Fediverse.
Recent Issues:
- 2025-02-11: ModalBottomSheet! Composable API design! MapKit in Compose Multiplatform! Shimmer! TV focus! And... what is androidx.media3:media3-ui-compose?!?
- 2025-02-04: Compose patch! Compose beta!! Testing! PullToRefreshBox()! Map markers! Figma plugins! And... bubble wrap?!?
- 2025-01-28: Compose Multiplatform update! Camera! Google Pay! Screenshot testing! Video playback! And... Windows 95 with Compose?!?