Screen
or ContainerScreen
-* Leafs nodes - are Screen
s.
-* Inner nodes - are ContainerScreen
s. They can contain other Screen
s or ContainerScreen
s in
- their navigationState
.
-* Root node - is a RootScreen
. You can have multiply roots in your app. See How to integrate Modo for details.
+* Each node is a Screen
or ContainerScreen
.
+* Leaf nodes are Screen
s.
+* Inner nodes are ContainerScreen
s. They can contain other Screen
s or ContainerScreen
s 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
+## State Defines UI
-* `NavigationState` defines UI
- * Initial state is defined in constructor of `ContainerScreen` by `navModel: NavModel
-NavigationState
- class that can contains nested screens and other additional info. State can be updated by calling dispatch(action)
.
+NavigationState
- a class that can contain nested screens and other additional information. The state can be updated by calling dispatch(action)
.
-NavigationAction
- marker interface to distinguish actions for this container on specific State
. You can also use
-ReducerAction
for defining actions with update function in-place:
-NavigationAction
- a marker interface to distinguish actions for this container on a specific State
. You can also use
+ReducerAction
to define actions with an in-place update function:
+
-To update state of ContainerScreen
you must use dispatch(action: Action)
.
-There are 2 ways how to define you action:
-
ContainerScreen
implementation.
-ContainerScreen
implementation.
+- The list of available features in Modo: -
Sample | |||||||
Stack navigation | +Stack Navigation | ✅ | StackScreen, build-in commands | + href="%github_code_url%modo-compose/src/main/java/com/github/terrakok/modo/stack/StackActions.kt#L94">built-in commandsSampleStack, sample of navigation actions | |||
Multi screen navigation | +Multi-Screen Navigation | ✅ | MultiScreen, build-in + href="%github_code_url%modo-compose/src/main/java/com/github/terrakok/modo/multiscreen/MultiScreenActions.kt">built-in commands | SampleMultiscreen | @@ -42,12 +40,12 @@✅ | DialogScreen | Dialogs - playground | + Playground
✅ | -Arguments can be passed as constructor parameter of Screen. | +Arguments can be passed as a constructor parameter of Screen. | MainScreen | ||||
SampleStack | |||||||
Android lifecycle and view model | +Android Lifecycle and ViewModel | ✅ | -- ModoScreenAndroidAdapter - connect Modo with android-related features. + | ModoScreenAndroidAdapter + connects Modo with Android-related features. | -- MainScreen - AndroidViewModelSampleScreen.kt + | MainScreen, AndroidViewModelSampleScreen.kt | |
- Activity and fragment integration, process death handling - | +Activity and Fragment Integration, Process Death Handling | ✅ | -- Modo - | +Modo | ModoSampleActivity, ModoFragment.kt, ModoLegacyIntegrationActivity.kt @@ -86,20 +78,20 @@ | ||
✅ | -You can use LaunchedScreenEffect and DisposableScreenEffect analogies for Screen , it's linked
- to life time of a Screen . There is also LifecycleScreenEffect for easy observing lifecycle. See ScreenEffects for
- details.
+ | You can use LaunchedScreenEffect and DisposableScreenEffect analogs for Screen . These are
+ linked to the lifetime of a Screen . Additionally, LifecycleScreenEffect is available for easy lifecycle
+ observation. See ScreenEffects
+ for details.
|
ScreenEffectsSampleScreen.kt | ||||
Pager and LazyList integration | +Pager and LazyList Integration | ✅ | You can create custom ContainerScreen and use internal Screen inside Vertical/HorizontalPager
- and LazyRow/Column . It's vital to define key = {} lambda with InternalContent for correct
- integration. For more details take a look to the samples. LazyRow/Column. It is vital to define key = {} lambda with InternalContent for correct
+ integration. For more details, refer to the samples. LazyListUtils
|
StackInLazyColumnScreen.kt, @@ -108,4 +100,4 @@ |
ComposeView
and call setContent
on it. So don't forget to use
+ For Fragments, create a ComposeView
and call setContent
on it. Remember to use
ComposeView
for Fragment. Documentation reference.
+ for your ComposeView
in the Fragment. Documentation reference.
- UI of Modo navigation is defined by `NavigationState`. `NavigationState` - is a structure of `Screen`
- and `ContainerScreen`. You can easily change `NavigationState` depends on your needs from the any place of your application.
+ The UI of Modo navigation is defined by NavigationState
, which is a structure of Screen
+ and ContainerScreen
. You can easily modify NavigationState
to suit your needs from any part of your application.
stackNavigation.back()
StackScreen
. You can manually navigate back using stackNavigation.back()
Each integration of Modo is a rooted tree (wiki) that can be displayed: + summary="A rooted tree is a tree in which one vertex has been designated the root.">rooted tree (wiki) that can be displayed as + follows:
-Screen
or ContainerScreen
Screen
s.ContainerScreen
s. They can contain other Screen
s or ContainerScreen
s in
- their navigationState
.
+ Screen
or ContainerScreen
.Screen
s.ContainerScreen
s. They can contain other Screen
s or ContainerScreen
s in their
+ navigationState
.
RootScreen
. You can have multiply roots in your app. See How to integrate Modo for details.
+ RootScreen
. You can have multiple roots in your app. See How to integrate Modo for details.