jetc.dev Newsletter Issue #107
This week, we peek at
1.2.0-alpha05 and see how much optimization we need to worry
about in our
Canvas composables. We look at permissions, Glance, and animations.
We see a seemingly infinite number of color pickers and a way to help detect
overcomposing. And I hope for some “how do we
do this in Compose UI?” love for the long tail of Android UI elements.
Reviewing the release notes for the latest Jetpack Compose update!
1.2.0-alpha05 came out, with:
Support for coroutines 1.6.0
Documentation for some Gradle options for getting metrics and reports from the Compose compiler
A change to have
includeFontPaddingbe disabled by default
Support for the “animator duration scale” value in Developer Options
A refactoring of
LazyHorizontalGrid()into a new
One Off the Stack, One Off the Slack
You’ve got questions. That’s understandable!
Slider() is an easy way to implement a
SeekBar-style UI, but by default it returns
a value between
1f. If you wish for a more convenient range of values,
valueRange parameter, as we see in this week’s highlighted Stack Overflow
We were told to worry about allocating objects in custom views, particularly in
and similar methods. Learn about whether that is a concern in Compose UI in this
week’s highlighted Kotlinlang
#compose Slack thread.
Posts, videos, and other new information related to Jetpack Compose!
Marcel Pintó wrote a FAQ for applying Glance to your app widgets, covering things like how Glance ties into the app widget XML metadata, what level of control you have over the look of the app widget, and how you publish updates to the app widget content.
Stephen Vinouze returns, this time looking at having multiple animations tie together
in time, including sequential and parallel animations. Stephen demonstrates using
delay() for controlling the timing and sequence of events.
The current Compose for Web is style-agnostic, insofar as it helps you generate HTML without necessarily imposing any particular style on that HTML. Amr Yousef walks through the setup for using Tailwind CSS in conjunction with Compose for Web and applying Tailwind styles to your composables.
100% pure code!
Colton Idle and theapache64 highlighted a particular Compose UI snippet from Google.
This defines a
recomposeHighlighter() modifier “that draws a border around elements that are recomposing”.
This can help you identify overcomposing, where elements are being recomposed more
often than you might expect.
…And One More Thing
A lot of stuff has been written about converting ordinary UI elements from the
View-based system to composables, such as
Button. A fair amount
of material exists for converting various flavors of
to composables. All that is essential and wonderful.
There is a lot more to classic UI construction than that, though, and we are going to need information about converting those to Compose UI as well.
On a percentage basis, neither of those are common compared with
However, that still means that tens of thousands of apps use them, and some of those
are going to need to get converted to Compose UI. And for that, having existing
instructions or recipes will help.
If you have converted this sort of legacy UI to Compose UI, please consider writing something about it!
- 2024-02-20: Compose Multiplatform RCs! State! Nested scrolling! @firstname.lastname@example.org on Amper! Compose Cupertino! Compose... Hammer? And... we can memoize lambdas?!?
- 2024-02-13: Compiler 1.5.9! BOM 2024.02.00! New Glance libraries! @email@example.com on Circuit and Compose Multiplatform! Material3! Markdown! MVI! And... testing robots?!?
- 2024-02-06: A Compose Multiplatform survey and a patch! @firstname.lastname@example.org on font scaling! Modal bottom sheet close confirmation! Compose Multiplatform resources! Draggable items in lazy lists! And... @email@example.com talks to some Italians?!?