Fixed
Status Update
Comments
ry...@google.com <ry...@google.com>
mo...@google.com <mo...@google.com>
ho...@google.com <ho...@google.com>
os...@google.com <os...@google.com>
os...@google.com <os...@google.com> #2
Thanks, we've identified a fix for this issue.
Will probably ship with 1.1.0-alpha06, but wait for the
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e96a5906fe40d87c5c35ed632db833acf99906b3
Author: Oscar Adame Vázquez <oscarad@google.com>
Date: Fri Dec 09 13:27:48 2022
Fix behavior when using Intrinsics with ConstraintLayout & MotionLayout
Intrinsics trigger secondary measure calls without recomposing.
ConstraintLayout was not updating its size properly since the assumption
was that it was only necessary if the constraints changed or the content
is recomposed, none of which happen with Intrinsic measurement.
MotionLayout would attempt to call measure on outdated Measurables,
causing a crash since the mapping of Widgets to Measurables is only
done if the content recomposed. The fix was also applied to
ConstraintLayout since it's a safer pattern.
Fixes: 220527863
Test: added respectective test cases
Change-Id: I487ae6fcc36342cee7fe38428971c27500be0b23
M constraintlayout/constraintlayout-compose/src/androidAndroidTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt
M constraintlayout/constraintlayout-compose/src/androidAndroidTest/kotlin/androidx/constraintlayout/compose/MotionLayoutTest.kt
M constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt
M constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintSet.kt
M constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionMeasurer.kt
https://android-review.googlesource.com/2336999
Branch: androidx-main
commit e96a5906fe40d87c5c35ed632db833acf99906b3
Author: Oscar Adame Vázquez <oscarad@google.com>
Date: Fri Dec 09 13:27:48 2022
Fix behavior when using Intrinsics with ConstraintLayout & MotionLayout
Intrinsics trigger secondary measure calls without recomposing.
ConstraintLayout was not updating its size properly since the assumption
was that it was only necessary if the constraints changed or the content
is recomposed, none of which happen with Intrinsic measurement.
MotionLayout would attempt to call measure on outdated Measurables,
causing a crash since the mapping of Widgets to Measurables is only
done if the content recomposed. The fix was also applied to
ConstraintLayout since it's a safer pattern.
Fixes: 220527863
Test: added respectective test cases
Change-Id: I487ae6fcc36342cee7fe38428971c27500be0b23
M constraintlayout/constraintlayout-compose/src/androidAndroidTest/kotlin/androidx/constraintlayout/compose/ConstraintLayoutTest.kt
M constraintlayout/constraintlayout-compose/src/androidAndroidTest/kotlin/androidx/constraintlayout/compose/MotionLayoutTest.kt
M constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintLayout.kt
M constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/ConstraintSet.kt
M constraintlayout/constraintlayout-compose/src/androidMain/kotlin/androidx/constraintlayout/compose/MotionMeasurer.kt
pr...@google.com <pr...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha06
Description
Jetpack Compose release version: 1.1.0
Android Studio Build: Bumblebee 2021.1.1 Patch 1
Kotlin version: 1.6.10
Steps to Reproduce:
Then the result is shown in attachment: the ConstraintLayout do not apply the fillMaxWidth modifier and it's always centered in parent.