Jorge Martín
11/10/2023, 9:50 PMSubcomposeLayout
, but the problem comes with point 3: to return to the ‘collapsed’ state I previously save the last height of the component in that state and I use it as an anchor point in the bottom sheet, but if the contents of the text field have changed in height, this anchor will be wrong and the animation will break.
I solved this issue in the past with Android views by changing the layout params of the sheet contents from wrap_content to fill_parent and measuring both states when I needed it, but I’m not sure if such a thing is possible in Compose: SubcomposeLayout
will only let you measure a node once, and MultiMeasureLayout
won’t let me modify the params of the composable sheet contents to make them switch from one mode to the other.
Does anyone have any suggestion on how this could be done? I guess in a worst case scenario I could have 2 measurables, duplicating the sheet contents, one for the wrap mode and another one for the full screen/expanded mode, but it’s not easy to handle and seem expensive performance-wise.efemoney
11/11/2023, 9:49 AMminLines
and the exact same styling and then the “real” TextField is allowed to be whatever height (by way of wrapContentHeight). Could remove the need to even monitor the bottom sheet height.Jorge Martín
11/11/2023, 12:01 PM