Always merge options with parent controller (#5606)
Until now, mergeOptions would merge with parent controller only if mergeOptions was called with
a componentId. This commit fixes the issue and makes options merge correctly even when called with a layoutId.
* Use iPhone 11 in detox e2e
* Run detox e2e tests on iPhone 11
* Run detox e2e tests on iPhone 11
* Upgrade detox@14.x.x
* Exclude broken e2e test on iOS 13
Add support for getLaunchArgs on Android
**Usage:**
1. **Pass** args in order to run the application on the device using ADB or xcrun or Detox:
- Detox: `device.launchApp(bundleId,{launchArgs: {'-key1': 'val1'}})` must use launchArgs key, see [docs](https://github.com/wix/Detox/blob/master/docs/APIRef.DeviceObjectAPI.md#7-additional-launch-arguments).
- ADB: `adb shell am start -n com.yourpackage/com.yourpackage.YourActivity --es launchArgs "{some stringyfied json}"`
- Xcrun: `/usr/bin/xcrun simctl launch ${udid} ${bundleId} --args -key1 value1 -key2 value2`
2. **Retrieve** the arguments: `const launchArgs = await Navigation.getLaunchArgs();`
- There is a small difference between platforms on how they pass the launch args:
- on iOS, the args will be passed as an array of pairs (argv,argc)
- on Android, the args will be passed in the form of a dictionary
Extract args as a dictionary example:
```javascript
const launchArgs = await Navigation.getLaunchArgs();
let resultArgs = {};
if (Platform.OS === 'android') {
resultArgs = launchArgs; // no need to proccess its a dictionary
} else {
for (let i = 0; i < launchArgs.length; i += 2) {
if (i + 1 < launchArgs.length) {
resultArgs[launchArgs[i]] = launchArgs[i + 1];
}
}
}
```
Prefer new imageWithTintColor API when tinting an UIImage (#5458)
With this change, dynamic colors will be supported when tinting an image and the image color will change on the fly depending on the dynamic provider and traits. This will be especially useful when supporting the new dark mode in iOS 13.
Apparently lockMode conflicts with visibility - If a menu is visible and lockMode locked is applied the menu closes.
Also removed temp code related to workaround introduced for temp sideMenu options (visibility)
Break all the PRs :(
iOS and Android code base used different naming conventions - this commit aims to unify naming conventions. I probably missed a few properties here and there so this will be an ongoing effort.
Stop recursive double setting of default options (#5456)
There is no need to call `setDefaultOptions` on the `childViewController` while iterating the `childViewControllers` as those will be passed recursively as `rootViewController` anyway and thus calling `setDefaultOptions` in the nested recursive call.
* Don't cache values for constants() call
The reason we can not cache the values is because the implementation differs per OS. Android returns static values while iOS will actually crawl the layout and return it's heights. The caching mechanism here meant that iOS would only return the heights of the layout it calculated the first time.
* Update docs regarding inconsistencies in Constants
* Enabled option was wrongly consumed after it was merged. That meant that the next time SideMenu options were applied, the wrong enabled value was applied
* supportedInterfaceOrientations didn't take default orientation value into account
* mergeOptions didn't save the new options in the ViewControllers current options
* SideMenu always returned the centre ViewController as the current child and didn't take open SideMenu into account
Fixes #5444
The backButton options are always applied. Even when one of its values has changed in mergeOptions.
This commit adds a function to apply the backButton, and should probably replace the existing rnn_setBackButtonIcon - as that function does more than just set the icon, it sets all options.
Merging TopBar title, buttons and status bar options is broken on iOS in 3.1.1.
Parent options aren't resolved properly and default options aren't regarded when they should be.
Propagate new defaultOptions to presenters (#5404)
When defaultOptions are set after setRoot has been called presenters need to receive the default options as well,
otherwise the outdated default options are regarded.
Fixes #5395