jetc.dev Newsletter Issue #142
This week, we get a double-handful of videos from droidcon London 2022. We look at variable fonts, accessibility, and rotary input. We see libraries for text flowing around images and fingerpainting. And we learn about donut holes, a subject that may or may not make you hungry.
NOTE: This newsletter is now being delivered via Buttondown, rather than Revue. If you were a subscriber via Revue, I moved your subscription over to Buttondown. If you are not receiving the newsletter, check your spam folder!
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
The verb “dismiss” is the prose equivalent of a code smell. Dismissing something is an action; Compose is based primarily on states. With Compose’s declarative approach, you simply skip rendering the dialog when you no longer need it, as we see in this week’s highlighted Stack Overflow question.
A horizontal row of items, such as a row of tabs, might include some visual indicator
of a selection. You might want to animate the transition as the selection moves
to different items. Several solutions are identified in this week’s highlighted
#compose Slack thread.
droidcon London 2022
The droidcon London 2022 conference videos are up, including a bunch tied to Compose, such as:
- Branching out to Jetpack Compose
- Composable Sheep: The Creative Coding Epilogue
- Compose beyond Material
- Composing in your Canvas!
- Composing With Confidence
- Demystifying Molecule: Running Your Own Compositions For Fun And Profit
- Model-driven navigation with Appyx – From zero to hero
- Take a look at Jepack Glance
- Thinking outside the Box: Custom Compose layouts
- Understanding Recomposition Performance Pitfalls
Posts, videos, and other new information related to Jetpack Compose!
Android Developer Summit 2022 Part Three was focused on the platform and as such
did not have much in the way of Compose-centric content. However, Google’s Caren Chang did
talk about accessibility in Compose UI, using things like the
modifier and the
contentDescription parameter to
Wear OS supports “rotary input”, whether that is supplied by a rotating crown, a
rotating bezel, or a touch sensitive ring that simulates a rotating bezel.
Vinícius Veríssimo teaches us the importance of supporting rotary input in our
Wear OS apps and how to use the
onRotaryScrollEvent() modifier to accept
rotary input in a
ScalingLazyColumn() or a
The Compose team uses “donut holes” and “donut-hole skipping”. This is a limited metaphor — after all, jelly donuts do not usually have holes, and you certainly do not want to skip the jelly. Emad Shehadah researched what the Compose team means by “donut holes”, in the context of optimizing recompositions, and makes the connection between “donut holes” and composition scopes.
An Android developer going by the Medium handle “The Android Developer”
walks us through the role of
derivedStateOf(), including comparisons to
distinctUntilChanged() operator on
Flow and how proper use of
can reduce unnecessary recompositions.
Amanda Scheetz delivered a presentation for GDG Cincinnati about the use of
ConstraintLayout() in Compose UI work, including creating reference IDs for rules
constraints() modifier’s DSL for defining the constraints between
Relay has definitely captured the attention of many Compose UI developers… including Kevin Schildhorn. While most material focuses on how to use Relay, Kevin dives into the generated code. As with a lot of generated code, Relay’s code is a bit messy compared to hand-written composables, and it relies on a library full of Figma-defined composables, but the code works!
Ban Markovic is back, exploring an edgy topic: borders. While Compose UI offers
border() modifier, it draws the border around an entire shape. Ban wanted
a border on just one side (the bottom) and demonstrates how to implement that using
Other Interesting Links
- Jetpack Compose - Recompositions
- Compose by example: BoxWithConstraints
- Medium: Message Bar Compose — My First Open-Source Library on Github!
- Podcast: Compose vs XML – Which one should you learn as an Android Dev?
- Video: How to add Baseline Profiles
- Medium: Exploring AnimatedContent and Crossfade in Jetpack Compose
- How to Create Gradient Background in Android Jetpack Compose
- CompositionLocal in Jetpack Compose
- The color of Composable functions
- How To Make A Custom Bottom Navigation In Jetpack Compose Android Studio
- Medium: Constraint Layout in Jetpack Compose with Examples
- Medium: Creating a Basic Language Learning App with Jetpack Compose #6- Basic Dictionary with Firestore
- Android Jetpack Compose – Implement Google AdMob Banners Ads
- Reddit: Jetpack Compose Architecture
- Android Jetpack Compose MVVM
- Getting started with Jetpack Compose
- Medium: As an Android developer, Things you need to know about Jetpack compose
- Get Started with Jetpack Compose Authentication, Part 1: Jetpack Compose Basics
100% pure code!
Jaewoong Eum wanted a blur effect, but the
blur() modifier does not work on
devices older than Android 12. Jaewoong’s library gives us a
composable to wrap another composable that we wish to blur.
Zeeshan Ali created a fingerpaint-style drawing surface, with supplied controls
for choosing brush colors and more. Simply add a
CanvasPainter() composable where
you want it, supplying a remembered
PainterController for interactions.
Other Interesting Links
- Gist: riggaroo / GradientAlongPathAnimation.kt (snippet to draw gradient on a path using tessellation)
- Gist: riggaroo / CompositingStrategyOffscreenExample.kt (demo of
- JeroKit (viewmodel-based navigation, etc.)
- GitHub: qamarelsafadi / ElasticView (pop effect)
- GitHub: jaikeerthick / Network-Image (image loader)
- GitHub: mhssn95 / compose-color-picker (family of color pickers)
- 2022-11-15: Compose 1.3.1 and 1.4.0-alpha02! Android Developer Summit! Android Worldwide! Relay! Permissions! Showcase views! And... a not-quite-complete autocomplete?!?
- 2022-11-08: Tables! Relay! Shaders! Intrinsics! Integration tests! Mocking composables! And... this newsletter is becoming buttoned down?!?
- 2022-11-01: Compose 1.3.0 stable! Android Dev Summit videos! State machines! Relay! And... someone set us up the BOM?!?