Skip to content

0.9.4-beta

Compare
Choose a tag to compare
@raamcosta raamcosta released this 07 Nov 18:20
· 755 commits to main since this release

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 to DestinationStyle.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 and targetState.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