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 License: MIT

Modo is a simple and convenient state-base 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: modo graph

  • Each node - is a Screen or ContainerScreen
  • Leafs nodes - are Screens.
  • Inner nodes - are ContainerScreens. They can contain other Screens or ContainerScreens in their navigationState.
  • Root node - is a RootScreen. You can have multiply roots in your app. See How to integrate Modo for details.

State defines UI

  • NavigationState defines UI
    • Initial state is defined in constructor of ContainerScreen by navModel: NavModel<State, Action>
    • To update state, use dispatch(action: Action) on NavigationContainer, or build-in extension functions for StackScreen and MultiScreen
  • There are Screen and ContainerScreen
    • ContainerScreen can contain and render child screens
    • There are some build-in implementation 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.