jetc.dev Newsletter Issue #247
Published: 2024-12-31
As 2024 wraps up, we look at scaffold pane sizes and weighty FlowRow()
uses. We
see how Meta is composing, how Compose can be decomposed, but not whether Meta is
decomposing. And we examine implementations of lighter-weight PDF rendering, customizable
drop shadows, and more.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Is Making Equal-Sized Panes a Pain?
ListDetailPaneScaffold()
offers a dual-pane experience on larger screens, but
it defaults to an 80/20 ratio between the panes. See how to have them be equally-sized,
on current and future versions of the adaptive library, in this week’s highlighted
Stack Overflow question.
Can I Use Weight in a FlowRow()
?
The answer is “yes, but it does not necessarily mean what you think it does”.
Learn more in this week’s highlighted Kotlinlang #compose
Slack thread.
Composable Commentary
Posts, videos, and other new information related to Jetpack Compose!
Compose Tips for Delightful UI — ’24 wrap up
Google’s Simona Milanović (Mastodon, Bluesky) and Rebecca Franks (Mastodon, Bluesky) published a summary of all the tips and tricks they discussed in their YouTube video series.
Podcast: Jetpack Compose at Meta
Meta built up quite the system of UI frameworks over the years… only to have Compose come along. In this podcast, the Instagram team responsible for large-scale migrations discuss the impact Compose had and how they coped.
Medium: Decomposing Jetpack Compose
Baiqin Wang wanted to understand more of what was going on inside of Compose when debugging composables. The result was Decomposer, a desktop tool to view the slot tables of your composables, among other things to see more “under the hood”.
Support Time to Take Action with Compose
Eevis Panula
(Mastodon, Bluesky)
is back, this time discussing the “time to take action” system setting.
This indicates how long temporary input affordances should appear, such as the
system volume slider. Eevis explains how we can use LocalAccessibilityManager
and its calculateRecommendedTimeoutMillis()
function to find out this duration, as
well as how to apply it.
Medium: Designing Android TV UIs with Jetpack Compose: Content Cards, Hero Elements, and Carousels
Sahar Asadian walks us through various TV Compose UI patterns and corresponding composables.
Capture composables in Jetpack Compose
Manpreet Kunnath
looks at the graphicsLayer.record()
technique for capturing a
composable to a bitmap, in particular seeing how well it works in Compose Multiplatform.
Other Interesting Links
- How to Request Location Permissions in Jetpack Compose: An Expert‘s Guide
- Jetpack Compose – five basic optimization methods
- Jetpack Compose: Shaping Your UI with Clipping and Masking
- Medium: Android Feature Flag Implementation with Firebase Remote Config + Kotlin Flow + Jetpack Compose
- Medium: Android Jetpack Compose Using MVI Architecture
- Medium: Difference between @Immutable and @Stable in Jetpack Compose
- Medium: How to Download, Render, and Display a PDF File in Android Jetpack Compose. (No Libraries, API 21+)
- Medium: Jetpack Compose Kotlin: Recomposition✨ — Part 2
- Medium: Jetpack compose — One Line trick for your
LazyColumn
- Medium: Mastering Recomposition in Jetpack Compose with Layout Inspector
- Medium: Snow Dialog Shader Tutorial
- Medium: Surviving Process Death Without Permanent Storage: Ephemeral Persistence for Both StateHolders and ViewModels
- Medium: Type Safe Deep Links in Compose
Resource Roundup
100% pure code!
GitHub: Bhuvaneshw / PdfViewer
GitHub user Bhuvaneshw has created a PdfViewer()
composable based
on WebView
and Mozilla’s PDF.js. This
should be less heavyweight than native code renderers yet handle many more
PDFs than the platform PdfRenderer
does.
GitHub: LennartEgb / compose-shadow
Lennart Egbers brings us a boxShadow()
modifier for fully-configurable
drop shadows and inner shadows, aiming for Figma compatibility.
GitHub: kavi707 / kv-android-color-pallet
Kavimal Wijewardana offers another implementation of theme generation based on a supplied input color.
GitHub: AdamDawi / ScratchCardCompose
GitHub user AdamDawi released a ScratchCard()
composable that uses masking
to simulate a scratch-off card, backed by an image that you supply.
GitHub: terrakok / AdaptiveStack
GitHub user terrakok created HorizontalAdaptiveStack()
and
VerticalAdaptiveStack()
composables that change their orientation based
on available screen space.
…And One More Thing
If you follow the Gregorian calendar (or compatible ones), Happy New Year’s Eve!
Or, you can subscribe to the Atom feed or follow Mark Murphy in the Fediverse.
Recent Issues:
- 2024-12-31: Scaffold panes! Weights and FlowRow()! TV Compose! PDF rendering! Drop shadows! And... is it time to take action?!?
- 2024-12-24: Compose Multiplatform update! Type-safe navigation! Camera! Hot reload! @Preview generator! And... a library of libraries?!?
- 2024-12-17: Compose and Wear Compose alphas! Tom Colvin on camera apps! Kevin Schildhorn on multiplatform adaptive layouts! And... do we really want to know what the "X" is in "Android XR"?!?