jetc.dev Newsletter Issue #248

Published: 2025-01-07

It is a short newsletter this week, owing to the holidays in a lot of the world. But, we look at responsive grids, display styled strings, pick at a couple of pickers, and render composables to PDFs. Plus, I grumble (again) about the state of custom design systems.

One Off the Stack, One Off the Slack

You’ve got questions. That’s understandable!

How Can I Have Navigation Within a Sheet?

If you are using Navigation for Compose, and you want to have navigation (e.g., multiple “screens”) within a bottom sheet, the right answer is to have a separate NavHost for that from your main screen NavHost. See (a little) more in this week’s highlighted Stack Overflow question.

If Not this then, Then What?

Many custom Modifier examples show this then as part of adding the new modifier to the chain. Depending on how you are creating that custom Modifier, though, the then is either essential or superfluous, as we see in this week’s highlighted Kotlinlang #compose Slack thread.

Composable Commentary

Posts, videos, and other new information related to Jetpack Compose!

Medium: Responsive Grid Layout in Jetpack Compose: Adapting to Screen Sizes and Orientations

Farman Ullah Marwat walks us through how to modify our use of LazyVerticalGrid() based on the form factor of the device it is displayed upon, in particular using BoxWithConstraints().

Medium: How to Display Styled Strings in Jetpack Compose

Joseph James shows how to convert a Spanned into an AnnotatedString. Given that, Android string resources with markup can be used in Compose apps.

Compose Design Systems: Have a Plan

Over in my CommonsWare blog, I wrote about a certain class of Compose support question that we get a lot, and what that says about design systems and choices surrounding them.

Resource Roundup

100% pure code!

GitHub: Kudl1k / datetimepicker-kmp

Stepan Kudlacek created a DatePicker() composable for Compose Multiplatform, supporting date and date range selection with a month-based picker.

GitHub: Seo-4d696b75 / compose-m3-picker

GitHub use Seo-4d696b75 contributed Picker() and NumberPicker() composables, for Compose for Android using the vertical-scrolling pattern seen on iOS.

Gist: logickoder / ComposePdfExporter.kt

Jeffery Orazulike demonstrates how to export a composable first to a bitmap, then to a PDF, by means of Android’s PDF support.

Notable Releases

Maps for Compose released 6.4.1, fixing a Polygon bug.