https://kotlinlang.org logo
#compose-android
Title
# compose-android
a

Alvin Dizon

10/21/2023, 9:00 AM
I just migrated from Accompanist's Navigation Compose Animation library to the official Jetpack lib. Is there no way to supply
enterTransition
or
exitTransition
animations to a
composable
that's created within a
NavGraphBuilder
? I used to be able to do
Copy code
fun NavGraphBuilder.settingsGraph(
    onUpButtonClicked: () -> Unit
) {
    navigation(
        route = "settings_route",
        startDestination = "settings_destination"
    ) {
        composable(
            route = SettingsNavigation.destination,
            enterTransition = { slideInHorizontally(initialOffsetX = { 1000 }) },
            exitTransition = { slideOutHorizontally(targetOffsetX = { 1000 }) }
        ) {
            // composable here
        }
    }
}
But it seems
enterTransition
and
exitTransition
is not available
i

Ian Lake

10/21/2023, 2:14 PM
That's absolutely supported, which would point to something wrong with your setup (e.g., using the wrong import or not actually updating to Navigation 2.7.X)
a

Alvin Dizon

10/22/2023, 1:13 PM
Thanks guys, will check if I have the correct import/version
3 Views