Is it a known limitation that a layout which is us...
# compose
s
Is it a known limitation that a layout which is using
SharedTransitionLayout
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
Copy code
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.
Copy code
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)
The full exception
Filed b/382453608 anyway, perhaps I can get an answer there. Minimal repro over at github
Quite funny that I happened to read this https://www.sinasamaki.com/animated-text-field-hint-in-jetpack-compose/ and our use case was more or less the exact same thing here. Using shared elements inside the decoration for a TextField. And we had that text field inside a custom layout which was querying for the intrinsic size of this text field.