Releases: raamcosta/compose-destinations
Releases · raamcosta/compose-destinations
1.0.0-beta - Usability and internals improved 🙌
NEW FEATURES:
- Support Parcelable, Serializable and Enums navigation arguments 🎉
- Support to disable NavGraphs generation and create your own to have more control on some less common scenarios. This enables multiple
DestinationsNavHost
since you can now declare multiple top-levelNavGraph
s. - Support to manually call specific Destination Composables enabling passing NavHost level components to those specific screens.
- Added extension functions of NavGraphBuilder to make it possible to use original NavHost Composables instead of DestinationsNavHost.
SETUP CHANGES:
- Jetpack Compose Navigation is now a transitive dependency of this library. This means you don't need to add that dependency in your gradle build if you include this library.
- Accompanist Navigation-Animation and Accompanist Navigation-Material are now also transitive dependencies of the "animations-core".
So if you plan to have animated transitions between screens or Bottom Sheet screens, you don't need to include those dependencies.
Simply replace the "normal core" with "animations-core". Check the README setup section.
API CHANGES:
DestinationsNavHost
now has a mandatory parameter:NavGraph
. This is partly due to the feature of disablingNavGraphs
generation (which means we can't always know there is aNavGraph
with the name "root") but also because this is more explicit what navigation graph is being used to populate thatDestinationsNavHost
.- Animations-core contains a
AnimatedNavHostEngine
which you'll need to get callingrememberAnimatedNavHostEngine
and pass toDestinationsNavHost
. TherememberAnimatedNavHostEngine
call accepts aDefaultAnimationParams
for animations that will be applied to all screen transitions (that don't override it) and accepts a lambda that allows you to override the default for specific nested navigation graphs (also overridable by screen viastyle
parameter ofDestination
annotation).
0.9.4-beta
Done
- Changes to accommodate accompanist 0.21.2-beta
API changes
- Due to changes in accompanist navigation animation dependency, we have to define animations in a slightly different way:
BEFORE
object SomeScreenDestinationAnimations : AnimatedDestinationStyle {
override fun AnimatedContentScope<String>.enterTransition(
initial: Destination?,
target: Destination?
): EnterTransition? {
return when (initial) {
SomeOtherScreenDestination ->
slideInHorizontally(
initialOffsetX = { 1000 },
animationSpec = tween(700)
)
else -> null
}
}
//...
AFTER
object SomeScreenDestinationAnimations : DestinationStyle.Animated {
override fun AnimatedContentScope<NavBackStackEntry>.enterTransition(): EnterTransition? {
return when (initialState.navDestination) {
SomeOtherScreenDestination ->
slideInHorizontally(
initialOffsetX = { 1000 },
animationSpec = tween(700)
)
else -> null
}
}
//...
Notes:
- Changed supertype interface from
AnimatedDestinationStyle
toDestinationStyle.Animated
- Methods signature reciver changed to
AnimatedContentScope<NavBackStackEntry>
- Methods signature don't have parameters; you can get the initial and target destinations by
initialState.navDestination
andtargetState.navDestination
- You can check a commit to a file on the sample app where made these changes here
Known compatibility with
- androidx.navigation:navigation-compose:2.4.0-beta02
- androidx.compose.ui:ui:1.1.0-beta02
- com.google.accompanist:accompanist-navigation-material:0.21.2-beta
- com.google.accompanist:accompanist-navigation-animation:0.21.2-beta
0.9.2-beta - HOTFIX
Done:
- Fixed an issue when not using accompanist dependencies. (Thanks @StephanSchuster 👍 )
- Fixed an issue when passing components with generics types to annotated Composables via
dependenciesContainerBuilder
.
Known compatibility with:
option1:
- androidx.navigation:navigation-compose:2.4.0-beta01
- androidx.compose.ui:ui:1.1.0-beta01
- com.google.accompanist:accompanist-navigation-material:0.21.0-beta
- com.google.accompanist:accompanist-navigation-animation:0.21.0-beta
option2:
- androidx.navigation:navigation-compose:2.4.0-alpha10
- androidx.compose.ui:ui:1.0.4
- com.google.accompanist:accompanist-navigation-material:0.20.0
- com.google.accompanist:accompanist-navigation-animation:0.20.0
0.9.1-beta
Done:
- Improved safety of route building when the destination has navigation arguments, according to issue #16 (even though final approach was not exactly the suggested. Destinations are still
object
s)
API changes:
- When navigating to a destination with arguments:
BEFORE:
navigator.navigate(SomeDestination.withArgs(arg1 = "something", arg2 = "somethingElse"))
AFTER
navigator.navigate(SomeDestination(arg1 = "something", arg2 = "somethingElse"))
With this change, if a destination has navigation arguments, you cannot use the Destination object directly, you have to invoke it to get a Routed
object used in the navigate
method. Before if you'd do that, it would be a crash at runtime.
Known compatibility with:
option1:
- androidx.navigation:navigation-compose:2.4.0-beta01
- androidx.compose.ui:ui:1.1.0-beta01
- com.google.accompanist:accompanist-navigation-material:0.21.0-beta
- com.google.accompanist:accompanist-navigation-animation:0.21.0-beta
option2:
- androidx.navigation:navigation-compose:2.4.0-alpha10
- androidx.compose.ui:ui:1.0.4
- com.google.accompanist:accompanist-navigation-material:0.20.0
- com.google.accompanist:accompanist-navigation-animation:0.20.0
0.9.0-beta - First beta version 🎉
- Improved navigation arguments with default value support: users can now use constants, methods, etc as long as they're not private.
- Added support for passing any kind of component down to destinations from the
DestinationsNavHost
call level or above. - Added support for navigation arguments delegate class, for an alternative way to declare navigation arguments if not using them in the Composable itself.
API changes:
- Removed Scaffold support: users can do the same we do in the sample app. Check it here
- Destinations.NavHost() -> DestinationsNavHost()
- Destinations.rememberNavController() -> rememberDestinationsNavController()
- Destinations.NavGraphs -> NavGraphs
- You have to wrap your top-most composable with ModalBottomSheetLayout if you're using Accompanist Material for DestinationStyle.BottomSheet. You can check it here also
Known compatibility with:
option1:
- androidx.navigation:navigation-compose:2.4.0-beta01
- androidx.compose.ui:ui:1.1.0-beta01
- com.google.accompanist:accompanist-navigation-material:0.21.0-beta
- com.google.accompanist:accompanist-navigation-animation:0.21.0-beta
option2:
- androidx.navigation:navigation-compose:2.4.0-alpha10
- androidx.compose.ui:ui:1.0.4
- com.google.accompanist:accompanist-navigation-material:0.20.0
- com.google.accompanist:accompanist-navigation-animation:0.20.0
0.8.4-alpha05
- Updated kotlin, KSP, compose and accompanist
- Augmented DestinationsNavigator functionalities
Known compatibility with:
- androidx.navigation:navigation-compose:2.4.0-alpha10
- androidx.compose.ui:ui:1.0.4
- androidx.compose.material:material:1.0.4
- com.google.accompanist:accompanist-navigation-material:0.20.0
- com.google.accompanist:accompanist-navigation-animation:0.20.0
0.8.3-alpha05
- Hotfixed issue with builds with no accompanist navigation dependency
Known compatibility with:
- androidx.navigation:navigation-compose:2.4.0-alpha10
- androidx.compose.ui:ui:1.0.3
- androidx.compose.material:material:1.0.3
- com.google.accompanist:accompanist-navigation-material:0.19.0
- com.google.accompanist:accompanist-navigation-animation:0.19.0
0.8.2-alpha05
- Added
NavHostController
as a possible argument type for annotated Composables - Added
AnimatedVisibilityScope
as a possible receiver of all destinations that are not dialog or bottom sheet styled when using accompanist animation - Improved errors with wrong setup
Known compatibility with:
- androidx.navigation:navigation-compose:2.4.0-alpha10
- androidx.compose.ui:ui:1.0.3
- androidx.compose.material:material:1.0.3
- com.google.accompanist:accompanist-navigation-material:0.19.0
- com.google.accompanist:accompanist-navigation-animation:0.19.0
0.8.1-alpha05
- Added support for avoiding duplicate navigation actions out of the box
Known compatibility with:
- androidx.navigation:navigation-compose:2.4.0-alpha10
- androidx.compose.ui:ui:1.0.3
- androidx.compose.material:material:1.0.3
- com.google.accompanist:accompanist-navigation-material:0.19.0
- com.google.accompanist:accompanist-navigation-animation:0.19.0
0.8.0-alpha05 - Accompanist Support
- Accompanist Navigation-Animation support
- Accompanist Material BottomSheet support
- Dialog Destinations support
- Routes are no longer mandatory, they'll default to snake case Composable name
- Refactored processors and their flow
- Fixed #5
- Fixed #8
- Fixed #9
- Added initial validations to make errors more informative
Known compatibility with:
- androidx.navigation:navigation-compose:2.4.0-alpha10
- androidx.compose.ui:ui:1.0.3
- androidx.compose.material:material:1.0.3
- com.google.accompanist:accompanist-navigation-material:0.19.0
- com.google.accompanist:accompanist-navigation-animation:0.19.0