Pin setup: PR review
This commit is contained in:
@@ -218,7 +218,7 @@ class LoggedInFlowNode @AssistedInject constructor(
|
||||
createNode<LoggedInNode>(buildContext)
|
||||
}
|
||||
NavTarget.LockPermanent -> {
|
||||
pinEntryPoint.nodeBuilder(this, buildContext).build()
|
||||
pinEntryPoint.createNode(this, buildContext)
|
||||
}
|
||||
NavTarget.RoomList -> {
|
||||
val callback = object : RoomListEntryPoint.Callback {
|
||||
|
||||
@@ -16,22 +16,6 @@
|
||||
|
||||
package io.element.android.features.pin.api
|
||||
|
||||
import com.bumble.appyx.core.modality.BuildContext
|
||||
import com.bumble.appyx.core.node.Node
|
||||
import com.bumble.appyx.core.plugin.Plugin
|
||||
import io.element.android.libraries.architecture.FeatureEntryPoint
|
||||
|
||||
interface PinEntryPoint : FeatureEntryPoint {
|
||||
|
||||
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder
|
||||
|
||||
interface NodeBuilder {
|
||||
fun callback(callback: Callback): NodeBuilder
|
||||
fun build(): Node
|
||||
}
|
||||
|
||||
interface Callback : Plugin {
|
||||
// Add your callbacks
|
||||
}
|
||||
}
|
||||
import io.element.android.libraries.architecture.SimpleFeatureEntryPoint
|
||||
|
||||
interface PinEntryPoint : SimpleFeatureEntryPoint
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// TODO: Remove once https://youtrack.jetbrains.com/issue/KTIJ-19369 is fixed
|
||||
@Suppress("DSL_SCOPE_VIOLATION")
|
||||
plugins {
|
||||
id("io.element.android-compose-library")
|
||||
alias(libs.plugins.anvil)
|
||||
|
||||
@@ -18,7 +18,6 @@ package io.element.android.features.pin.impl
|
||||
|
||||
import com.bumble.appyx.core.modality.BuildContext
|
||||
import com.bumble.appyx.core.node.Node
|
||||
import com.bumble.appyx.core.plugin.Plugin
|
||||
import com.squareup.anvil.annotations.ContributesBinding
|
||||
import io.element.android.features.pin.api.PinEntryPoint
|
||||
import io.element.android.libraries.architecture.createNode
|
||||
@@ -28,19 +27,7 @@ import javax.inject.Inject
|
||||
@ContributesBinding(AppScope::class)
|
||||
class DefaultPinEntryPoint @Inject constructor() : PinEntryPoint {
|
||||
|
||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): PinEntryPoint.NodeBuilder {
|
||||
val plugins = ArrayList<Plugin>()
|
||||
|
||||
return object : PinEntryPoint.NodeBuilder {
|
||||
|
||||
override fun callback(callback: PinEntryPoint.Callback): PinEntryPoint.NodeBuilder {
|
||||
plugins += callback
|
||||
return this
|
||||
}
|
||||
|
||||
override fun build(): Node {
|
||||
return parentNode.createNode<PinFlowNode>(buildContext, plugins)
|
||||
}
|
||||
}
|
||||
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
||||
return parentNode.createNode<PinFlowNode>(buildContext)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user