-
Notifications
You must be signed in to change notification settings - Fork 7
Fix transition for popped screen with custom transition #17
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
Conversation
# Conflicts: # guia/src/test/java/com/roudikk/guia/NavigatorTest.kt
|
Thanks for the PR ! I actually was working on a fix at b11a085. Basically, we should be running the logic in the when statement for the previous and new entry. To make sure both can have a fallback. Do you mind merging master to your branch and making sure that the custom key you added in the sample app still behaves as you expect? |
# Conflicts: # guia/src/main/java/com/roudikk/guia/core/Navigator.kt # guia/src/test/java/com/roudikk/guia/NavigatorTest.kt
|
I merged your commit to my branch. Behavior is not as expected. Even the forward transition is not the same as before. Screen recordscreen-20230217-112219.mp4 |
I think your recording here is showing the proper transitions. I gave this article a read: So my understanding is the following:
That's basically what I understood when going through the fragment transition doc and the accompanist animation library for NavHost. If I'm mistaken please let me know, it's actually quite confusing trying to understand. |
|
I'm confused too. Sampledevice-2023-02-14-140612.mp4 |
|
That's actually a good point. I'm actually doing some research now and trying out different use cases to see what fits better in Guia. |
|
Alright, I think for Guia it makes more sense the previous/your approach. Let's go with your changes! Fix conflicts and let's get this PR in. Thank you! |
Description
If using custom transition with
keyTransition, then returning to previous screen occurred with wrong animation.For example, there is screen A, B, C. Screens A and C open with a default transition. Screen B with a custom transition.
Open screens A -> B -> C. In this case all screens will display with a correct transition.
Now, if you go back to screen B, the transition from C to B will be with a custom animation, while it should be with a default transition, because screen C opened with default.
For example, I added
DetailsCustomTransitionKeywithVerticalSlideTransition.Screen record
device-2023-02-14-140606.mp4
Solution
Fixed function
Navigator.getTransition.If there is a pop to previous screen, then take the transition for
previousEntry.Screen record
device-2023-02-14-140612.mp4