Skip to content

Commit 66f28f5

Browse files
committed
wip: moved ViewStarter back to a more proper home
1 parent cf3efb0 commit 66f28f5

File tree

2 files changed

+12
-21
lines changed

2 files changed

+12
-21
lines changed

workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/AndroidViewRegistry.kt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,19 @@ public fun <RenderingT : Any>
2626
)
2727
}
2828

29-
@Deprecated("Use getEntryFor()")
3029
@WorkflowUiExperimentalApi
30+
@Deprecated("Use ScreenViewHolder.Starter")
31+
public fun interface ViewStarter {
32+
/** Called from [View.start]. [doStart] must be invoked. */
33+
public fun startView(
34+
view: View,
35+
doStart: () -> Unit
36+
)
37+
}
38+
39+
@Suppress("DeprecatedCallableAddReplaceWith")
40+
@WorkflowUiExperimentalApi
41+
@Deprecated("Use getEntryFor()")
3142
public fun <RenderingT : Any> ViewRegistry.getFactoryFor(
3243
renderingType: KClass<out RenderingT>
3344
): ViewFactory<RenderingT>? {

workflow-ui/core-android/src/main/java/com/squareup/workflow1/ui/ScreenViewFactory.kt

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -148,26 +148,6 @@ public fun <ScreenT : Screen> ScreenT.buildView(
148148
)
149149
}
150150

151-
/**
152-
* A wrapper for the function invoked when [View.start] is called, allowing for
153-
* last second initialization of a newly built [View]. Provided via [Screen.buildView]
154-
* or [DecorativeScreenViewFactory.viewStarter].
155-
*
156-
* While [View.getRendering] may be called from [startView], it is not safe to
157-
* assume that the type of the rendering retrieved matches the type the view was
158-
* originally built to display. [ScreenViewFactory] instances can be wrapped, and
159-
* renderings can be mapped to other types.
160-
*/
161-
@WorkflowUiExperimentalApi
162-
@Deprecated("Use WorkflowView.Starter")
163-
public fun interface ViewStarter {
164-
/** Called from [View.start]. [doStart] must be invoked. */
165-
public fun startView(
166-
view: View,
167-
doStart: () -> Unit
168-
)
169-
}
170-
171151
@WorkflowUiExperimentalApi
172152
internal fun <ScreenT : Screen>
173153
ViewEnvironment.getViewFactoryForRendering(rendering: ScreenT): ScreenViewFactory<ScreenT> {

0 commit comments

Comments
 (0)