Remove context(parentNode: Node) and provide the parent Node as a parameter.

This commit is contained in:
Benoit Marty 2025-10-31 12:04:57 +01:00
parent 45400d70d2
commit e70d767183
161 changed files with 668 additions and 436 deletions

View file

@ -17,8 +17,11 @@ import io.element.android.libraries.mediaviewer.impl.gallery.root.MediaGalleryFl
@ContributesBinding(AppScope::class)
class DefaultMediaGalleryEntryPoint : MediaGalleryEntryPoint {
context(parentNode: Node)
override fun createNode(buildContext: BuildContext, callback: MediaGalleryEntryPoint.Callback): Node {
override fun createNode(
parentNode: Node,
buildContext: BuildContext,
callback: MediaGalleryEntryPoint.Callback,
): Node {
return parentNode.createNode<MediaGalleryFlowNode>(
buildContext = buildContext,
plugins = listOf(callback),

View file

@ -48,8 +48,8 @@ class DefaultMediaViewerEntryPoint : MediaViewerEntryPoint {
)
}
context(parentNode: Node)
override fun createNode(
parentNode: Node,
buildContext: BuildContext,
params: MediaViewerEntryPoint.Params,
callback: MediaViewerEntryPoint.Callback,

View file

@ -125,6 +125,7 @@ class MediaGalleryFlowNode(
}
}
mediaViewerEntryPoint.createNode(
parentNode = this,
buildContext = buildContext,
params = MediaViewerEntryPoint.Params(
mode = navTarget.mode,