Skip to content

//workflow/com.squareup.workflow1.ui/getFactoryForRendering

getFactoryForRendering

[androidJvm]
Content
@WorkflowUiExperimentalApi()

fun <RenderingT : Any> ViewRegistry.getFactoryForRendering(rendering: RenderingT): ViewFactory<RenderingT>
More info

This will be deprecated in favor of ScreenViewFactoryFinder.getViewFactoryForRendering very soon.

It is usually more convenient to use WorkflowViewStub or DecorativeViewFactory than to call this method directly.

Returns the ViewFactory that builds View instances suitable to display the given rendering, via subsequent calls to View.showRendering.

Prefers factories found via ViewRegistry.getFactoryFor. If that returns null, falls back to the factory provided by the rendering’s implementation of AndroidViewRendering.viewFactory, if there is one. Note that this means that a compile time AndroidViewRendering.viewFactory binding can be overridden at runtime.

Throws

java.lang.IllegalArgumentException

if no factory can be find for type RenderingT