From 399bfdc5e630cbe53757135f734b528b4496df6b Mon Sep 17 00:00:00 2001 From: ganfra Date: Thu, 9 Mar 2023 17:54:35 +0100 Subject: [PATCH] Add small comments --- .../element/android/libraries/architecture/BackstackNode.kt | 5 +++++ .../android/libraries/architecture/FeatureEntryPoint.kt | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/BackstackNode.kt b/libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/BackstackNode.kt index 44aef63fda..ec607e9281 100644 --- a/libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/BackstackNode.kt +++ b/libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/BackstackNode.kt @@ -23,6 +23,11 @@ import com.bumble.appyx.core.node.ParentNode import com.bumble.appyx.core.plugin.Plugin import com.bumble.appyx.navmodel.backstack.BackStack +/** + * This class is just an helper for configuring a backstack directly in the constructor. + * With this we can more easily use constructor injection without having a secondary constructor to create the [BackStack] instance. + * Can be used instead of [ParentNode] in flow nodes. + */ @Stable abstract class BackstackNode( val backstack: BackStack, diff --git a/libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/FeatureEntryPoint.kt b/libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/FeatureEntryPoint.kt index 711f780b22..031bab7397 100644 --- a/libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/FeatureEntryPoint.kt +++ b/libraries/architecture/src/main/kotlin/io/element/android/libraries/architecture/FeatureEntryPoint.kt @@ -19,8 +19,14 @@ package io.element.android.libraries.architecture import com.bumble.appyx.core.modality.BuildContext import com.bumble.appyx.core.node.Node +/** + * This interface represents an entrypoint to a feature. Should be used to return the entrypoint node of the feature without exposing the internal types. + */ interface FeatureEntryPoint +/** + * Can be used when the feature only exposes a simple node without the need of plugins. + */ interface SimpleFeatureEntryPoint : FeatureEntryPoint { fun createNode(parentNode: Node, buildContext: BuildContext): Node }