jetc.dev Newsletter Issue #178
This week, we look at sending results back to previous composables via Navigation for Compose, both from the navigated-to composable and from a viewmodel.
We also explore conditional modifiers, accessible graphs, and how the K2 compiler helps with Compose Multiplatform build times. And, we examine both a drag-and-drop framework and a Material-free pull-to-refresh implementation.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Sending results back from one composable to a previous one (using Navigation for Compose) works, but doing that from a viewmodel gets a bit tricky. Google’s Ian Lake walks us through the approach in this week’s highlighted Stack Overflow question.
Suppose we have newer Compose libraries but an older compiler. Will that cause a rupture
in the space-time continuum? Or will it work fine? Explore more with Google’s Ben Trengrove
in this week’s highlighted Kotlinlang
#compose Slack thread.
Posts, videos, and other new information related to Jetpack Compose!
Katie Barnett demonstrates a
conditional() custom modifier, one that applies other modifiers
based on the result of a
Boolean condition. This can improve readability compared to trying
to have the conditional logic lie outside the modifier chain.
Zsolt Kocsi walks us through the changes in Appyx 2.0. Appyx now has a layered set of artifacts, along with Compose Multiplatform support and gesture-based navigation options (e.g., Tinder-style card swipes).
Ian Okumu looks at using the new pre-release K2 compiler for Kotlin on Compose UI modules. In particular, Ian explores the performance gains of K2 when building Compose Multiplatform code, finding that it is an improvement if not quite to the level that JetBrains touts.
Eeva-Jonna Panula continues her series of posts examining the intersection of accessibility and graphs in Compose UI. This time, Eeva-Jonna looks at the impact of color blindness on typical graphs and how to use shapes and patterns to differentiate graph lines, in addition to using color.
Joel Kanyi examines what it takes to send a result along the back stack with Navigation for
Compose, to deliver information to some prior screen or navigation point. This leverages
SavedStateHandle that is part of each Navigation for Compose back stack entry, providing
a communications bridge between the navigated-to composable and the composable that initiated
Shoaib Mushtaq walks us through the implementation of an
composable, which uses a
Canvas() to draw the overall circle and the completion arc,
while animating the changes as you increase or decrease how much has been completed.
Alexandre Bruneau wanted a
HorizontalPager() with lots of pages: 100 or more.
The ordinary “pager dots” approach does not scale well to this many pages.
Alexandre explores making the pager indicator itself be paged, so users get a sense
that there are more pages without flooding them with dots.
Other Interesting Links
- Custom Media3 ExoPlayer Layout with Jetpack Compose — Android
- Guide to Building Your First Android Calculator App with Jetpack Compose and Kotlin: A Beginner’s Android Development Tutorial
- How to Create Eye-Catching Animations in Android with Jetpack Compose
- Medium: An Easy To Build First App Using Jetpack Compose
- Medium: Basic Views in Compose with Examples
- Medium: Benefits of Compose with Examples
- Medium: Building custom shapes with Canvas in Jetpack Compose: Practical Guide
- Medium: Dynamic Animations with Lottie Animation in Jetpack Compose
- Medium: Exploring the Rotate Button Composable in Jetpack Compose
- Medium: Google Sign-In with Firebase Using Jetpack Compose
- Medium: Implementing grid UI in easy way with GridLayout for Compose library
- Medium: Jetpack Compose color picker with hex values
- Medium: Jetpack Compose: Mastering States
- Medium: ModalBottomSheet and the system navigation bar — Jetpack Compose
- Medium: Side Effects in Jetpack Compose : A Beginner’s Guide
- Medium: Streamline permission handling in Android Jetpack Compose applications with Compose Permissions
- Medium: Unleashing Creativity with Custom Modifiers in Android Jetpack Compose
100% pure code!
GitHub user TinyHai offers us
designed to be wrapped in a
DragDropBox() that can manage the drag-and-drop state.
The result is the ability to drag any drag targets onto any drop targets, with an
onDrop event for when the drop occurs.
Roman Levinzon built a plugin for Android Studio that offers live templates and a new feature dialog that make it easy to implement Roman’s approach to Compose UI architecture.
Other Interesting Links
- 2024-02-20: Compose Multiplatform RCs! State! Nested scrolling! @firstname.lastname@example.org on Amper! Compose Cupertino! Compose... Hammer? And... we can memoize lambdas?!?
- 2024-02-13: Compiler 1.5.9! BOM 2024.02.00! New Glance libraries! @email@example.com on Circuit and Compose Multiplatform! Material3! Markdown! MVI! And... testing robots?!?
- 2024-02-06: A Compose Multiplatform survey and a patch! @firstname.lastname@example.org on font scaling! Modal bottom sheet close confirmation! Compose Multiplatform resources! Draggable items in lazy lists! And... @email@example.com talks to some Italians?!?