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

Allowed Customised Animation on Android #210

Merged
merged 11 commits into from
Jul 21, 2018
Merged

Conversation

grahammendick
Copy link
Owner

Used native overridePendingTransition because allows the enter and the exit animation to be customised. The exit can either be unmounting or becoming a crumb; the enter can either be mounting from unmounted or from crumb. So there’s four different animations that can be overridden. Had to run the override on the ui thread. Had to get the default andorid animations so that can only override enter, for example, but leave exit as the default.

Made the getCrumbStyle and getUnmountedStyle match the params of the corresponding functions on Navigation React Mobile. Had to parse the old url to get the Crumbs, unlike on Mobile because, because need to call getCrumbStyle when remounting.

Has to run on the ui thread otherwise it gets ignored (or is sometimes ignored, not sure which?)
If null returned default. The lookup returns 0 if name not found so that's no animation, which seems fair
Imagine going from State A to State C fluently so that State B is in the middle. The exit State is A and the enter State is C, but A's next State is B. Similarly going back 2 from C to A, the exit State is C and enter is A, but A's next State is B.
This is different to Navigation React Mobile because render all Scenes in succession so next State is automatic. In Native, need to use the old crumbs, state and data to get the right next State and next data.
Makes animation read better
detail.getUnmountStyle = from => from ? 'slide_in' : 'slide_out';
Allows addNavigateHandlers to be called before initial navigate
Even thought they're not used, keeps the NavigationModule render params in step
@grahammendick grahammendick merged commit 93cf854 into master Jul 21, 2018
@grahammendick grahammendick deleted the android-animation branch July 21, 2018 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant