Hi all, I’m trying to run a fake layout pass and t...
# compose
g
Hi all, I’m trying to run a fake layout pass and then capture a screenshot in my test. I’m grabbing the root Window View, and then calling measure/layout/draw manually on it to get the bitmap in the size I want. The problem I’m running into is that subcomposed composables aren’t positioned correctly in my screenshots. In my specific case, I have a LazyList with 3 items. When I run the test, the 3 items are drawn on top of each other (instead of stacked vertically in a column) in the screenshot. (Screenshots in 🧵 ) Anyone know if there’s anything else I need to do to draw View/Composable content into a Bitmap correctly?
Looking through this code at the moment and it’s a lot more complicated than just calling
draw
, but it does draw correctly. Unfortunately it captures pixels from the Window which is what I’m trying to avoid because my Window is smaller than the content I’m trying to capture to a screenshot