Skip to content

Releases: ikarenkov/Modo

v0.10.1

16 Nov 18:49
a319f38
Compare
Choose a tag to compare

Fixed and documented lifecycle propagation logic

Fixed logic of propagation resume event to child.

  • Now you can safely display system dialog and go back, screens will be moved to resume state, when before they stated in started state
  • When child is ready to be resumed, but parent is only in started state, child will be resumed as soon as parent moved to resumed state
  • Introduced documentation about Lifecycle

What's Changed

Full Changelog: v0.10.0...v0.10.1

v0.10.0

11 Oct 09:48
5c98776
Compare
Choose a tag to compare

Lifecycle Improvements and Workshop Updates

In this release, we've focused on fixing bugs and enhancing lifecycle management.

Animation and Screen Lifecycle

The major update: the resumed state now represents a screen that is fully displayed after all animations have completed.

Previous Behavior

When navigating with animations using ScreenTransition, ON_START and ON_RESUME events were triggered as soon as a screen's content became visible. Similarly, ON_PAUSE and ON_STOP were triggered as soon as the screen's content disappeared from the UI.

New Behavior

We’ve introduced a way to detect when animations start and finish for each screen via ON_RESUME and ON_PAUSE events:

  • ON_START and ON_STOP retain their previous behavior.
  • ON_RESUME is now called when the appearance animation finishes.
  • ON_PAUSE is now called when the disappearance animation begins.

What's Changed

Full Changelog: Compare v0.9.0...v0.10.0

v0.10.0-alpha2

24 Jul 14:24
ae85a1d
Compare
Choose a tag to compare
v0.10.0-alpha2 Pre-release
Pre-release

What's Changed

Full Changelog: v0.10.0-alpha1...v0.10.0-alpha2

v0.10.0-alpha1

10 Jul 16:25
566f1d9
Compare
Choose a tag to compare
v0.10.0-alpha1 Pre-release
Pre-release

What's Changed

  • Fixed Lifecycle support: now you can use DisposableEffect to observe lifecycle by @ikarenkov in #56

Full Changelog: v0.9.0...v0.10.0-alpha1

v0.9.0

07 Jul 19:43
844d0e1
Compare
Choose a tag to compare

πŸ’« 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

πŸ”„ State modification

Enhanced and simplified state modification!

  1. NavigationAction<NavigationState> - now action is defined by NavigationState, distinguishing actions for different ContainerScreens.
  2. ContainerScreen<NavigationState, NavigationAction> - now ContainerScreen is also defined by NavigationAction.
  3. 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

πŸ“š 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.

LazyList utils

We introduced screenItems and screenItem for convenient integration of your screens into LazyList (and pagers).

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.

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

⚠️ Migrations and deprecations

  • Modo.init - renamed and deprecated to prevent confusion. It has been renamed to Modo.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

Full Changelog: v0.8.0...v0.9.0

v0.9.0-rc1

10 Jun 09:28
96e43e2
Compare
Choose a tag to compare
v0.9.0-rc1 Pre-release
Pre-release

πŸ’« 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

πŸ”„ State modification

Enhanced and simplified state modification!

  1. NavigationAction<NavigationState> - now action is defined by NavigationState, distinguishing actions for different ContainerScreens.
  2. ContainerScreen<NavigationState, NavigationAction> - now ContainerScreen is also defined by NavigationAction.
  3. 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

πŸ“š 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

πŸ›£οΈ Integrations

Activity and Fragment

We introduced rememberRootScreen for Activity and Fragment, providing a convenient single-line integration of Modo. Documentation.

LazyList utils

We introduced screenItems and screenItem for convenient integration of your screens into LazyList (and pagers).

Stability for Screen, ContainerScreen, and NavigationContainer

  • Marked Screen, ContainerScreen, and NavigationContainer as stable by @ikarenkov in #46

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.

🦦 Other

⚠️ Migrations and deprecations

  • Modo.init - renamed and deprecated to prevent confusion. It has been renamed to Modo.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

Full Changelog: v0.8.0...v0.9.0-rc1

0.8.0 - Android support and animation bugfixes

31 Mar 10:01
19d44c7
Compare
Choose a tag to compare

Main changes

Android ViewModel and Lifecycle support!

We now have almost full support of Android ViewModel and Lifecycle, check out #35 for detailed diff! Changes:

  1. Introduced DisposableScreenEffect and LaunchedScreenEffect as an analogue of compose Effects, but linked with screen lifecycle.
  2. Fixed screen dependencies clear order, now it is FIFO.
  3. Upgraded androidxLifecycle to 2.7.0
  4. Fixed logic of clearing during the exit animation - now it clears on animation finish
  5. Supported Android ViewModelStoreOwner, LifecycleOwner.
  6. Added ModoDevOptions and assertion to prevent access to ScreenModelStore after screen was removed

Autogen: What's Changedx

  • stored codestyle in project by @ikarenkov in #27
  • check MODO_GRAPH for null by @trdelnk in #29
  • Screen lifecycle OnScreenRemoved callback by @ikarenkov in #28
  • Fixed Dialog state and wrong Composition Local providing by @ikarenkov in #30
  • Add sample for bottom sheet and changed dialog Api by @ikarenkov in #31
  • Update gradle, agp, uses varion catalog and build-logic by @ikarenkov in #34
  • First version of the android integration for the modo by @ikarenkov in #35

New Contributors

Full Changelog: v0.7.1...v0.8.0

0.7.1

28 Nov 17:16
Compare
Choose a tag to compare

🐞 Bug fix release

  • Fixes screen model clearing when screen removes from hierarchy #22. Thank @rcmkt for contribution!

0.7.0

25 Nov 15:17
4ae08ca
Compare
Choose a tag to compare

Modo 0.7.0 for Compose is available πŸŽ‰

🫣Breaking changes

πŸ“„ There is no support for Fragment anymore πŸ˜”

Fragments support would take lot of time and was a barrier for Compose development. Also there is no developer who can support modo-fragment. If you are interested in modo-fragment development write to the TG Chat

🧭 Modo compose

  1. New project artifact com.github.terrakok:modo-compose:${latest_version}"
  2. Api changes
    1. ContainerScreen and Screen - main classes to build your own navigation. There are several build in implementations of ContainerScreen like StackScreen and MultiScreen
    2. To integrate you screens structure to fragment you simply should use Modo Screen. Usually you just need StackScreen as root of your hierarchy.
    3. There is no Modo object for holding state anymore. State of Modo is just Container screen. Your are allowed to have as many RootScreens as you want simultaneously.
    4. ComposeRenderer has become internal.
  3. (Experimental) Dialog support! You can declare screen as dialog and simple put it in screens structure. There is know bug, when you pop back stack to dialog, then it loses it's state.
  4. Screen Model Support. You can use rememberScreenModel inside Composable fun to use screen model connected with Screen.
  5. ComposeRendererScope provides old and new state to let you create your own Wonderfull animations without limitations to stack state.

0.6.4

06 May 09:54
Compare
Choose a tag to compare

πŸ₯³ Modo supports Compose now!