WorkflowRendering

Renders rendering into the composition using the ViewEnvironment found in LocalWorkflowEnvironment to source a ScreenComposableFactoryFinder 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(
  val borderColor: Color,
  val child: R
) : ComposeRendering {

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

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.