Simon Sickle
01/14/2021, 9:41 PMval contentView = ComposeView(context = context).apply {
setContent {
... composable ...
}
createComposition() // since no window is bound
}
val generator = IconGenerator(context).apply {
setContentView(contentView)
}
val bitmap = generator.makeIcon()
If you debug the bitmap, you get a tiny (wrong size) drawing of the box’s shape, but not the entire rendered version of the shape.
The generator is simple, and basically calls
composeView.measure()
composeView.layout()
composeView.draw(canvas)
canvas.toBitmap()
Does anyone have ideas of what might cause compose view to skip rendering? Or where to look to more deeply understand how compose is working behind the scenes?