-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make scene provide an AnimatedContentScope to the composable content #312
Make scene provide an AnimatedContentScope to the composable content #312
Conversation
""", | ||
level = DeprecationLevel.WARNING, | ||
) | ||
internal fun sceneRouteWithoutAnimatedContent( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to do something like what androidx.navigation does here https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavGraphBuilder.kt;l=57-60?q=%22ComposeNavigator.Destination(provider%22 which calls this internal deprecated function here https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:navigation/navigation-compose/src/main/java/androidx/navigation/compose/ComposeNavigator.kt;l=106-110 but for them it worked because the API also changed in a meaningful way besides just adding the AnimatedContentScope.
In our case here if I add it as a secondary constructor then there's ambiguity between the two of them and it's impossible to differentiate between the two. So I opted for an internal deprecated function to exist solely for this purpose.
The reason |
This scope is the one that drives the navigation transition, which allows callers to use it to drive other animations inside the screen itself as it animates into or out of the NavHost. Notably, this allows callers to use the shared element transitions.
2c4d92d
to
e03b0f7
Compare
Thanks for the heads up, I ran |
Seems like there's a build issue, other than that this PR LGTM! |
The error message was a bit cryptic, but I think my latest commit addresses it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! LGTM!
Now we wait for the shared elements APIs to drop in multiplatform, and for SeekableTransition to also update to the new API which those apis rely on. |
This scope is the one that drives the navigation transition, which allows callers to use it to drive other animations inside the screen itself as it animates into or out of the NavHost.
Notably, this allows callers to use the shared element transitions.
My only one concern left here is that the
ComposeRoute
interface seems to have been public, even though callers probably had no reason to use the interface in a meaningful way, much less extend it so that this change would be a breaking API change for them. Am I missing something here? Should that change also happen in a backwards compatible way here? Please do let me know if it is the case and I can try and look further into that instead.Shared more thoughts here #308 (comment)