Add componentName in modalDismissed event. (#5846)
* [iOS] Added componentName to be passed to modalDismissedEvent
* Added componentName to the ModalDismissedEvent type.
* Updated the JS test.
* Updated the Playground Podfile.lock.
* Updated the doc.
* Fixed dismissedMultipleModals not having a name.
* Made componentName optional for ModalDismissedEvent.
* Initial Android implementation
* Revert Android e2e emulator name
* Revert iOS Podfile
* Podfile
* Setting OCMock to 3.4.3
* Fixed the documentation.
* Fixed requested changes
* Updated the doc.
* Now emitting componentName for dismissAllModals event.
* Retriggering build
* Revert
* Move all topBar.title options to topBarTitlePresenter (#5883)
Fix TopBar title animation. This commit changes how RNN handles title and subtitle.
Until now, RNN created a custom view for title and subtitle which interfered with the way the system animated the TopBar title.
With this commit the custom view is created only when both subtitle and title are declared, otherwise RNN uses the system behavior.
* make dotIndicator to respect visible value (#5884)
In Android dotIndicator with initial value of visible: false is not respected and the dot appears in any case.
Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
* Update default value for fontsize in navigation title and subtitle (#5868)
Co-authored-by: Yogev Ben David <yogevbd@wix.com>
* v0.62 Support (#5795)
react native 0.62 Support
* Fix bottomTab merging options with default (#5885)
When updating bottomTab options with mergeOptions - default options were not taken into account and therefore were not applied to the newly created tabBarItem
* Update package.json version to 4.6.1 [ci skip]
* Update package.json version to 4.7.0 [ci skip]
* Fix external components layout
* Move selectTabOnPress prop to correct interface (#5894)
* Update changelog
* External components fixes (#5896)
* Fix external components layout
* Fix external component navigationItem options resolving
* f
* Update package.json version to 4.7.1 [ci skip]
* Official Gradle Wrapper Validation Action (#5901)
See: https://github.com/gradle/wrapper-validation-action
* temporarily disable workflows
* Support react-native-youtube (#5903)
react-native-youtubte is a popular library which wraps the native youtube library. The native lib attempts to detect if the player is hidden behind other views in order to prevent developers from playing videos in the background.
Since the overlay container was always attached to hierarchy, the library stopped playback as it mistakingly detected the player was used in the background.
This commit simply attaches the overlay container only when needed so as long as no overlays are displayed, the lib can be used.
* apply extendedLayoutIncludesOpaqueBars true on all viewControllers (#5906)
* Update package.json version to 4.8.0 [ci skip]
* Fix overlays touch interception on new iPads (#5908)
* Fix NPE when showing Overlay (#5909)
Co-authored-by: Yogev Ben David <yogevbd@wix.com>
* Update package.json version to 4.8.1 [ci skip]
* Update changelog
* Allow reset topBar.title.color when color isn't provided (#5910)
* Allow topBar.title.color reset when color isn't provided
* Reset to nil color
* Merge topBar options with default
* Fix topBar options merging
Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
* Update package.json version to 4.8.2 [ci skip]
* Update package.json version to 4.8.3 [ci skip]
* Fix wallaby (#5917)
* Fix wallaby
* Add coverage on tsx files
* Update lib/src/commands/OptionsProcessor.test.ts
Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
* Fix topBar options merging with default (#5918)
* Add missing function
* Update package.json version to 4.8.4 [ci skip]
* Update changelog
* v5 (#5931)
Merge v5 into master
Highlights of this release
* Easier installation
* autolink and reac-native link support
* Shared Element Transition - reimplemented from scratch and new API
* [iOS] showModal animation api parity
* [Android] Animation values are now declared in dp
* [iOS] deprecate topBar.drawBehind
* [Android] RNN is migrating to Kotlin
closes #5904
* Update package.json version to 5.0.0 [ci skip]
* Adapt installation guide to v5
* Update installation guide
Forgot to add Kotlin plugin
* Fix compilation issue when using react native 0.62
Fixes #5933
* Update package.json version to 5.0.1 [ci skip]
* Add deprecateDrawBehind option (#5934)
* Add deprecateDrawBehind option
* Apply draw behind options when deprecateDrawBehind equals false
Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
* [v5][docs][showcases] starter kit (#5936)
Hey! I have updated RNN version to the latest one (5.0.1 by the time)
Hope someone will find it useful 🤩
* Add window.backgroundColor option (#5942)
* Update package.json version to 5.1.0 [ci skip]
* Fix crash when mergeOptions were called before stack view was created (#5945)
Co-authored-by: Yogev Ben David <yogevbd@wix.com>
* Apply extendedLayoutIncludesOpaqueBars true on all viewControllers
* Update package.json version to 5.1.1 [ci skip]
* Update Android alert
* Fix custom push animations (#5947)
Custom push animations broke after refactoring Shared Element Transition.
Fixes #5943
* Layout background color (#5946)
* Apply layout.backgroundColor on parent view controllers
* Add layout.componentBackgroundColor
* Remove drawBehind deprecation
* Update package.json version to 6.0.0 [ci skip]
* Update changelog
* Fix applying drawBehind through mergeOptions (#5951)
mergeOptions did not handle bottomTabs.drawBehind options properly - the ReactRootView wasn't remeasured.
* Update package.json version to 6.0.1 [ci skip]
* Add slide animation to playground app
* [iOS] Added componentName to be passed to modalDismissedEvent
* Added componentName to the ModalDismissedEvent type.
* Updated the JS test.
* Updated the Playground Podfile.lock.
* Updated the doc.
* Fixed dismissedMultipleModals not having a name.
* Made componentName optional for ModalDismissedEvent.
* Initial Android implementation
* Revert Android e2e emulator name
* Revert iOS Podfile
* Podfile
* Setting OCMock to 3.4.3
* Fixed the documentation.
* Fixed requested changes
* Updated the doc.
* Now emitting componentName for dismissAllModals event.
* Retriggering build
* Revert
* Fix dismissedMultipleModals componentName
* Undo OCMock hard version
* Updated Podfile
Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
Co-authored-by: Yogev Ben David <yogevbd@wix.com>
Co-authored-by: Ioannis Tsampoulatidis <tsampoulatidis@gmail.com>
Co-authored-by: Mary Jenel <myersjenel@gmail.com>
Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com>
Co-authored-by: wixmobile <41264282+wixmobile@users.noreply.github.com>
Co-authored-by: Roberto Tatasciore <tatasciorecont@gmail.com>
Co-authored-by: Jonathan Leitschuh <jonathan.leitschuh@gmail.com>
Co-authored-by: ʙ ᴀ ᴛ ʀ <kanzitdinov@gmail.com>
Added modalAttemptedToDismiss event with tests and docs (#5832)
* Added modalAttemptedToDismiss event with tests and docs
* Typo on pageSheet modal button label
* Update ModalScreen.js
* Fixed button testID
* Revert label to fix test cases
Co-authored-by: Guy Carmeli <guyca@users.noreply.github.com>
Co-authored-by: Yogev Ben David <yogevbd@wix.com>
Send componentType field in componentDidAppear and componentDidDisappear events.
The new field is either:
- TopBarButton
- TopBarTitle
- TopBarBackground
- Component
Called each time a screen is popped, either due to `Navigation.pop` or pop gesture.
closes #3941
Navigation.events().registerScreenPoppedListener(({ componentId }) => {
});
* Refactor peek and pop
* Rollback some XCode stuff
* Added tests for touchablePreview event
* Also fixing searchbarcancelpressed event
* Making sure tests work
[BREAKING] Call Navigation.events().bindComponent(this) to listen to lifecycle events
This commit introduces breaking changes to the way components listen to RNN events.
Background
Up until now, components could handle navigation events by implemented a set of callbacks:
* componentDidAppear
* componentDidDisappear
* onNavigationButtonPressed
* onSearchBarUpdated
* onSearchBarCancelPressed
While this worked fine for the most part, this was completely broken for HOCs as RNN invoked these methods only on the registered component (top most HOC), leaving it to the user to propagate these events down the HOC chain. See the discussion in #1642 for more details.
Solution
In order to support HOC use case, we're introducing a new api which will let any Component bind itself to receive navigation events:
```js
class LifecycleScreen extends Component {
constructor(props) {
super(props);
this.subscription = Navigation.events().bindComponent(this);
}
componentWillUnmount() {
// The subscription is removed automatically when components unmount, but they can be explicitly removed as well by calling `this.subscription.remove(); `
}
}
```
It's still the users responsibility to propagate the `componentId` down the HOC chain, but by binding a component to RNN, it will be able to handle events as expected. Multiple components can be bound for the same `componentId`.
Consolidate event names
* onNavigationButtonPressed -> navigationButtonPressed
* onSearchBarUpdated -> searchBarUpdated
* onSearchBarCancelPressed -> searchBarCancelPressed
Summary: This adds a new event `onSearchBarCancelPressed` that fires
when the user presses the cancel button on the search bar in the
navigation bar. `onSearchBarUpdated` does indirectly fire when the user
presses cancel, as the query will be reset to an empty string, but it is
not possible to distinguish those events from the user simply resetting
the query. My use case for this is to have a view that appears on top of
the normal content of the view controller when the search bar is
focused.
Test Plan: ran `npm run test-js` and confirmed added JS unit tests
passed.
I also tested this with my app, and confirmed the
`onSearchBarCancelPressed` method was called when I pressed the cancel
button.
[v2][ios11, ios12] Add searchBar option for topBar (#3303)
* [ios11+] Add searchBar option for topBar
* Fix formatting and linter issues
* Add docs about topBar.searchBar
* Fix missing semicolons
* Revert prettier changes
* Add js tests for onSearchBarUpdated to achieve 100% coverage
* Mark searchBar test as :ios: specific