Compose Navigation Reimagined Versions Save

🌈 Type-safe navigation library for Jetpack Compose

1.5.0

9 months ago

This release contains the next changes:

  • Compatibility with Compose 1.5
  • Removed @ExperimentalAnimatedApi annotation from AnimatedNavHost, as the underlying AnimatedContent is now stable
  • BottomSheetNavHost stability fixes
  • NavBackHandler now has an optional allowEmptyBackstack parameter. This way NavBackHandler can be used with BottomSheetNavHost now (just set allowEmptyBackstack = true).
  • New API to access all current NavHostEntries through the NavHostState. This way two neighbour NavHosts may access each others state and entries.

Buy Me A Coffee

1.5.0-beta01

10 months ago

Fixed several similar issues related to BottomSheet not being hidden properly due to any kind of user interaction with the sheet.

1.5.0-alpha01

1 year ago

Support for pre-release versions of Compose 1.5.0

1.4.0

1 year ago

This release contains the next changes:

  • Compose updated to 1.4.0, Lifecycle dependencies updated to 2.6.1
  • Both NavHost and AnimatedNavHost provide optional modifier and contentAlignment parameters now
  • AnimatedNavHost doesn't queue incoming transitions by default anymore. It interrupts the running animation instead and immediately starts animating the new transition. However, this behaviour may be changed by specifying a new transitionQueueing parameter.
  • An optional enabled parameter is added to NavBackHandler
  • BottomSheetNavHost is migrated to SwipeableV2. This fixes lots of issues for it.
  • New reimagined-material3 module with Material 3 dependencies only
  • All previously deprecated classes and methods are finally removed

Breaking changes:

  • BottomSheetNavHost doesn't use Surface internally anymore. You need to define Surface inside BottomSheetNavHost manually:

    BottomSheetNavHost(/* ... */) { destination ->
        Surface(
            elevation = ModalBottomSheetDefaults.Elevation
         ) {
            when (destination) {
                /* ... */
            }
        }
    }
    

    This however allows better customization of bottom sheet surfaces for each destination.

  • NavHost now uses Box inside, so if you had previously put your NavHost inside a Box with propagateMinConstraints = true, e.g.:

    Box(propagateMinConstraints = true) {
        NavHost(/* ... */) { destination ->
            when (destination) {
                /* ... */
            }
        }
    }
    

    then you might consider moving this Box inside NavHost in order to get the same propagateMinConstraints effect:

    NavHost(/* ... */) { destination ->
        Box(propagateMinConstraints = true) {
            when (destination) {
                /* ... */
            }
        }
    }
    

1.3.1

1 year ago

This release introduces new API:

  • NavHostState is public now. It is possible to create it manually and set it into NavHost.
  • NavHostVisibility/NavHostAnimatedVisibility

The detailed description of both items is covered in this section of the documentation site.

1.3.0

1 year ago

This release contains the next changes:

  • Compose updated to 1.3.0
  • BottomSheetNavHost is available now in a separate reimagined-material artifact
  • New scoping NavHosts for easier ViewModel sharing. You can read more about them here.
  • Pending transition animations are properly queued now. This results in less visual artifacts for AnimatedNavHost when calling navigation methods while the animation is running.
  • Experimental BaseNavHost composable for implementing custom NavHosts

Breaking changes:

  • Long-deprecated setNewBackstackEntries method is finally hidden. Use setNewBackstack instead.

Deprecations:

  • AnimatedNavHostTransitionSpec is renamed to shorter NavTransitionSpec. The previous name is deprecated and type-aliased to the new name.

1.2.0

1 year ago

This release contains the next changes:

  • Compose updated to 1.2.1
  • androidx.lifecycle dependencies updated to 2.5.1
  • New API that gives the ability to access ViewModelStores of neighbour entries. This way some of the ViewModels may be easily shared between several screens. This API is available through NavHostScope inside of NavHost.
  • Support for CreationExtras from Lifecycle 2.5
  • other internal improvements/fixes and more test coverage

Breaking changes:

  • NavBackHandler's parameter navController is renamed to controller for consistency with other methods
  • NavId class' constructor is no longer public. It was never meant to be a part of public API.
  • NavAction abstract class is interface now

Deprecations:

  • NavComponentEntry is renamed to NavHostEntry. The old name is typealiased and deprecated.
  • onBackstackChange is deprecated. It is easily misused and error-prone. Use recommended Compose methods for listening and reacting to snapshot changes of backstack, e.g. snapshotFlow, derivedStateOf, etc.
  • navController delegate for SavedStateHandle is deprecated in favor of the official saveable delegate

1.1.1

1 year ago

This minor release contains the following changes:

  • androidx.lifecycle dependencies updated to 2.5.0
  • Kotlin is updated to 1.7.0
  • introduced a new artifact reimagined-hilt that contains a long awaited hiltViewModel() method compatible with this library. In order to use it add the dependency:
implementation("dev.olshevski.navigation:reimagined-hilt:1.1.1")

1.1.0

2 years ago

This release contains the following changes:

  • Compose is updated to 1.1.1
  • Fixed the issue when the lifecycle state is improperly set for an unchanged last entry
  • NavBackstack is now an Immutable class. Every time any navigation action is called the whole NavBackstack instance is changed. Now the API should look a bit more reasonable now.
  • setNewBackstackEntries is renamed to setNewBackstack. The old method is deprecated, but still works.
  • The sample app is reworked to be more structured and show different features independently. It is also fully covered with functional tests now.

Breaking changes:

  • Please make sure you are not saving instance of NavBackstack. The backstack property of NavController is backed up by MutableState and will notify compose of new instances of NavBackstack.

1.0.0

2 years ago

Finalized release 1.0.0

This release contains the following changes:

  • new navController delegate for SavedStateHandle for easy NavController creation and restoration
  • now all ViewModels with SavedStateHandle properly reconnect their SavedStateHandle to a new SavedStateRegistry after activity recreation

Breaking changes:

  • renamed upToPredicate parameter to predicate for popUpTo and replaceUpTo methods