Built to work with Jetpack Compose 1.1.1
Breaking changes
(1) Add AnimatedContentScope
and AnimatedVisiblityScope
in MaterialMotion.
MaterialMotion(
targetState = state,
- motionSpec = when (state.motionSpecType) {
- MotionSpecType.SharedAxis -> materialSharedAxisY()
- MotionSpecType.FadeThrough -> materialFadeThrough()
- }
+ motionSpec = {
+ when (targetState.motionSpecType) {
+ MotionSpecType.SharedAxis -> materialSharedAxisY()
+ MotionSpecType.FadeThrough -> materialFadeThrough()
+ }
+ }
) { currentState ->
(2) Add AnimatedContentScope
and AnimatedVisiblityScope
in MaterialMotionNavHost.
MaterialMotionNavHost(
navController,
startDestination = "library",
- enterMotionSpec = { _, _ -> translateXIn({ it }) },
- exitMotionSpec = { _, _ -> materialElevationScaleOut() },
- popEnterMotionSpec = { _, _ -> materialElevationScaleIn() },
- popExitMotionSpec = { _, _ -> translateXOut({ it }) }
+ enterMotionSpec = { translateXIn({ it }) },
+ exitMotionSpec = { materialElevationScaleOut() },
+ popEnterMotionSpec = { materialElevationScaleIn() },
+ popExitMotionSpec = { translateXOut({ it }) }
) {
composable(
"first",
- enterMotionSpec = { _, _ -> holdIn() },
- exitMotionSpec = { _, _ -> holdOut() },
+ enterMotionSpec = { holdIn() },
+ exitMotionSpec = { holdOut() },
) { ... }
navigation(
"second",
"subGraph",
- enterMotionSpec = { _, _ -> translateYIn({ it }) },
- exitMotionSpec = { _, _ -> translateYOut({ it }) },
+ enterMotionSpec = { translateYIn({ it }) },
+ exitMotionSpec = { translateYOut({ it }) },
) {
composable("second") { ... }
}
}
(3) Lambdas in Enter/ExitMotionSpec
factories have been moved to the last position in the param list.
- translateXIn({ it })
+ translateXIn { it }
- translateXOut({ it })
+ translateXOut { it }
- translateYIn({ it })
+ translateYIn { it }
- translateYOut({ it })
+ translateYOut { it }
Whatâs Changed
- Migrate buildSrc to Version Catalog (#143) @fornewid
- [Core] Graduate Enter/ExitMotionSpec from experimental (#140) @fornewid
- [Navigation] Add AnimatedContentScope and AnimatedVisiblityScope (#137) @fornewid
- Update to Android Gradle Plugin 7.1.3 (#138) @fornewid
- [Core] Support custom keys in MaterialMotion (#134) @fornewid
- [Core] Support
AnimatedContentScope
in MaterialMotion (#132) @fornewid
- [Navigation] Allow nested NavGraphs to take args and deeplinks (#130) @fornewid
- Make visible entries a set (#128) @fornewid
- Fix destination animations being ignored (#126) @fornewid
- [Navigation] Disallow null animations on MaterialMotionNavHost (#122) @fornewid
- Correcting the docs for Navigation (#124) @fornewid
Source code(tar.gz)
Source code(zip)