Update dependencies
- KotlinX Coroutines
1.9.0-RC.2
. - AndroidX Lifecycle
2.8.4
. - AndroidX Compose Activity
1.9.1
. - AndroidX Annotation
1.8.2
.
Added
-
StackValidationMode: Introduced a new sealed interface
StackValidationMode
to handle
different stack validation modes in the navigation stack. This interface includes three
implementations:Strict
: Ensures the stack is always in a valid state and throws an exception if it transitions
to an invalid state.Lenient
: Ensures the stack is always in a valid state but takes no action if it transitions to
an invalid state.Warning
: Ensures the stack is always in a valid state and logs a warning if it transitions to
an invalid state.
-
NavHost: Added a new parameter
stackValidationMode: StackValidationMode
to theNavHost
composable.
Default value isStackValidationMode.Lenient
.NavHost( startRoute = LoginScreenRoute, destinations = AllDestinations, navEventNavigator = navigator, destinationChangedCallback = { currentRoute = it }, stackValidationMode = StackValidationMode.Warning.Debug, // <--- Set the stack validation mode )
Fixed
Lifecycle*Effect
completion is now idempotent (i.e., if theonStopOrDispose
was called because
of the Lifecycle being stopped, it won’t be called a second time upon disposal unless the
Lifecycle goes back up toSTARTED
again).