https://github.com/ikarenkov/Modo
Navigation library based on UDF principles
https://github.com/ikarenkov/Modo
android cicerone compose-navigation jetpack-compose jetpack-compose-navigation kmm kotlin navigation udf
Last synced: 3 months ago
JSON representation
Navigation library based on UDF principles
- Host: GitHub
- URL: https://github.com/ikarenkov/Modo
- Owner: ikarenkov
- Created: 2021-02-06T20:23:10.000Z (about 4 years ago)
- Default Branch: dev
- Last Pushed: 2024-11-16T18:49:00.000Z (5 months ago)
- Last Synced: 2025-01-10T11:59:50.339Z (3 months ago)
- Topics: android, cicerone, compose-navigation, jetpack-compose, jetpack-compose-navigation, kmm, kotlin, navigation, udf
- Language: Kotlin
- Homepage:
- Size: 35.9 MB
- Stars: 309
- Watchers: 13
- Forks: 18
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- jetpack-compose-awesome - Modo - Navigation library based on UDF principles (Articles / Navigation)
- jetpack-compose-awesome - Modo - Navigation library based on UDF principles (Articles / Navigation)
README
# [Modo](https://ikarenkov.github.io/Modo) - State-Based Jetpack Compose Navigation
[](https://central.sonatype.com/artifact/com.github.terrakok/modo-compose/0.10.1/overview)
[](https://central.sonatype.com/artifact/com.github.terrakok/modo-compose)
[](https://opensource.org/licenses/MIT)Modo is a simple and convenient state-based navigation library for Jetpack Compose.
https://github.com/ikarenkov/Modo/assets/17216532/e2977736-bdda-44a9-83f3-379731ddfecc
## [Project Website](https://ikarenkov.github.io/Modo)
Check out our website to get the most up-to-date information about the library:
* [**Modo Overview**](https://ikarenkov.github.io/Modo/modooverview.html)
* [**Quick Start Guide**](https://ikarenkov.github.io/Modo/quickstartguide.html)
* [**Core Concepts**](https://ikarenkov.github.io/Modo/core-concepts.html)
* [**How to Integrate Modo into Your App**](https://ikarenkov.github.io/Modo/how-to-integrate-modo-to-your-app.html)
* [**Features List**](https://ikarenkov.github.io/Modo/features.html)## Navigation is a Graph
Each integration of Modo is a
rooted tree (wiki) that can be displayed as follows:* Each node is a
Screen
orContainerScreen
.
* Leaf nodes areScreen
s.
* Inner nodes areContainerScreen
s. They can contain otherScreen
s orContainerScreen
s in their.
navigationState
* The root node is aRootScreen
. You can have multiple roots in your app.
See How to integrate Modo for details.## State Defines UI
* `NavigationState` defines the UI:
* The initial state is defined in the constructor of `ContainerScreen` by `navModel: NavModel`.
* To update the state, use `dispatch(action: Action)` on `NavigationContainer`, or use the built-in extension functions
for [StackScreen](modo-compose/src/main/java/com/github/terrakok/modo/stack/StackActions.kt)
and [MultiScreen](modo-compose/src/main/java/com/github/terrakok/modo/multiscreen/MultiScreenActions.kt).
* There are `Screen` and `ContainerScreen`:
* `ContainerScreen` can contain and render child screens.
* There are some built-in implementations of `ContainerScreen` like `StackScreen` and `MultiScreen`.
* You can easily create custom `Action` by extending `Action` or `ReducerAction`.# License
```
MIT LicenseCopyright (c) Konstantin Tskhovrebov (@terrakok)
and Karenkov Igor (@KarenkovID)Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```