asDialogHolderWithContent

fun <C : Screen, O : ScreenOverlay<C>> ComponentDialog.asDialogHolderWithContent(overlay: O, environment: ViewEnvironment, setContent: (ScreenViewHolder<C>) -> Unit = { contentViewHolder -> setContentView(contentViewHolder.view) fixBackgroundAndDimming() }): OverlayDialogHolder<O>

Given a ComponentDialog, wrap it in an OverlayDialogHolder that can drive the Dialog's content via instances of a particular type of ScreenOverlay. This is the most convenient way to implement OverlayDialogFactory, see the kdoc there for complete details.

Dialogs managed this way are compatible with com.squareup.workflow1.ui.backPressedHandler, and honor the OverlayArea and CoveredByModal values placed in the ViewEnvironment by the standard BodyAndOverlaysScreen container.

Parameters

setContent

the function that sets the view built for C as the content of the ComponentDialog built for O. This is also a good hook for configuring the newly made dialog. The default calls ComponentDialog.setContentView and the fixBackgroundAndDimming extension function provided below.