WorkflowRendering

fun WorkflowRendering(rendering: Screen, viewEnvironment: ViewEnvironment, modifier: Modifier = Modifier)

Renders rendering into the composition using this ViewEnvironment's ScreenViewFactoryFinder to generate the view.

This function fulfills a similar role as ScreenViewHolder and WorkflowViewStub, but is much more convenient to use from Composable functions. Note that, just as with ScreenViewHolder and WorkflowViewStub, it doesn't matter whether the factory registered for the rendering is using classic Android views or Compose.

Example

data class FramedRendering<R : Any>(
val borderColor: Color,
val child: R
) : ComposeRendering {

@Composable override fun Content(viewEnvironment: ViewEnvironment) {
Surface(border = Border(borderColor, 8.dp)) {
WorkflowRendering(child, viewEnvironment)
}
}
}

Parameters

rendering

The workflow rendering to display.

modifier

A Modifier that will be applied to composable used to show rendering.

Throws

if no factory can be found for rendering's type.