-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
FEATURE: Apple music style modals (DeckTransition) #4774
Conversation
Hello. I try to start demo - it's hang on splashscreen about ~10 seconds and then crashed without any errors |
48fc622
to
f0bc341
Compare
Ok, I now got the tests to pass as well. Also updated the Demo repository to the latest version and generated new example gifs. Detox rocks! @Ryabchikus Can you try again with the updated Demo repository? If it still does not work, please file an issue to the Demo repository with more details. |
@Jyrno42 |
Patch file for those who want to use this. Can be used with patch-package. https://gist.github.com/Jyrno42/de6cbc417d3f829a49b20db3775409cc |
Hey @Jyrno42 Once again, sorry for the late reply and thanks a lot for the PR 💪 |
If you have any tips on where to start when making this library extensible or if you know about any existing projects that I could take a look at I would love to hear it. |
Hey @guyca if you find the time I would love some guidance on this:
|
5663806
to
68eb675
Compare
Adds support for Apple music style modal animations via [DeckTransition](https://github.com/HarshilShah/DeckTransition) library. Usage: ``` Navigation.showModal({ component: { name: 'my.component.name', options: { modalPresentationStyle: Platform.OS === 'android' ? 'overCurrentContext' : undefined, // Needed for android animations: { showModal: { enableDeck: true, // Default: false deckPresentDuration: 0.3, // in seconds, Default: 0.3 deckDismissDuration: 0.3, // in seconds, Default: 0.3 enableDeckSwipeToDismiss: true // Default: true **Warning: IOS ONLY** }, dismissModal: { enable: true, enableDeck: true, // Default: false deckPresentDuration: 0.3, // in seconds, Default: 0.3 deckDismissDuration: 0.3, // in seconds, Default: 0.3 } } } } }); ``` Note: On Android the effect looks nicer if you add a dark background color to your root view. **Usage via cocoapods:** Add the following lines to your Podfile ``` pod 'ReactNativeNavigation', :path => '../node_modules/react-native-navigation' pod 'DeckTransition', :path => '../node_modules/react-native-navigation/lib/ios/DeckTransition' # see CocoaPods/CocoaPods#7585 (comment) post_install do |installer| installer.pods_project.targets.each do |target| compatibilityPhase = target.build_phases.find { |ph| ph.display_name == 'Copy generated compatibility header' } if compatibilityPhase build_phase = target.new_shell_script_build_phase('Copy Swift Header') build_phase.shell_script = <<-SH.strip_heredoc COMPATIBILITY_HEADER_PATH="${BUILT_PRODUCTS_DIR}/Swift Compatibility Header/${PRODUCT_MODULE_NAME}-Swift.h" ditto "${COMPATIBILITY_HEADER_PATH}" "${PODS_ROOT}/Headers/Public/${PRODUCT_MODULE_NAME}/${PRODUCT_MODULE_NAME}-Swift.h" SH end end end ``` Update android tests Improve transition on android w/ nested decktransition modals Update to new playground structure Fix existing android tests Add e2e tests Ensure IOS e2e tests do not crash s/PUSH_BUTTON/PUSH_BTN/ Add deck transition swipe-to-dismiss e2e tests and fix ios e2e test issues - Improve android deck root detection mechanism Improve android visuals by also fading out parent view when modal is open IOS improvements - Easier cocoapods support - Fix scrollview detection - Ensure transforms to scroll view do not glitch due to momentum - Ensure tree gets unmounted when modal is hidden via swipe-to-dismiss
68eb675
to
5cb9d69
Compare
@guyca Bump. |
This now supported by default in iOS 13 SDK with the |
Adds support for Apple music style modal animations via DeckTransition library. On IOS it also supports swipe-to-dismiss gestures. This is not fully done yet, but I opened the PR early to gather community and maintainer feedback.
Usage:
Note: On Android the effect looks nicer if you add a dark background color to your root view.
Usage via cocoapods:
Add the following lines to your Podfile
Demo
Repository: https://github.com/Jyrno42/RNNDeckTransitionDemo
related to #4743