Pin setup: PR review

This commit is contained in:
ganfra
2023-10-12 16:19:24 +02:00
parent 17c12899f5
commit 1f4cf15088
4 changed files with 5 additions and 36 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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)

View File

@@ -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)
}
}