jetc.dev Newsletter Issue #154
This week, we explore the limits of infinity and the instability of words.
(OK, perhaps those items are not quite that profound)
In addition, we get a double helping of videos featuring Rebecca Franks, examine a framework for errors, and spend a lot of time on modifiers. And we see a slick QR code composable plus a Kotlin/Multiplatform starter project.
Also, one update regarding this passage from last week’s issue:
Compose Runtime Tracing is up to
1.0.0-alpha02, though it is unclear if any tooling exists to use it.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
A question that has come up ever since the original
ViewPager widget is:
how can I have a pager with infinite pages? Infinity is a really big number ,
so the standard trick is to substitute something smaller, but big enough that the
user will never swipe that far. See how that applies to
HorizontalPager() in this
week’s highlighted Stack Overflow question.
It feels like
CharSequence ought to be marked as
@Stable, given that a
is stable. But, not every
CharSequence is stable (think
the ramifications in this week’s highlighted Kotlinlang
#compose Slack thread.
Posts, videos, and other new information related to Jetpack Compose!
Google’s Jolanda Verhoef is back, this time looking at how the order of modifiers matters and why that order matters for the measurement and placement of composable content. Jolanda also covers this subject in the associated YouTube video.
Google’s Rebecca Franks also appeared in a Code with the Italians episode, which also looks at drawing APIs, animated effects, and more, all in the context of the JetLagged sample app.
Google’s Chris Arriola walks us through migrating a classic
View-based app to
one using Compose, showing how Google accomplished this with
the Sunflower sample app. Chris reviews
the screen-at-a-time approach for migration, where composables replace views as
the contents of fragments, allowing you to eventually eliminate those fragments
once the entire UI is made up of composables.
Marius Mora Bosch looks at presenting errors to users in Compose UI and SwiftUI. Marius recommends treating errors as state, updating that state as needed once the error no longer needs to be presented. Wrapped around that concept is a declarative error architecture for describing how errors should be managed.
Jorge Castillo contributed a post
to Alex Styl’s blog, exploring the
layout() modifier, including use cases, internal
implementation, and how other modifiers (like
padding()) are built atop
In this post, Özgür Taş applies the Paging Compose library to an app, one that
displays GitHub users pulled from GitHub’s Web service API. The post also explores
collectAsLazyPagingItems() to render the paged data in a
with some unit tests as well!
Other Interesting Links
- Consuming Compose for iOS in a SwiftUI application
- Medium: Avoid applying modifiers to the provided modifier
- Getting Started with Jetpack Compose
- Foldable-aware app layout
- Medium: Dependency Injection Guide with Dagger-Hilt and Jetpack Compose
- How to Test Your Compose UI
- Medium: Jetpack Compose Lifecycle
- Medium: Declarative Form Validation with Jetpack Compose
- Medium: Navigation in Jetpack Compose Android
- Medium: [Part 3] Jetpack Compose — Migration of Component View (Input Text) on Existing Layout
- Medium: Remove Ripple Effect from Clickable and Toggleable Widget In Jetpack Compose
- Medium: Gaining focus in Jetpack Compose and a small issue in Modifier API to be careful about
- My process for creating Custom Jetpack compose Components
- Image URL to Bitmap using Coil in Jetpack Compose
- Medium: Lists — the old way vs the new way with Android Compose
100% pure code!
GitHub user lightsparkdev published a QR code rendering library with a
composable. You can choose the colors for rendering the QR code in addition to
wrapping the QR code around a central composable (e.g., for an icon in the center).
Vivek Singh gives us a
Seeker() composable for a seek bar UI designed for media
playback, such as a podcast or video. In particular, it shows a “read-ahead” indicator
to illustrate how much content is downloaded already. It also offers the ability to
divide the seek range into segments, perhaps to correspond to segments in the media
(e.g., sections of a video).
- 2023-09-12: Compose 1.5.1! Glance 1.0.0! Compose Multiplatform! Themes! Photos! Coachmarks! A bit of CommonsWare history! And @email@example.com tells us what not to do!
- 2023-09-05: Compose Compiler 1.5.3! Compose Multiplatform 1.5.0! @firstname.lastname@example.org on greyscaling composables! @email@example.com 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?!?