Remove NodeBuilder to ensure that Params and Callback are always provided.
This commit is contained in:
parent
be03c50aaf
commit
02dc71c4c3
115 changed files with 954 additions and 1174 deletions
|
|
@ -17,16 +17,14 @@ import io.element.android.libraries.matrix.api.timeline.Timeline
|
|||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultSendLocationEntryPoint : SendLocationEntryPoint {
|
||||
override fun builder(timelineMode: Timeline.Mode): SendLocationEntryPoint.Builder {
|
||||
return Builder(timelineMode)
|
||||
}
|
||||
|
||||
class Builder(private val timelineMode: Timeline.Mode) : SendLocationEntryPoint.Builder {
|
||||
override fun build(parentNode: Node, buildContext: BuildContext): Node {
|
||||
return parentNode.createNode<SendLocationNode>(
|
||||
buildContext = buildContext,
|
||||
plugins = listOf(SendLocationNode.Inputs(timelineMode))
|
||||
)
|
||||
}
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
timelineMode: Timeline.Mode,
|
||||
): Node {
|
||||
return parentNode.createNode<SendLocationNode>(
|
||||
buildContext = buildContext,
|
||||
plugins = listOf(SendLocationNode.Inputs(timelineMode))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,8 +47,11 @@ class DefaultSendLocationEntryPointTest {
|
|||
)
|
||||
}
|
||||
val timelineMode = Timeline.Mode.Live
|
||||
val result = entryPoint.builder(timelineMode)
|
||||
.build(parentNode, BuildContext.root(null))
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
timelineMode = timelineMode,
|
||||
)
|
||||
assertThat(result).isInstanceOf(SendLocationNode::class.java)
|
||||
assertThat(result.plugins).contains(SendLocationNode.Inputs(timelineMode))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue