jetc.dev Newsletter Issue #192
This week, we peek at the latest Compose Multiplatform release and wonder why
seems to behave oddly. We look closely at a molecule, explore the
Modifier.Node docs and
discussion around those docs, and work with bottom nav bars. Plus, we see libraries
for reordering list contents and another KSP-based Navigation for Compose wrapper.
Ooooo… What Did We Get?
Reviewing the release notes for the latest Jetpack Compose update!
JetBrains released Compose Multiplatform
with support for Kotlin
2.0.0-Beta 1, along with a few iOS and desktop bug fixes.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Technically, this question is about parent composables being recomposed, apparently
unnecessarily. In reality, it’s another case where a developer got caught by
inline functions, which breaks our assumptions regarding
recomposition rules. Google’s Chuck Jazdzewski explains more in this week’s highlighted
Stack Overflow question.
An error message like
MutableState containing (2131755159, 17039370) cannot be saved using the current SaveableStateRegistry
makes things difficult to debug. Kirill Grouchnikov recommended converting those
values to hexadecimal and seeing if there was a matching resource ID… which eventually
uncovered the problem, as we see in this week’s highlighted Kotlinlang
Posts, videos, and other new information related to Jetpack Compose!
CashApp’s Jake Wharton joined the Code with the Italians team to discuss Molecule, a library for generating flows from composables.
Google recently published updated documentation on creating custom modifiers using
Modifier.Node. Saket Narayan has been updating Telephoto and
had questions and concerns about the instructions. That led to substantial Mastodon thread,
to go along with a noteworthy Kotlinlang
#compose Slack thread
on the documentation and its recommendations.
Continuing on the subject of bottom navigation and Navigation for Compose, by default Navigation will “reset” each bottom nav item. If the user does work in some tab, switches to another tab, then returns to the first tab, their work is lost. Patryk Połeć explores how to work around this limitation for those tabs that need to be more stateful.
Myroslav Kolodii demonstrates using
AndroidView() to show previews
of custom views. This is an interesting trick, letting you preview custom views without
porting them over to Compose UI itself.
The Coding Montana walks us through every step to apply a Lottie animation in a Compose UI
app, from app creation and adding the
lottie-compose dependency through loading a Lottie
file and rendering it using the
Other Interesting Links
- Emoji error! Using the latest Compose with compileSDK < 34
- How to create Shimmer Loading Animation with Jetpack Compose
- Material 3 UI Components in Jetpack Compose
- Material Components for Android TV using Jetpack Compose
- Medium: Build Music Player with Jetpack Compose + Media3 ExoPlayer
- Medium: Building a Camera and Gallery Chooser in Android Using Kotlin and Jetpack Compose
- Medium: Changing Snackbar Background Color
- Medium: Dashed Borders in Jetpack Compose: A Comprehensive Guide
- Medium: Deprecated accompanist Modifier.placeholder(..) shimmer loading solution
- Medium: Drawing with Compose : The Zebra Spacer
- Medium: Gestures in Jetpack compose — All you need to know — Part 2
- Medium: How to Glance: Android widgets with compose
- Medium: Jetpack Compose Add a Share Button to your App
- Medium: Jetpack Compose Bottom Navigation Bar
- Medium: Jetpack Compose — Customize your SearchBar with BasicTextField
- Medium: Modern App Development Take It Easy Skills — Compose Layout and Modifiers Advanced Concepts
- Medium: Playing with Text Composable in Jetpack Compose
- Medium: Rewriting the BackStack. A Compose & Navigation story.(Bonus at the end)
- Medium: Transition Between Pages with Jetpack Compose: Modern Android UI Design
- Row composable with rounded corners on the edges; border-radius
100% pure code!
FunkyMuse created another KSP-based wrapper for Navigation for Compose, inspired in part by compose-destinations. It offers type-safe navigation arguments, nested navigation support, screen transitions, and more. See this blog post to learn more about the library and the reasons for creating it!
Other Interesting Links
- 2023-11-21: Compose/Material3/Wear Compose updates! remember()! Adaptive layouts! Compose Multiplatform in 2024! @firstname.lastname@example.org on BasicTextField2()! Compose Multiplatform charts! And... is TV Compose in trouble?!?
- 2023-11-14: Compose Compiler! BasicTextField2()! @email@example.com and animations! Optimization! @firstname.lastname@example.org, JetBrains, and Fleet! JetBrains and plotting! And... we collapse?!?
- 2023-11-07: Compose Multiplatform! Chips in fields! Diffing! Custom fonts in Glance app widgets! Heatmaps! PIN input! And @email@example.com is in a bit of a haze?!?