https://kotlinlang.org logo
#compose
Title
# compose
c

Colton Idle

03/21/2024, 10:16 AM
Compose artifacts updated yesterday 🎉 It's long, so putting it inside a thread 😅
very nice 4
jetpack compose 8
thank you color 2
K 6
1.6.4 stable of animation, foundation, material, runtime, ui • Seemingly small release • A long-press-then-drag selection gesture which moves out of the text’s layout bounds in the first frame of the drag no longer crashes. (Icdf90, b/325307463) 1.5.11 of compiler • Support for Kotlin 1.9.23 • Fix nested external generic types being inferred Unstable. (I3437f, b/327643787) • Support multiple stability configuration files. (I8db14, b/325326744) • Compose Compiler now correctly transforms overridden functions by recursively walking through base classes/overrides. (I2c9f9, b/316196500) • Ensure that function reference memoization doesn't try to capture implicit parents of local declarations when they are not used directly. (Ib1267) • Fix code generation for composable crossinline lambda (hard to encounter this bug without "nonSkippingGroupOptimization" enabled). (Icb2fd, b/325502738) 1.7.0-alpha05 of anim, foundation, material, runtime, ui
SeekableTransitionState
replaces
snapTo()
with
seekTo()
, and adds a
snapTo()
that immediately changes the state to a destination state without any kind of animation. • Removed experimental
LocalTextLinkStyle
composition local for styling hyperlinks. (Iebfa7) • Removed experimental override of
BasicText
with
onLinkClicked
argument. A replacement API for hyperlinks support will follow in the future. (I107d5) • Removed Codepoints related methods and properties under
TextFieldState
and
TextFieldBuffer
. Also removed the
inChars
suffixes from the remaining selection and composition related APIs. (Ief7ce) • `AnchoredDraggable`'s
currentValue
will now update when passing through an anchor point. Use
settledValue
to receive the previous
currentValue
semantics, only updating when settling at an anchor. The progress is now exposed as a function (requiring a starting and end point) instead of a property. (Ibe6e8, b/318707189, b/298271489, b/294991954) •
BasicTextField(state)
,
TextFieldState
,
InputTransformation
,
OutputTransformation
,
TextFieldLineLimits
,
TextFieldDecorator
are graduated to stable. (I9582b) • Introduced
InterceptPlatformTextInput
for helping write low-level IME-related tests and other low-level IME use cases.
PlatformTextInputTestOverride
has been deprecated. (I862ed, b/322680547) • Split
restrictedConstraints()
to two methods:
fitPrioritizingWidth()
and
fitPrioritizingHeight()
(I6d7fd) • Added 2 new API `isLastScrollForward`/`isLastScrollBackward` to check scroll direction for latest scroll action, return false if no scroll action yet. (I63a0e) • The
ScaffoldSubcomposeInMeasureFix
flag has been removed. (I67363) • Clear late changes on deactivated composition (5950bc) • Lots of graphics related stuff • Introduce new
GraphicsLayer
API to record drawing commands in a display list as well as additional properties that affect the rendering of the display list. This provides an isolation boundary to divide a complex scene into smaller pieces that can be updated individually of one another without recreating the entire scene. Transformations made to a
GraphicsLayer
can be done without re-recording the display list. Unlike
Modifier.graphicsLayer
,
GraphicsLayer
allows for rendering of Composable content elsewhere and is useful in animated use cases where content is expected to be rendered in different scenes. •
GraphicsLayer.draw(Canvas)
is not a public api anymore. Please use the
DrawScope.drawLayer(GraphicsLayer)
extension function instead to draw the layer. (I7a7c0) • Split
restrictedConstraints()
to two methods:
fitPrioritizingWidth()
and
fitPrioritizingHeight()
(I6d7fd) • Introduced
HardwareCanvas
stub for Android L usage (I1c3b5, b/288494724) • Update Compose framework to expose a
GraphicsContext
composition local alongside updating Owner,
DelegateableNode
and
drawWithCache
Modifier implementations to expose access to the
GraphicsContext
for scoped access that will automatically cleanup
GraphicsLayer
instances when Modifiers are torn down. (I64a2f, b/288494724) • Introduced
InterceptPlatformTextInput
for helping write low-level IME-related tests and other low-level IME use cases.
PlatformTextInputTestOverride
has been deprecated. (I862ed, b/322680547) •
GraphicsLayer.setOutline(Outline)
extension function was added. (Ib81f4) • Introduce
GraphicsContext
function constructor to create a factory to create
GraphicsLayer
instances (Ib98d6, b/288494724) • Exposed
GraphicsLayer
API to provide developer defined flexibility in capturing drawing commands that can be used to draw elsewhere and also apply different visual effects to the end result. (I80245, b/288494724) • Introduce the
Paragraph#getRangeForRect
which returns a range of text covered by a given rectangle area. (Iee516, b/325660505) • Removed experimental override of
BasicText
with
onLinkClicked
argument. A replacement API for hyperlinks support will follow in the future. (I107d5) • Added
GraphicsLayer
expect/actual API definition to support capturing and replaying of drawing commands with optional compositing visual effects and transforms. Introduce
GraphicsContext
interface to contain graphics dependencies including creation and management of
GraphicsLayer
instances. (I4a8d6, b/288494724) • Fixed an interop issue with 1D focus search where focus would get stuck inside a
ComposeView
that was embedded among other views. (I08fd4) •
LocalLifecycleOwner
moved from Compose UI to
lifecycle-runtime-compose
so that its Compose-based helper APIs can be used outside of Compose UI. Thanks Jake Wharton for the contribution. (I6c41b, b/328263448) • Consistently expose bias float properties on all bias-based alignment subtypes. (I69f0f, b/328088992) This is getting too long, so m3 1.3.0-alpha03 changes are here: https://developer.android.com/jetpack/androidx/releases/compose-material3#1.3.0-alpha03
s

Stylianos Gakis

03/21/2024, 10:20 AM
What the missing release notes say for those interested: • Now Compose cooks you breakfast and helps you get out of bed • Takes the kids to school for you • Solves all your financial problems
😂 1
🧠 1
c

Colton Idle

03/21/2024, 10:24 AM
Bonus: https://developer.android.com/jetpack/androidx/releases/lifecycle?s=09#2.8.0-alpha03
The
lifecycle-viewmodel
artifact and APIs like
ViewModel
,
ViewModelStore
,
ViewModelStoreOwner
, and
ViewModelProvider
are now shipped in artifacts compatible with Kotlin Multiplatform. (b/214568825)
🌟 2
K 2
s

Stylianos Gakis

03/21/2024, 10:24 AM
For the
GraphicsLayer
API, I asked here too https://androiddev.social/@gakisstylianos/112130559637680745 But I’m definitely curious to see it in action. It looks interesting but I think I’d need to see it used a bit to properly understand what it can do
1
m

MR3Y

03/21/2024, 1:14 PM
The new LazyRow/Column Item animations modifier is one use case of the
GraphicsLayer
API https://android-review.googlesource.com/c/platform/frameworks/support/+/2647907. my guess is that this was a blocker for them so, it took them so long to finally add this
animateItem
Modifier.
👀 2
4 Views