How Cicerone works: Router, CommandBuffer, and Navigator
masterCicerone follows a specific flow to ensure lifecycle-safe navigation:
- Presenter calls a navigation method on the
Router(e.g.,router.navigateTo(SomeScreen())). - Router converts the call into one or more
Commandobjects and sends them to theCommandBuffer. - CommandBuffer checks for an active
Navigator:- If a
Navigatoris active, it passes the commands to it immediately. - If no
Navigatoris active, it queues the commands and applies them once a newNavigatorbecomes active.
- If a
- Navigator processes the commands to perform the actual UI transition (e.g., Fragment transactions or Activity starts).