Remove NodeBuilder to ensure that Params and Callback are always provided.

This commit is contained in:
Benoit Marty 2025-10-30 11:37:59 +01:00 committed by Benoit Marty
parent 5197154f54
commit 566515ca88
115 changed files with 954 additions and 1174 deletions

View file

@ -77,11 +77,12 @@ class BugReportFlowNode(
val params = ViewFolderEntryPoint.Params(
rootPath = navTarget.rootPath,
)
viewFolderEntryPoint
.nodeBuilder(this, buildContext)
.params(params)
.callback(callback)
.build()
viewFolderEntryPoint.createNode(
parentNode = this,
buildContext = buildContext,
params = params,
callback = callback,
)
}
}
}

View file

@ -9,7 +9,6 @@ package io.element.android.features.rageshake.impl.bugreport
import com.bumble.appyx.core.modality.BuildContext
import com.bumble.appyx.core.node.Node
import com.bumble.appyx.core.plugin.Plugin
import dev.zacsweers.metro.AppScope
import dev.zacsweers.metro.ContributesBinding
import io.element.android.features.rageshake.api.bugreport.BugReportEntryPoint
@ -17,18 +16,7 @@ import io.element.android.libraries.architecture.createNode
@ContributesBinding(AppScope::class)
class DefaultBugReportEntryPoint : BugReportEntryPoint {
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): BugReportEntryPoint.NodeBuilder {
val plugins = ArrayList<Plugin>()
return object : BugReportEntryPoint.NodeBuilder {
override fun callback(callback: BugReportEntryPoint.Callback): BugReportEntryPoint.NodeBuilder {
plugins += callback
return this
}
override fun build(): Node {
return parentNode.createNode<BugReportFlowNode>(buildContext, plugins)
}
}
override fun createNode(parentNode: Node, buildContext: BuildContext, callback: BugReportEntryPoint.Callback): Node {
return parentNode.createNode<BugReportFlowNode>(buildContext, listOf(callback))
}
}