Stylianos Gakis
12/05/2024, 4:03 PMSharedTransitionLayout
internally is unable to be queried for its intrinsic width/height?
I had a custom layout which was using intrinsic width to determine how to lay out some things. I happened to pass in a component which uses shared elements internally in there and it simply crashes 100% of the time.
edit: Filed b/382453608
The short version to repro this seems to be just this
Layout(
content = { SharedTransitionLayout { AnimatedContent() { ... } } },
) { measurables, constraints ->
val measurable = measurables[0]
measurable.maxIntrinsicWidth(constraints.maxHeight)
And the exception starts with... I will paste more in a thread.
java.lang.NullPointerException
at androidx.compose.animation.SkipToLookaheadNode.measure-3p2s80s(SharedTransitionScope.kt:1201)
at androidx.compose.ui.node.LayoutModifierNode$maxIntrinsicWidth$1.measure-3p2s80s(LayoutModifierNode.kt:89)
Stylianos Gakis
12/05/2024, 4:04 PMStylianos Gakis
12/10/2024, 3:04 PM