mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-11-02 12:07:28 +00:00
Remove context(parentNode: Node) and provide the parent Node as a parameter.
This commit is contained in:
+1
-1
@@ -17,8 +17,8 @@ import io.element.android.libraries.matrix.api.timeline.Timeline
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultSendLocationEntryPoint : SendLocationEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
timelineMode: Timeline.Mode,
|
||||
): Node {
|
||||
|
||||
+5
-2
@@ -16,8 +16,11 @@ import io.element.android.libraries.architecture.createNode
|
||||
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultShowLocationEntryPoint : ShowLocationEntryPoint {
|
||||
context(parentNode: Node)
|
||||
override fun createNode(buildContext: BuildContext, inputs: ShowLocationEntryPoint.Inputs): Node {
|
||||
override fun createNode(
|
||||
parentNode: Node,
|
||||
buildContext: BuildContext,
|
||||
inputs: ShowLocationEntryPoint.Inputs,
|
||||
): Node {
|
||||
return parentNode.createNode<ShowLocationNode>(buildContext, listOf(inputs))
|
||||
}
|
||||
}
|
||||
|
||||
+5
-6
@@ -47,12 +47,11 @@ class DefaultSendLocationEntryPointTest {
|
||||
)
|
||||
}
|
||||
val timelineMode = Timeline.Mode.Live
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
buildContext = BuildContext.root(null),
|
||||
timelineMode = timelineMode,
|
||||
)
|
||||
}
|
||||
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))
|
||||
}
|
||||
|
||||
+5
-6
@@ -47,12 +47,11 @@ class DefaultShowLocationEntryPointTest {
|
||||
location = Location(37.4219983, -122.084, 10f),
|
||||
description = "My location",
|
||||
)
|
||||
val result = with(parentNode) {
|
||||
entryPoint.createNode(
|
||||
buildContext = BuildContext.root(null),
|
||||
inputs = inputs,
|
||||
)
|
||||
}
|
||||
val result = entryPoint.createNode(
|
||||
parentNode = parentNode,
|
||||
buildContext = BuildContext.root(null),
|
||||
inputs = inputs,
|
||||
)
|
||||
assertThat(result).isInstanceOf(ShowLocationNode::class.java)
|
||||
assertThat(result.plugins).contains(inputs)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user