jetc.dev Newsletter Issue #160
Published: 2023-04-11
This time around, we got a fresh April 2023 BOM for a patch release, plus
1.5.0-alpha02
with some more improvements to Compose.
We also spend a lot of time looking at HorizontalPager()
and VerticalPager()
.
We explore TVs and State
management. And we edit some Markdown, meaning that
in theory I could start composing these newsletters in Compose, writing Stack Overflow
answers in Compose, writing books in Compose…
(yes, I pretty much dream in Markdown at this point)
Ooooo… What Did We Get?
Reviewing the release notes for the latest Jetpack Compose update!
The Compose BOM is up to 2023.04.00
, which maps to 1.4.1
versions of most
of the Compose libraries. Those 1.4.1
libraries are mostly just bug fixes,
as one would expect from a patch release.
We also got 1.5.0-alpha02
. One big change is that now getValue()
operators
— used by property delegates — can themselves be marked as @Composable
.
Other changes include:
-
Support for Talkback and other accessibility services with
UrlAnnotation
inAnnotatedString
-
Support for fixed-size cells in
LazyGrid()
and fixed-size lanes inLazyStaggeredGrid()
-
Improvements to
SubcomposeLayout()
, supporting a lookahead API
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Why Is Paging 3 Not Caching?
Employing Paging for Compose is a bit tricky. Google’s Ian Lake helps one developer out, showing how creating new flows cause break the paging caches, in this week’s highlighted Stack Overflow question.
How Do We Override Fling Velocity?
More generally: how do we change composable behaviors when those behaviors are implemented
as private functions or objects? See a specific example, in the form of
overriding the velocity of DefaultFlingBehavior
, in this week’s highlighted
Kotlinlang #compose
Slack thread!
Composable Commentary
Posts, videos, and other new information related to Jetpack Compose!
Medium: Customizing Compose Pager with fun indicators and transitions
Google’s Rebecca Franks looks at HorizontalPager()
and VerticalPager()
.
Rebecca focuses on adding elaborate effects, such as fades rather than translations
as users switch pages, changing the content of the currently-selected page as
part of a transition, and creating custom page indicators.
Medium: Building Reddit Recap with Jetpack Compose on Android
Google’s Medium account is starting to publish guest posts! This one is from Aaron Oertel of Reddit, and it examines the implementation of Reddit Recap: a set of cards that depict how readers used Reddit over the previous year. Aaron especially explores how they set up all the animations, from simple swipes to 3D card rotations.
Video: Android Navigation Jetpack Compose
The Code with the Italians team hosted Google’s Ian Lake, taking a look at Navigation for Compose, including its strengths, where it might be headed, and what sorts of previous techniques it deprecates.
Setting up ViewPager in Jetpack Compose
As Rebecca Franks did, sinasamaki also looks at the new HorizontalPager()
and VerticalPager()
composables
added to Compose 1.4.0, including having different structures for composables for
different pages and controlling the initial state of the pager.
All about Google Accompanist
Alex Styl dives into Accompanist, Google’s playground for composables that maybe — just maybe — will one day be promoted into the official Compose libraries. Alex also mentions Horologist, Google’s equivalent experiments, but for Wear Compose.
Medium: Leanback to Jetpack Compose TV— A paradigm change in Android TV development
Umair Khalid compares and contrasts Google’s legacy TV UI (Leanback) with the nascent Compose for TV libraries.
Medium: Managing Compose State Variable With And Without ViewModel
Kamlesh Lakhani explores several different ways of tracking State
within a Compose
app, from remembering them in composables to holding them in viewmodels.
Medium: Simplify Your Styling: A Beginner’s Guide to Jetpack Compose Theming
Medium user Madhan examines MaterialTheme()
: how to define one, where the
code could reside, and how to have specific themes for specific types of composables.
Other Interesting Links
- Medium: Building Beautiful App Interfaces with Scaffold in Android
- Medium: Understanding the Role of State and Implement the Simplest Way of Managing State in Jetpack Compose UIs
- Medium: Android — Constraint Layout with Jetpack Compose
- Migrating Your Design System to Jetpack Compose Part 4: Stakeholder Retro
- Medium: Exploring the Latest Jetpack Compose Preview — A Deep Dive into Android’s UI Toolkit
- Medium: How the order of Modifiers matters with Jetpack Compose
- Medium: Android Generate Text to QR Code
- Medium: QR Scanner with ML Kit , Jetpack Compose
- Medium: Android Compose Horizontal pager with Indicator . Automated scroll!
- Medium: Android Compose Map and Location permission
- Medium: Jetpack Compose: 3 Do’s and Don’ts to Amp Up Your Android Dev Game!
- Medium: Creating Cohesive UI with Jetpack Compose: 10 Best Practices and Examples
- Building a Language Learning App with Compose – Part 4
- Complete Guide to Layouts in Compose - Android Jetpack Compose
- Medium: Making a Unbeatable Tic Tac Toe Bot in Jetpack Compose
- 5 Reasons Why Jetpack Compose is a Game-Changer for Android Development: A Comparison with Imperative Design Patterns
- Medium: Jetpack Compose Underhood
- Medium: How to display locations from Firestore on Google Maps using Jetpack Compose?
Resource Roundup
100% pure code!
GitHub: meetup / MarkdownTwain
The Meetup developers published a library that provides a Markdown editor, with a preview and syntax highlighting.
GitHub: ellsworthrw / DiamondCharts
Reed Ellsworth brings us a FunctionGraph()
composable for rendering graphs
and charts, complete with axis labels and gridlines.
GitHub: T8RIN / DynamicTheme
Malik Mukhametzyanov created a library that creates a dynamic theme based on wallpaper colors that works back to Android 5.0.
Other Interesting Links
- GitHub: razaghimahdi / Card-Drawer (side drawer)
- GitHub: TorryDo / Floating-Bubble-View (system-level floating bubbles)
Or, you can subscribe to the Atom feed or follow Mark Murphy in the Fediverse.
Recent Issues:
- 2024-12-10: A Compose Multiplatform alpha! Hot reload! Presentation! Sprites! Calendars!
- 2024-12-03: Rebecca Franks on clipping and masking! Stefano Natali on graphicsLayer()! FunkyMuse on type-safe nav results! And... if we have enough maps, do we need to store our maps in a Map?!?
- 2024-11-26: Math! Shared element transitions! Custom modifiers! Macrobenchmark! Adapting to platform-specific design systems! And... why does wrapContentSize() not wrap my content size?!?