3

what is the intended way to tackle subcontainer navigation with Flow on Android.

Let's say I have a couple of Screens where one works like a container screen itself - there I want to do some subnavigation (changing part of this screen).

I guess the Screen should serve as a temporal Flow.Dispatcher and proxy all Flow commands. How to do that? By calling Flow.setDispatcher I effectively replace the parent dispatcher, which is not intended. I guess creating a new Flow instance is not welcomed either, that should be an app wide singleton..?

simekadam
  • 7,334
  • 11
  • 56
  • 79

1 Answers1

1

This is the kind of scenario that https://github.com/square/flow/tree/master/flow-path was made for.

Life is best if you have a single app-wide instance of flow. We've tried it the other way, where a higher level flow has a screen that happens to be a container for a nested flow, and life gets pretty complicated pretty quickly.

rjrjr
  • 3,892
  • 1
  • 22
  • 18
  • Thanks for answering. I actually started having issues with my nested Flows too, so I rather started digging into how to somehow switch (or nest - that seems to be the way) containers to allow different subview structure, animations,.. And I'm already using these decoupled versions of flow+flow-path libraries. Still getting lost. Let's imagine one scenario related to flow-sample app. I have first Path as a fullscreen view. Then I have next one that serves rather as a masterdetail wrapper for another bunch of Paths. Is there any intended way how to do that? Or is it subject to my imagination:) – simekadam Apr 28 '15 at 06:02
  • Hey @rjrjr, any plans to make a similar sample available again? – Saket Feb 20 '18 at 06:09