A bit of a continuation of yesterday, but I'm working on an app that's equally View and Compose.
Currently I have the requirement to make 1 of my View the same size as my composable.
I'm setting my composable via
Copy code
binding.root.setContent
but now I'm kinda confused at how to best grab the width and height of my composable. I could just do something pretty rudimentary such as binding.root.height and width, but I'm getting a lot of jumpiness from that. Is there some other recomended way to grab height/width values of a composable so that I can set them to a view thats showing somewhere else on the screen?
r
romainguy
04/06/2023, 10:49 PM
What’s the problem with using the width/height of the
ComposeView
? Aside from the fact that you’ll have to wait for a full layout pass
romainguy
04/06/2023, 10:49 PM
Any chance you could use a Constraint/RelativeLayout?
romainguy
04/06/2023, 10:49 PM
It would be the best way to tell the compose content and the other view to be the same
c
Colton Idle
04/06/2023, 10:55 PM
I think my problem is that those values keep recomposing and so my view is acting sporadic. I have a feeling there might be something else at play.