You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The tutorials are indeed out of date, but ScreenViewFactory and LayoutRunner aren't analogs.
Before Screen and Overlay were introduced:
A ViewFactory would create a View to be driven by a LayoutRunner function to show renderings of a particular type.
These ViewFactory bindings had to be gathered at runtime in ViewRegistry collections.
AndroidViewRendering was introduced to allow a rendering to provide its ViewFactory directly, avoiding the ViewRegistry boilerplate and runtime errors.
This year, the Screen and Overlay marker types were created, along with replacements for most of the above. This was done mainly to simplify Android Dialog management. Today:
A ScreenViewFactory creates a View to be driven by a ScreenViewRunner function to show a particular type of Screen.
An OverlayDialogFactory creates a Dialog to show a particular type of Overlay. There is no Dialog analog to ScreenViewRunner.
AndroidScreen replaces AndroidViewRendering, and an analagous AndroidOverlay has been introduced.
Both before and after, ViewRegistry is still available to allow runtime bindings between rendering types and the view system where needed. These runtime bindings can also be used to override those implemented via AndroidScreen and the like.
There are still shortcomings with the updated Workflow UI -- redundancy and assymetry between View and Dialog support, and some inefficieny in Compose support (#546). In 2023, I'm hoping to roll out VisualFactory as a simpler, more flexible replacement for most of the above (#874).
It seems that ScreenViewFactory is preferred over LayoutRunner these days. It would also be nice if the tutorial mentioned AndroidScreen as an alternative. This would align the tutorials with info here https://square.github.io/workflow/userguide/ui-in-code/#building-views-from-screens.
The text was updated successfully, but these errors were encountered: