Skip to content
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

Save Transitions to use for back navigation #70

Closed

Conversation

ryanmoelter
Copy link
Contributor

Saving transitions allow us to create interesting transitions later, in addition to just making sense. I'd rather not have to override back transitions too.

Saving transitions can be tricky when you can rewrite the backstack, so I decided to attach Transitions to screens so they can animate out in the same method they animate in. A mutable backstack in this case means that transitions must work with any to/from view, which is a reasonable restriction in my mind.

currentTransition = overridingTransition;
overridingTransition = null;
} else if (direction.equals(Direction.BACKWARD) && currentScreen().getLeaveTransition() != null) {
currentTransition = currentScreen().getLeaveTransition();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to test this logic, but triggering the whenMeasured block is tough. I've tried manually calling measure and layout, but it's still not triggering it. Thoughts/suggestions?

@ryanmoelter
Copy link
Contributor Author

This is the default behavior in the v2.0 betas

@ryanmoelter ryanmoelter deleted the transition-retention branch May 4, 2022 17:25
@ryanmoelter ryanmoelter restored the transition-retention branch May 4, 2022 17:25
@ryanmoelter ryanmoelter deleted the transition-retention branch May 4, 2022 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant