Detach bottomTabPresenter from basePresenter (#5970)
Refactor bottomTabs options applying mechanism. Both bottomTab and bottomTabs presenters were part of the base UIViewController class which was wrong. This commits moves them to the BottomTabsController.
This refactor mostly contains the following
* Detach bottomTabPresenter from basePresenter
* Create tabBarItem appearance on presenter init
* Refactor bottomTabPresenter
* Refactor bottomTabPresenter
* Move appearance creation to bottomTabsController
* Merge child options with direct child controller
Apply topBar appearance options on current child navigationItem (#5994)
This commit changes how stack child options are applied on iOS 13. Until now, options were applied directly to the navigationItem of the stack which is shared between all children.
This commit applies options on the navigationItem of each child instead. This fixes issues with color transitions when popping and pushing children to the stack.
* Fix largeTitle animation and crash
* Create button if not exist
* Prevents largeTitle transition crash
* Fix unit tests
* Set navigationBar.prefersLargeTitles true on stack initialization
* Bump minimum deployment target to iOS 11.0
* Add unit test
This commit fixes issues with BottomTabs text color on iOS 13
* Extract bottomTab options from base presenter
* Add iOS 13 appearance support for bottomTabs and bottomTab
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
Fix merge options leaks to next screen in stack (#5859)
* Fix merge options leaks to next screen in stack
* Rename mergeChild:options to mergeChildOptions:options:
* Rename mergeChildOptions:options: to mergeChildOptions:child:
Add iOS support for `bottomTabs.attachMode`.
This property controls when BottomTabs children are attached to hierarchy and when their React views are created.
By default, RNN attaches all children at the same time which might impact loading time as a few screens are instantiated at once.
Using `afterInitialTab` or `onSwitchToTab` generally leads to improved start up time.
* Migrate project to workspace
This commit moves all unit tests to the playground workspace
* Fix ios unit tests
* Build pods before testing
* Build typescript before running iOS tests
* Remove xcode 10 support
# Changes
* Support RN 0.60
* Migrate to AndroidX
* Improve draw behind StatusBar (Preparation for #4258)
* Don't push BottomTabs when keyboard is displayed (Fixes #4005, #3424)
- It won't be needed to toggle the BottomTabs when Keyboard is visible
* BottomTab badge and dot indicator are not animated by default on Android (parity with iOS)
# Updating from v2
v3 is currently in alpha. To update simply npm install `3.0.0-alpha.11` - `npm install --save react-native-navigation@3.0.0-alpha.11`.
Breaking changes are outlined below.
## Layout system changes on **Android**
* Parent layouts (BottomsTabs, Stack, SideMenu) are always laid out behind the StatusBar.
* Components (`component` and `externalComponent`) are measured and offset according to the StatusBar.
In this release, We're changing the layout system in order to provide better support for immersive and full screen apps. In this release we've improved support for drawing behind the StatusBar, next we'll address drawing behind the NavigationBar.
Use the `drawBehind` and `translucent` options to control the StatusBar
```js
statusBar: {
drawBehind: true, // will draw a screen behind the StatusBar
translucent: true // Usually you'll want to have drawBehind: true when this is true
}
```
While this isn't a breaking API change - there are a few breaking side effects.
### How will my app be effected
1. When the keyboard is opened, BottomTabs will now be drawn behind the keyboard and won't shift upwards. This is in parity with the current behaviour in iOS. For the most part, this isn't a breaking change. Toggling BottomTabs when TextInput's focus changes won't be needed anymore.
2. While parent controllers are drawn behind the StatusBar, their background isn't.
This means that when transitioning from a destinations drawn under the StatusBar to a destination drawn behind it, the application's default background color will be visible behind the StatusBar.
If you application's theme is dark, you might want to change the `windowBackground` property to mitigate this:
Add the following to your application's `style.xml`
```xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@color/backgroundColor</item>
</style>
<!--This is your application's default background color.
It will be visible when the app is first opened (while the splash layout is visible)
and when transitioning between a destination a screen drawn under the StatusBar to
a destination drawn behind it-->
<item name="backgroundColor" type="color">#f00</item>
</resources>
```
## AndroidX migration
We've migrated RNN to AndroidX, please follow migration instructions in the react-native repo.
## Removed SyncUiImplementation
[SyncUiImplementation](https://github.com/wix/react-native-navigation/blob/master/lib/android/app/src/reactNative57WixFork/java/com/reactnativenavigation/react/SyncUiImplementation.java) was used to overcome a bug in RN's UiImplementation. This workaround was added to RN's `UiImplementation` in RN 0.60 (thanks @SudoPlz) and can be removed from RNN.
If you're using `SyncUiImplementation` your app will fail to compile after upgrading to v3. Simply remove the following code from your `MainApplication.java`
```diff
- import com.facebook.react.uimanager.UIImplementationProvider;
- import com.reactnativenavigation.react.SyncUiImplementation;
- @Override
- protected UIImplementationProvider getUIImplementationProvider() {
- return new SyncUiImplementation.Provider();
- }
```
## BottomTab badge and dot indicator are not animated by default on Android (parity with iOS)
Showing and hiding badge and dot indicator are now not animated by default. Badge animation is now controlled with the `bottomTab.animateBadge` property and dot indicator with `bottomTab.dotIndicator.animate` property.
#### The following option will show a badge with animation
```js
bottomTab: {
badge: 'new,
animateBadge: true
}
```
#### The following option will show a dot indicator with animation
```js
bottomTab: {
dotIndicator: {
visible: true,
animate: true
}
}
```
closes #5228
* Support RN 0.59
* Fix yellow box detection on Android
* Manually link jsc on iOS in playground app
* Fix android unit tests
* Add JavaScriptCore.framework to iOS unit tests
* Download licenses before unit and e2e tests
* Update gradle-wrapper.properties
The following PR introduces improved support for Context api and other api's which wrap the root view.
## Context api
Navigation.registerComponent('navigation.playground.ContextScreen', () => (props) => (
<TitleContext.Provider value={'Title from Provider'}>
<ContextScreen {...props} />
</TitleContext.Provider>
), () => ContextScreen);
## Redux
Navigation.registerComponent('navigation.playground.ReduxScreen', () => (props) => (
<Provider store={reduxStore}>
<ReduxScreen {...props} />
</Provider>
), () => ReduxScreen);
## Plain Component - not changed
Navigation.registerComponent('navigation.playground.MyScreen', () => MyScreen);
This PR also upgrades the TypeScript version to 3.2.0 and RN version used in the playground app to 0.57.7
* New Android build flavor - `reactNative57_7`
* Unit test coverage is disabled, for some reason it broke after upgrading to RN 0.57.7
* bind viewController to presenters using bindViewController
* Merge options to the specific provided layout
* Moved custom titleView creation to RNNRootViewController
* Moved default options to presenters, moved options applying to presenters, resolved options in RNNOptionsResolver
* Fixes merge options
* Fixes topBar transition on pop
* Prevent titleView creation when react titleView exists
* Fixed unit tests
* Options refactor WIP
* Detach applied options from DTO - WIP
* Added option types and option parsers
* Unit test passes
* Added presenters for each parent type
* Fixes unit tests
* Rename StringParam to Text, changed bottomTabs.drawBehind and topBar.drawBehind default to false
* set layout.backgroundColor default to white
* Added unit tests for RNNViewControllerPresenter
* Set layout.backgroundColor default nil
* Fixes buttons color missing options
* Fix unit test
* fix button color parsing
* Moved default options to presenters
* default options fixes
* Fixes e2e
* Fixes unit tests
* Resolve child options on childWillAppear
* Recrusively setDefaultOptions on rootViewController tree
* Fixes default values
* Fixes tests
* Work in progress
* Arbitary changes
* Improvements on API
* Cleanup RNNSplitViewController, allow mergeOptions
* Added documentation and better playground example
* Adding tests for coverage
* Find out why this test is failing.
* Only show split view on iOS
* Add test back in
* largeTitleFix
* update to rn 49 - reload still not working on ios
* bridge fix
* small fixes
* testing with rn50
* removed package-lock
* go back to 49, problem with android in 50
[Experimental] Custom transition animation for ios (#1955)
* screen Background Color iOS
* ios v2 topBarTextFontFamily
* added topBarHidden to iOS
* minor fix and topBarHideOnScroll
* minor fix
* topBarButtonColor iOS
* topBarTranslucent iOS
* topBarTranslucent IOS minor fixes
* eslint fixes
* minor fixes
* changed setTabBadge to tabBadge and added a unit test in iOS
* added fontSize on iOS
* minor fix
* topBarTransparent
* minor fix
* first dirty custom transition iOS poc. in need of complete refactor and testing
* dirty poc for view transition
* dirty poc of interactive transition
* deleted unNeeded Files
* cleaning
* cleaning, support for interactiveImagePop and backButton custom transition
* cleaning
* merge v2 into custom-transition-animation fix
* merge fix
* merge fix
* cleaning and merge fix
* support for multiple animation in parralel, animations with are not shared element including: velocity, spring, alpha and translate
* last commit should also include these
* added resize mode animation and fixed flickering bug
* refactoring
* first cleaning and another test
* cleaning
* commandsHandler now accepts bridge in constructor, fixed tests, added e2e test
* eslint
* android pop now recieves two parameters - preparation for custom transition
* Refactor + add afterLoad to modal
* merge v2 second try
* merge fix
* merge fix
* fix ios unit tests
* fixed topBarTransparent e2e
* fix js tests
* refactored RNNAnimator, RNNAnimatedView, small fixes
* refactor topBarLargeTitle
* fixed lifycycle bug with componentWillUnmount, small fixes
* fix transparent conflict
* removered Element.js from coverage report
* comment redundent test
(still needs to be discussed), small fix
* removed commented test, moved element.js to adapters