How jeziellago/flownav works
FlowNav is an Android multi-module navigation library. Feature modules mark destination classes; the annotation processor records those destinations and builds an entry map for the application’s navigation module. After application initialization, callers navigate by destination key, avoiding direct feature-module dependencies. The router supports Activities, native Fragments, and the Android Navigation Component. The README documents all three modes; source excerpts show the registry-generation and fragment-routing internals, while Activity routing is represented by its indexed implementation. Unshown sample wiring is not inferred.
Main entry points: FlowNavApp.kt FlowNav app state · FlowNavProcessingStep.kt Processing step · FlowNavFragmentNavigation.kt Nav graph navigation · FlowNavFragmentRouter.kt Fragment router config
Components 16
Destination metadata
- Entry annotation
annotation/src/main/java/com/flownav/annotation/EntryFlowNav.kt - Main annotation
annotation/src/main/java/com/flownav/annotation/FlowNavMain.kt
Registry generation
- Annotation processor
processor/src/main/java/com/flownav/processor/FlowNavProcessor.kt - Processing step
processor/src/main/java/com/flownav/processor/FlowNavProcessingStep.kt - Actions builder
processor/src/main/java/com/flownav/processor/FlowNavActionsBuilder.kt - Generated entry map
processor/src/main/java/com/flownav/processor/FlowNavActionsBuilder.kt
Runtime routing
- FlowNav app state
router/src/main/java/com/flownav/router/FlowNavApp.kt - Activity routing
router/src/main/java/com/flownav/router/FlowNavRouter.kt - Native fragment routing
router/src/main/java/com/flownav/router/NativeFragmentRouter.kt - Fragment provider
router/src/main/java/com/flownav/router/FlowNavProvider.kt
Navigation Component
- Fragment router config
router/src/main/java/com/flownav/router/navcomp/FlowNavFragmentRouter.kt - Fragment navigation info
router/src/main/java/com/flownav/router/navcomp/FragmentNavInfo.kt - Nav graph navigation
router/src/main/java/com/flownav/router/navcomp/FlowNavFragmentNavigation.kt - Nav controller helpers
router/src/main/java/com/flownav/router/extension/NavControllerExtensions.kt
Other components
- Feature module
- Application startup
Connections 17
- Feature module → Entry annotation: marks destinations
README.md - Feature module → Main annotation: marks app entry
README.md - Annotation processor → Processing step: creates step
processor/src/main/java/com/flownav/processor/FlowNavProcessor.kt - Processing step → Entry annotation: processes
processor/src/main/java/com/flownav/processor/FlowNavProcessingStep.kt - Processing step → Main annotation: processes
processor/src/main/java/com/flownav/processor/FlowNavProcessingStep.kt - Processing step → Actions builder: writes entries
processor/src/main/java/com/flownav/processor/FlowNavProcessingStep.kt - Actions builder → Generated entry map: generates
processor/src/main/java/com/flownav/processor/FlowNavActionsBuilder.kt - Application startup → FlowNav app state: initializes
README.md - Generated entry map → FlowNav app state: supplies entry map
README.md - Activity routing → FlowNav app state: looks up destination
router/src/main/java/com/flownav/router/FlowNavRouter.kt - Native fragment routing → FlowNav app state: looks up destination
router/src/main/java/com/flownav/router/NativeFragmentRouter.kt - Native fragment routing → Fragment provider: requests fragment
router/src/main/java/com/flownav/router/NativeFragmentRouter.kt - Fragment router config → FlowNav app state: looks up destinations
router/src/main/java/com/flownav/router/navcomp/FlowNavFragmentRouter.kt - Fragment router config → Fragment navigation info: creates config
router/src/main/java/com/flownav/router/navcomp/FlowNavFragmentRouter.kt - Nav graph navigation → Fragment router config: builds graph from
router/src/main/java/com/flownav/router/navcomp/FlowNavFragmentNavigation.kt - Nav graph navigation → FlowNav app state: looks up destination
router/src/main/java/com/flownav/router/navcomp/FlowNavFragmentNavigation.kt - Nav graph navigation → Nav controller helpers: uses graph helper
router/src/main/java/com/flownav/router/navcomp/FlowNavFragmentNavigation.kt