When disabling elevation by setting topBarElevationShadowEnabled to false, this commit allows to re-enable it by setting the same property to true.
Elevation was previously disabled by using setOutlineProvider(null), with ViewOutlineProvider being an Android 5.0+ object responsible for determining how views draw their outline. To allow re-enabling elevation, we keep our original ViewOutlineProvider and restore it when elevation is enabled again.
Revert "Now allowing the custom nav bar to take up the whole space on iOS" (#2404)
* Revert "Improve getCurrentlyVisibleScreenId on iOS with drawers. (#2052)"
This reverts commit 2c30a52bb9.
* Revert "introducing navbar shadow on iOS (#2339)"
This reverts commit 8fd496e0c9.
* Revert "This fixes an issue with a custom title-view (which has a title and a subtitle) appearing at the left side of the nav-bar instead of the center during a transition animation: when a screen with this title-view is being pushed or when you pop back to it. (#2384)"
This reverts commit 3f7f6c2612.
* Revert "Now allowing the custom nav bar to take up the whole space on iOS (#2306)"
This reverts commit 74a02ccfc5.
This fixes an issue with a custom title-view (which has a title and a subtitle) appearing at the left side of the nav-bar instead of the center during a transition animation: when a screen with this title-view is being pushed or when you pop back to it. (#2384)
This happens because the title-view is being created again when RVVViewController appears. There's probably no point in setting the title-view again with the same data when it already has it. The title view setup is done anyway in RCCNavigationController.
This can be easily reproduced by calling "this.props.navigator.setSubTitle({subtitle: 'a subtitle'});" from the constructor of a pushed screen.
Fix formatting of code block in installation-ios (#2356)
This code block appears fine on GitHub, but is malformatted on the site. This commit updates it to fit the format of other code blocks in the docs, so it should appear okay.
* 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.