-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduces fun Screen.deepMap(Screen): Screen
#1092
base: main
Are you sure you want to change the base?
Conversation
Introduces and uses `Screen`-specific subtypes of the `Container` and `Wrapper` interfaces. This allows the inroduction of `Screen.deepMap()`, which allows us to apply a transformation to the "real" `Screen`s collected in a `Container`, no matter how deeply wrapped they are.
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
package com.squareup.workflow1.ui | ||
|
||
@WorkflowUiExperimentalApi | ||
public interface VisualHolder<in RenderingT, out VisualT> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like some of the kdoc for VisualFactory.createOrNull
should be here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh. I think this and VisualHolder
leaked in from an unrelated PR.
*/ | ||
@WorkflowUiExperimentalApi | ||
public fun Screen.deepMap(transform: (Screen) -> Screen): Screen { | ||
return if (this is ScreenContainer<*>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know what? I don't know that ScreenContainer
is actually necessary for this. I'm going to put this PR back into draft.
-
ScreenContainer
probably isn't necessary.
context: ContextT, | ||
environment: ViewEnvironment, | ||
getFactory: (ViewEnvironment) -> VisualFactory<ContextT, Any, VisualT> | ||
): VisualHolder<RenderingT, VisualT>? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Unused, did this leak in from the work for Wrapper renderings introduce an extra AndroidView unnecessarily when the wrapped rendering's factory is a ComposeScreenViewFactory. #546?
Introduces and uses
Screen
-specific subtypes of theContainer
andWrapper
interfaces. This allows the inroduction ofScreen.deepMap()
, which allows us to apply a transformation to the "real"Screen
s collected in aContainer
, no matter how deeply wrapped they are.