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
- 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?!?