jetc.dev Newsletter Issue #182
This week, we look at blueprints and borders, explore parallax and ripples, and try out libraries for steppers and swipe-to-reveal.
Ooooo… What Did We Get?
Reviewing the release notes for the latest Jetpack Compose update!
JetBrains’ Compose Multiplatform now has a
with support for Kotlin
1.9.20, more common Material3 components, a lot of improvements to iOS support,
and many bug fixes for iOS and desktop.
Also, Google’s official wrapper library for Maps is up to
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
When it comes to observing
State, what matters is the underlying type of an object,
not the type used for a variable or argument referencing the object. So, if you
SnapshotStateList but pass it around as a
List, state-change observation
still works, as we see in this week’s highlighted Stack Overflow question.
Sometimes, we might want to have a composable’s border be outside the composable itself,
border() modifier has the border be inside. That’s surprisingly complicated,
especially when bridging from Compose UI to external things like
Learn more in this week’s Kotlinlang
#compose Slack thread.
Posts, videos, and other new information related to Jetpack Compose!
After a summer break, the Code with the Italians team is back, bringing Google’s Roberto Orgiu with them. Together, they look at ways to improve your apps on tablets and foldables, both from the obvious (hey! usefully use the screen space!) to the less-obvious (keyboard support, tooltips, etc.)
Medium user mwcode walks us through a variety of ways to pass styling information down to intermediate and leaf composables: arguments, slot APIs, dedicated style-aware composables, and composition locals.
Anton Popov introduces us to the Blueprint library.
When enabled, such as via a debug drawer, or when used in
@Preview composables, it
draws size and padding information for composables on top of the composables itself,
to help you measure how your UI is actually being laid out.
Chris Banes demonstrates
ParallaxAlignment, a custom
Alignment implementation that
is scroll-aware and can implement a parallax effect. Chris shows how to use it both for images
Fergus Hewson examines how to customize the ripples used for click indicators in Compose UI. In particular, Fergus dives deeply into how to control the color of the ripple, despite several layers of Compose code trying hard to interfere with your efforts.
Medium user Ruthwik demonstrates how to have a border with a animated gradient for the
border color. This took two
Surface() composables (each with a
animateFloat(), and a
drawWithContent() modifier, eventually winding up with a
WebView wrapper composable has been deprecated, yet it seems like it
is still important. Kevin Zou has forked it and is looking to maintain that fork going
forward. This post looks at what the wrapper provides.
There are several JUnit test rules that we can use in our Compose UI Android instrumented
tests. Joe Birch compares and contrasts several of them: those created
Other Interesting Links
- Bottom Navigation with Screens in Jetpack Compose
- Medium: 3-step guide to adding emojis — Jetpack Emoji Picker
- Medium: Customize pull-to-refresh on Android with Jetpack Compose
- Medium: Designing a Login Screen with Validation using Jetpack Compose
- Medium: Intrinsic Measurements In Jetpack Compose
- Medium: Jetpack Compose: Anchored Draggable Item in MotionLayout Part 1
- Medium: Lottie With Jetpack Compose
- Medium: Mastering Multi-Tab Data Display with Jetpack Paging and Compose
- Medium: Simplifying Authentication with Google Sign-In in Jetpack Compose UI
100% pure code!
GitHub user myounis97 brings us a
Revealable() composable wrapper that gives
swipe-to-reveal functionality to whatever it wraps. It has slot APIs for the content
to be revealed on the start and/or end sides as the user swipes.
Binay Shaw offers another stepper composable, where you control the number of steps, the size of the circles representing each step, whether the steps are laid out horizontally or vertically, and more.
Other Interesting Links
- GitHub: aritra-tech / ComposeCards (credit card composables)
- GitHub: iideprived / OneTapSignIn (Google One-Tap Sign In dialog wrapper)
- GitHub: jemshit / GaugeChart (analog-style gauge chart)
- GitHub: joyner-perez / GoogleSignInButtonLibrary (Google sign-in buttons)
- GitHub: KaradimoulasG / Toasty (custom top toasts)
- GitHub: rwsbillyang / ComposeRouter (React-inspired nav library)
- GitHub: zeeshanali-k / Typist-CMP (typing animation for Compose Multiplatform)
- Gist: Zhuinden / BasicTextFieldWithCursorAtEnd.kt (text field with cursor starting at end of text)
- 2023-09-12: Compose 1.5.1! Glance 1.0.0! Compose Multiplatform! Themes! Photos! Coachmarks! A bit of CommonsWare history! And @firstname.lastname@example.org tells us what not to do!
- 2023-09-05: Compose Compiler 1.5.3! Compose Multiplatform 1.5.0! @email@example.com on greyscaling composables! @firstname.lastname@example.org on Espresso testing with Compose interop! Scrollbars! AnnotatedString!
- 2023-08-29: Compose Compiler 1.5.2! Compose and Wear Compose alphas! Capture composables to bitmaps! Testing! Recomposition! Compose Multiplatform! And... Accompanist is downsizing?!?