A bit of a continuation of yesterday, but I'm work...
# compose-android
c
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
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
Any chance you could use a Constraint/RelativeLayout?
It would be the best way to tell the compose content and the other view to be the same
c
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.