ScreenComposableFactory
A ViewRegistry.Entry that uses a Composable function to display ScreenT. This is the fundamental unit of Compose tooling in Workflow UI, the Compose analogue of ScreenViewFactory.
ScreenComposableFactory is also a bit cumbersome to use directly, so ComposeScreen is provided as a convenience. Most developers will have no reason to work with ScreenComposableFactory directly, or even be aware of it.
See ComposeScreen for a more complete description of using Compose to build a Workflow-based UI.
See WorkflowRendering to display a nested Screen from ComposeScreen.Content or from ScreenComposableFactory.Content
Use ScreenComposableFactory directly if you need to prevent your Screen rendering classes from depending on Compose at compile time.
Example:
val fooComposableFactory = ScreenComposableFactory { screen, _ ->
Text(screen.message)
}
val viewRegistry = ViewRegistry(fooComposableFactory, …)
val viewEnvironment = ViewEnvironment.EMPTY + viewRegistry
renderWorkflowIn(
workflow = MyWorkflow.mapRendering { it.withEnvironment(viewEnvironment) }
)
Functions
Convert a ScreenComposableFactory into a ScreenViewFactory by using a ComposeView to host ScreenComposableFactory.Content.
The composable content of this ScreenComposableFactory. This method will be called any time rendering changes. It is the Compose-based analogue of ScreenViewRunner.showRendering.