* Preview API
* Added preview actions and fail-guard wrappers
* Remove old setters
* Moved from passProps to actionParams
* Move findNodeHandle to internal method
* Removing findNodeHandle
* Added height and option to dont 'pop' the view controller
* Documentation update for peek and pop
* Document how to access button press events
* Commit by default in example. Because it's cool
* Docs and if elses ifs then
* Unregister previous ViewController on attempt to preview.
* Merge conflict fail
setTabButton -> has now the property 'label' to change the label of the TabButton
iOS update style-update rutine to update each viewcontroller in a NavigationViewController
tabButtonColor improvement
setTabButton to change the label of the TabButton (#2215)
* setTabButton -> has now the property 'label' to change the label of the TabButton
* Add to documentation
* [BugFix] use i instead of 0 to check all TabItems
Add the preview and pop feature
To use the feature you simply call `navigator.push()` but with additional parameter `previewViewID` which is a React Node.
```js
<TouchableOpacity
onPressIn={() => this.props.navigator.push({
screen: 'screenid',
previewView: this.viewRef,
previewActions: [{
title: 'Foo',
style: 'selected', // none, selected, destructive
actions: [{ title: 'Bar' }],
}],
})
/>
```
This commit saves navBar component props in propsRegistry and restores the saved props
when the component is mounted, allowing us to pass unserializable props to custom navBar component.
(Android) Allow disableOpenGesture right or left in the drawer (#2189)
This pull request allows you to disable the open gesture only in one side of the drawer.
```
Navigation.startSingleScreenApp({
screen: initialScreen,
drawer: {
left: {
screen: DRAWER_SCREEN,
disableOpenGesture: false,
},
right: {
screen: SIDEBAR_FILTER_SCREEN,
disableOpenGesture: true,
},
},
});
```
If we pass disableOpenGesture to the drawer root object, like this:
```
Navigation.startSingleScreenApp({
screen: initialScreen,
drawer: {
left: {
screen: DRAWER_SCREEN,
disableOpenGesture: false,
},
right: {
screen: SIDEBAR_FILTER_SCREEN,
disableOpenGesture: true,
},
disableOpenGesture: true <======
},
});
```
Then the two drawer positions would be gesture disabled and the specific disableOpenGesture would be ignored. This way we don`t introduce breaking changes.
Support passing unserializable props to custom button (#2192)
This commit applies the save props mechanism used when pushing screen
to navigator buttons as well, enabling us to pass unserializable props to buttons.
This commit adds ability to register multiple navigator event listeners:
navigator.addOnNavigatorEvent(func)
navigator.removeOnNavigatorEvent(func)
Event listeners are removed when the screen the navigator is bound to
is unmounted, calling `removeOnNavigatorEvent` isn't mandatory.
As this api conflicts with the current api, addOnNavigatorEvent can't be used
in a screen where setOnNavigatorEvent was used before.
Finish SplashActivity if it's opened over NavigationActivity
On some devices, when returning to the app from background, some launchers
open the SplashActivity over the NavigationActivity. In this case, simply finish the SplashActivity
and return the the preview NavigationActivity.