Comments (2)
The tutorials are indeed out of date, but ScreenViewFactory and LayoutRunner aren't analogs.
Before Screen
and Overlay
were introduced:
- A
ViewFactory
would create aView
to be driven by aLayoutRunner
function to show renderings of a particular type. - These
ViewFactory
bindings had to be gathered at runtime inViewRegistry
collections. AndroidViewRendering
was introduced to allow a rendering to provide itsViewFactory
directly, avoiding theViewRegistry
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 aView
to be driven by aScreenViewRunner
function to show a particular type ofScreen
. - An
OverlayDialogFactory
creates aDialog
to show a particular type ofOverlay
. There is noDialog
analog toScreenViewRunner
. AndroidScreen
replacesAndroidViewRendering
, and an analagousAndroidOverlay
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).
from workflow-kotlin.
tl;dr: we should indeed update the tutorials to use non-deprecated interfaces, and also to encourage the use of AndroidScreen
.
from workflow-kotlin.
Related Issues (20)
- `ComposeView` and `IllegalStateException: You can consumeRestoredStateForKey only after super.onCreate of corresponding component` HOT 9
- Rework `ScreenViewFactoryFinder` s.t. it prefers `ViewRegistry` entries for the built in types too
- Consider open sourcing our wrappers for onbackpresseddispatcher HOT 2
- Remove mobile.dev integration
- Remove references to 'tick' from runtime in the tests.
- Consider providing access to the CoroutineScope in `initialState` HOT 1
- Side effects / Workers / LifecycleWorker methods not called if rendered/not rendered without ever yielding dispatch HOT 8
- `ComponentDialog.asDialogHolderWithContent` should provide decor view as container
- UI Test shards are flaky, perhaps interfering with each other? HOT 2
- Introduce `BackStackScreen.flatten()`
- Un-deprecate runningWorker for LifecycleWorker HOT 2
- SessionWorkflow throws when trying to unit test it with RenderTester#testRender
- Deprecate one/disambiguate between launchForTestingFromStart/StateWith and headlessIntegrationTest HOT 1
- Consider removing `ViewEnvironment` parameter from `RenderWorkflowIn`
- Offer config option to skip rendering when new state == old HOT 3
- Showing Overlay causes crash when using AnimatedContent to animate screens HOT 2
- RenderContext passed into StatefulWorkflow#render is new instance every time HOT 3
- Consider version of `initialState` that provides a `CoroutineScope` identical to the `WorkflowNode`'s HOT 9
- Deprecate `runningWorker` and add `@ReplaceWith` for `runningSideEffect` alternative
- Remove JMH Benchmarks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workflow-kotlin.