jetc.dev Newsletter Issue #88
This week, we try to make sense of
SubcomposeLayout() and janky lists. We
look at text entry validation, tooltips, and nested navigation.
Plus, Chris Banes tries to have an “Oprah moment” with your composables:
“You get a
Modifier! And you get a
Modifier! Everybody gets a
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
One of the more mystifying composables in the base Compose UI roster is
SubcomposeLayout()… in part because the verb “subcompose” is never defined.
Learn a bit more about
SubcomposeLayout() in this week’s highlighted
Stack Overflow question.
If you see X is behaving slowly, see whether you are recomposing it too often.
And, if so, see if you can rework your state access to reduce the frequency or breadth
of the recompositions. You can see more about how this works in this week’s highlighted
#compose Slack thread.
Posts, videos, and other new information related to Jetpack Compose!
Ideally, your users always provide valid input data. That… does not always work out. Siva Ganesh Kantamani demonstrates basic input validation and how to render errors for flawed entries in text fields.
Volodymyr Shcherbyuk explores the model-view-intent (MVI) unidirectional data flow
architecture and how one can implement it in Compose UI. Along the way, Volodymyr
@Immutable sealed classes for events and states, a Jetpack
implementing the “reducer” logic, event record/playback, and more!
Stevda-San brings us another screencast, this time examining nested navigation graphs with Navigation for Compose, particularly looking at how to use a nested graph for authentication screens, separate from the main app navigation graph.
Christopher Elias needed a line chart to show cryptocurrency prices. In this
post, Christopher shows us how to render that sort of chart directly using a
avoiding any of the various composable charting libraries.
Other Interesting Links
- Medium: Jetpack Compose with Single Activity Navigation
- Medium: The Interesting case of ViewTree*Owner
- Adopting Jetpack Compose: ComposeView
- Video: MVVM Architecture To do App in Jetpack Compose
- Medium: Jetpack Compose: filling max width or height
- Jetpack Compose Basics - Showing images
100% pure code!
I linked to Chris Banes’ Snapper library a couple of weeks ago, before it had
any documentation. Now that the documentation is available, it is worth another look!
Basically, if you have a
LazyColumn() and want fling gestures to
“snap” to a specific spot (e.g., an item is always centered in the available space),
Snapper may be your solution!
Amal Samally provides us with a small
Tooltip() composable, to display a short-term popup
near something else (e.g., near some other UI element that the user long-clicked upon).
Tooltips are particularly useful for icon-only buttons, so users have a way to find out
what the icon represents, if it is not obvious to them.
Other Interesting Links
- 2022-05-17: Google I|O 2022 videos! Compose beta01! Layout()! State! drawBehind()! Credit cards! App intros! And... what's a horologist?!?
- 2022-05-10: StateFlow vs. State! Design systems! MotionLayout! Text editing problems and solutions! And... modal sheets that are actually modal?!?
- 2022-05-03: @aditlal and @JorgeCastilloPr on design systems! KMP + Compose + SwiftUI! Dropdowns! FABs! And, what does Google I|O 2022 have in store for Compose UI developers?