Skip to content
/ Modo Public

Navigation library based on UDF principles

Notifications You must be signed in to change notification settings

ikarenkov/Modo

Repository files navigation

Modo - State-Based Jetpack Compose Navigation

Maven Central latest stable Maven Central latest License: MIT

Modo is a simple and convenient state-based navigation library for Jetpack Compose.

Modo.overview.mp4

Check out our website to get the most up-to-date information about the library:

Navigation is a Graph

Each integration of Modo is a rooted tree (wiki) that can be displayed as follows: modo graph

  • Each node is a Screen or ContainerScreen.
  • Leaf nodes are Screens.
  • Inner nodes are ContainerScreens. They can contain other Screens or ContainerScreens in their navigationState.
  • The root node is a RootScreen. 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<State, Action>.
    • To update the state, use dispatch(action: Action) on NavigationContainer, or use the built-in extension functions for StackScreen and MultiScreen.
  • 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 License

Copyright (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.