Fixed
Status Update
Comments
je...@google.com <je...@google.com>
mo...@google.com <mo...@google.com>
fr...@gmail.com <fr...@gmail.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: Marcello Galhardo <
Link:
Add MutableStateSerializer
for serializing MutableState
Expand for full commit details
Add `MutableStateSerializer` for serializing `MutableState`
- Introduced an inline `MutableStateSerializer` function to infer and retrieve the appropriate `KSerializer` for `MutableState` of a serializable type.
- Added an overload of `MutableStateSerializer` that accepts an explicit `KSerializer` for the wrapped type, allowing for customizing the `KSerializer`.
- Implemented `MutableStateSerializerImpl`, a private class that handles the serialization and deserialization logic for `MutableState`, delegating inner value processing to the provided `KSerializer`.
- Only `KSerializer<MutableState<T>>` is exposed; the `MutableStateSerializerImpl` remains private.
RelNote: "Add `MutableStateSerializer` for serializing `androidx.compose.runtime.MutableState`."
Test: MutableStateSerializerTest
Bug: 378895074
Change-Id: Idfc489d9313461bddd0046052d0f6a41644e7712
Files:
- M
lifecycle/lifecycle-viewmodel-compose/api/current.txt
- M
lifecycle/lifecycle-viewmodel-compose/api/restricted_current.txt
- M
lifecycle/lifecycle-viewmodel-compose/build.gradle
- A
lifecycle/lifecycle-viewmodel-compose/src/androidInstrumentedTest/kotlin/androidx/lifecycle/viewmodel/compose/serialization/serializers/MutableStateSerializerTest.android.kt
- A
lifecycle/lifecycle-viewmodel-compose/src/commonMain/kotlin/androidx/lifecycle/viewmodel/compose/serialization/serializers/MutableStateSerializer.kt
Hash: d628386123647d7f90b6efb2ddde93621c7cc7db
Date: Fri Jan 17 11:18:40 2025
pr...@google.com <pr...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
Author: Marcello Galhardo <
Link:
Move KMP compatible test dependencies to commonTest
Expand for full commit details
Move KMP compatible test dependencies to `commonTest`
Test: N/A
Bug: 378895074
Change-Id: I77d03d1da41808e03d5e2978b768dc3ef6649211
Files:
- M
lifecycle/lifecycle-viewmodel-compose/build.gradle
Hash: e266fa197c54fe55955b2de9acc1c1d9894e6376
Date: Fri Jan 17 14:25:48 2025
Description
Jetpack Compose version: BOM 2024.05.00
Jetpack Compose component(s) used: Image
Android Studio Build: Jellyfish | 2023.3.1 Patch 2 #AI-233.14808.21.2331.11926650, built on June 4, 2024
Kotlin version: 1.9.23
My goal here is to have the colored box on the left match the height of the text, and for the image to be centered in the box.
However, I've discovered that applying a minWidth to the box causes it to gain height as if the image were being scaled to the box's minWidth. I'm not 100% sure, but it looks like the image's
requiredWidth
modifier isn't being accounted for in the intrinsic calculations when the image is a direct child of a Box. Wrapping the image in a Row fixes it, as does removing thedefaultMinSize
modifier on the Box. As you can see in the attached screenshot, it's the Box that has the extra height instead of the image, so that leads me to believe that the Image's intrinsics aren't working how I would expect. If I replace the Image with a Spacer, it also works correctly.I've attached a screenshot of the problem, as well as the image I used in my demo.
Component Summary:
Code: