💫 Big update with stability and flexibility improvements
🔲 Dialogs
Custom dialogs
We introduced the ability to create custom dialogs without using the Dialog
composable. This feature adds the dialog's content over the non-dialog content of your StackScreen
. You can do so by providing the configuration in your dialog:
class SampleDialog(
private val systemDialog: Boolean = true,
override val screenKey: ScreenKey = generateScreenKey()
) : DialogScreen {
override fun provideDialogConfig(): DialogScreen.DialogConfig = if (systemDialog) {
DialogScreen.DialogConfig.System(
useSystemDim = true,
dialogProperties = DialogProperties(
usePlatformDefaultWidth = true,
decorFitsSystemWindows = true
)
)
} else {
DialogScreen.DialogConfig.Custom
}
}
Permanent dialogs
You can mark a dialog as permanent to prevent it from hiding when a new dialog appears on top of it:
class SamplePermanentDialog(
override val screenKey: ScreenKey = generateScreenKey()
) : DialogScreen {
override val permanentDialog: Boolean get() = true
...
}
DialogPlaceHolder
We introduced the provideDialogPlaceholderScreen
function for StackScreen
to provide animations for appearing dialogs. By default, it is just an empty full-screen composable.
PRs
- Ability to use custom dialogs without a system wrapper by @etaskaevhh in #33
- Dialog improvements by @ikarenkov in #36
🔄 State modification
Enhanced and simplified state modification!
NavigationAction<NavigationState>
- now action is defined byNavigationState
, distinguishing actions for different ContainerScreens.ContainerScreen<NavigationState, NavigationAction>
- nowContainerScreen
is also defined byNavigationAction
.- Custom actions - now you can create custom navigation actions in-place and define what they do without creating a custom reducer. To do so, use
ReducerAction<NavigationState>
:internal sealed interface RemovableItemContainerAction : ReducerAction<RemovableItemContainerState> { data object Remove : RemovableItemContainerAction { override fun reduce(oldState: RemovableItemContainerState): RemovableItemContainerState = oldState.copy(screen3 = null) } data object CreateScreen : RemovableItemContainerAction { override fun reduce(oldState: RemovableItemContainerState): RemovableItemContainerState = oldState.copy(screen3 = NestedScreen(canBeRemoved = true)) } }
PRs
- Reducer and NavigationAction improvements by @ikarenkov in #37
- Improved container screens implementation by @ikarenkov in #39
- Added clear stack action by @ikarenkov in #48
📚 Samples and Docs
We are happy to introduce our website with documentation!
We welcome any feedback and contributions! You can easily edit pages by clicking "edit" at the top of the page.
PRs
- Enhanced samples, added screen effects samples by @ikarenkov in #38
- Enhanced README and added a list of features and fixed sample package by @ikarenkov in #43
- Docs site setup by @ikarenkov in #49
- Improved existing topics and added new ones, added GitHub link, and changed structure by @ikarenkov in #50
- Updated version and documentation by @ikarenkov in #51
- Docs improvements by @ikarenkov in #52
🛣️ Integrations
Activity and Fragment
We introduced rememberRootScreen
for Activity and Fragment, providing a convenient single-line integration of Modo. Documentation.
- Modo integration improvements by @ikarenkov in #40
LazyList utils
We introduced screenItems
and screenItem
for convenient integration of your screens into LazyList
(and pagers).
- Added utils for easy LazyList integration by @ikarenkov in #45
Stability for Screen, ContainerScreen, and NavigationContainer
- Marked Screen, ContainerScreen, and NavigationContainer as stable by @ikarenkov in #46
ListNavigation
If you are seeking for list-based custom navigations, here are some convenient actions for state modification and some inheritance improvements.
- List navigation improvements by @ikarenkov in #55
Bug fixes
Now Modo.init
and Modo.getOrCreateRootScreen
return the same instance of the RootScreen
within a single process. Previously, a new instance was created, leading to problems if you injected RootScreen
or any of its children into a DI container.
- New Modo integration fix by @ikarenkov in #44
- Fixed crush for replace command. Covered with tests. Introduced including param for BackTo action. by @ikarenkov in #54
🦦 Other
- Static analysis setup by @ikarenkov in #41
- Rolled back Android versions by @ikarenkov in #42
⚠️ Migrations and deprecations
Modo.init
- renamed and deprecated to prevent confusion. It has been renamed toModo.getOrCreateRootScreen
to explicitly declare its behavior.Screen.OnScreenRemoved
- moved to another package, and the function from the old package is deprecated.com.github.terrakok.modo.model.OnScreenRemoved
->com.github.terrakok.modo.lifecycle.OnScreenRemoved
👯♀️ New Contributors
- @etaskaevhh made their first contribution in #33
Full Changelog: v0.8.0...v0.9.0