jetc.dev Newsletter Issue #184
The BOM was bumped, but not by much.
Elsewhere, we dive into how measuring and touch input dispatching work with composables. We examine Roborazzi and a Material3 implementation of pull-to-refresh. Plus, we look at a PDF viewer and a Compose Multiplatform charting library.
Ooooo… What Did We Get?
Reviewing the release notes for the latest Jetpack Compose update!
The Compose BOM got a bump to
2023.09.02, which maps to the
1.5.2 patch release,
which contains some crash fixes.
Also, JetBrains released
1.5.0-beta02 for Compose Multiplatform.
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
LaunchedEffect() is not magic. It still runs your code on the main application thread.
You remain subject to the rules of that thread, such as “do not block it indefinitely”.
Learn more in this week’s highlighted Stack Overflow question.
Usually mutable data, especially mutable remembered
State data, is the wrong
answer, because changes to the content of the mutable data do not trigger recompositions.
But, occasionally, you need to break the rules, such as when changing the
consumeWindowInsets(), as we see in this week’s highlighted Kotlinlang
Posts, videos, and other new information related to Jetpack Compose!
Pierre-Yves Ricau (of LeakCanary fame) explores the legendary Application Not Responding
(ANR) dialog, particularly for when it is triggered due to the app failing to respond to
touch events in a timely fashion. PY uses that to look at how touch events get dispatched in both the
View system and composables.
Andrei Mukomolov wanted pull-to-refresh in a Material3 project. That combination is not officially supported at this time. Andrei’s team cloned the Material implementation and adjusted it to use the Material3 design system, resulting in this library.
Stefano Natali examines Roborazzi, a Roboletric-integrated screenshot testing library for Android. Roborazzi lets you write your screenshot tests to run on the JVM, rather than in the emulator. Stefano shows us how to use Roborazzi to write screenshot tests of our composables.
Other Interesting Links
- A Guide to Layouts, Modifiers, and UI Components in Jetpack Compose
- Android Jetpack Compose – Dynamic Progress Bar with Text
- How to create a weather app in jetpack compose
- Medium: Android lifecycle in jetpack compose
- Medium: Composition Local In Jetpack Compose
- Medium: drawBehind , drawWithContent , drawWithCache Modifier In Jetpack Compose
- Medium: From Blank to Beautiful: Implementing Shimmer Effect in Compose
- Medium: Implementing the ScrollableTabRow in Jetpack Compose
- Medium: Jetpack Compose Tutorial Part 3
- Medium: Jetpack Compose ViewModel Update UI Using Flow
- Medium: Jetpack Compose — Cognitive overload II
- Medium: Make a simple “Slide to unlock” in Jetpack Compose
- Medium: Mastering Permissions in Jetpack Compose: A Step-by-Step Guide
- Medium: Reduce Recomposition for Images/Icons In Jetpack Compose
- Medium: SearchBar with Jetpack Compose and Material Design 3
- Medium: Simplifying State Management in Jetpack Compose: Effortless Flow Observation
- Medium: Solving the mystery of PropagateMinConstraints
- Medium: Understanding Effect Handlers in Jetpack Compose
- Medium: Using MPChartLib with Jetpack Compose
- Simplifying UI Development with Jetpack Compose
- Tab Layout in Material 3 Jetpack Compose (with Examples)
100% pure code!
GitHub user pratikksahu offers a library for viewing PDFs in composables, powered by
PdfRenderer. It supports horizontal and vertical paging, pinch-to-zoom,
rotating pages, and integrated sharing options.
Jack Boswell created a composition local-based system to allow a common
to host varying top bar actions. As you navigate, the composables for each screen can
post their own menu items, which trigger recomposition of the top app bar.
Lukas Roberts brings us a library that parses Open Graph metadata for a Web page and offers to builds a preview card for that page.
- 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?!?