Skip to content

Conversation

@LeJPR
Copy link
Owner

@LeJPR LeJPR commented May 23, 2018

No description provided.

yogevbd and others added 30 commits February 6, 2019 16:03
* Layout changes

* WIP

* Revert "Layout changes"

This reverts commit 4da8cfb.

* Clean topBar.component and topBar.background.component when not needed

* Move custom components login from viewController to presenters

* Change waitForRender and enabled property from primitive bool to Bool object

* Fix ios unit tests

* Add unit tests

* Remove RNNReactView observer when view ready

* Load react components from component manager

* Remove createCustomReactView duplication

* Handle render children in each Layout

* Wait for navigation presenter components render, refactor RNNTitleViewHelper

* Fix unit tests

* Add waitForRender for custom react components

* Fixes e2e
Mostly relevant to malformed icons where for some reason, requiring an image results in null.
* Add button.iconInsets

* Define iconInsets in Options.ts

* Apply color on button iconImage
* Remove currentLeaf

* Fix resolve options

* Remove irrelevant test

* Remove RNNRootViewController clear background color

* Fix title with subtitle options
* Added missing mergeOptions for text, icon, selectedIcon, textColor, selectedTextColor, iconColor, selectedIconColor, badgeColor

* Minor changes
Removed unused class which isn't compatible with RN 0.58

Fixes #4646
Doing `git clone -b v2 git@github.com:wix/react-native-navigation.git` gives me this:
```
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.
```
Using lodash.set caused issues when keys contained the dot symbol. _.set created objects inside the store, which is intended to be a simple key value dictionary -
In some cases, set would overwrite previously set values.
This fixes an issue where the frame for the custom view can be set to the incorrect y-offset upon setting the custom frame.

In iOS 11, this behavior changed, as UIBarButtonItem went from being using springs-and-struts for sizing, to using a UIStackView, and thus using Autolayout.

This lead to the superview of having a frame of (0, 22, 0, 0) at the first layout pass.

By moving to using NSLayoutConstaints, we can now properly size our custom view.

See also: https://gist.github.com/niw/569b49648fcab22124e1d12c195fe595
See also: https://stackoverflow.com/questions/10988918/change-width-of-a-uibarbuttonitem-in-a-uinavigationbar
* Support rtl layout

* ios layout options

* Support rtl layout

* Use View.LAYOUT_DIRECTION_LTR constant instead of 0

* move layout direction logic to RootPresenter

* Fix tests

* Fix tests

* Fix tests

* Fix tests

* fix tests

* Fix tests
When loading local image resource (images in Drawable folder), RNN mistakingly tried to load the image as a js asset even if it successfully loaded the local image.
On Android options were not updated when SideMenu was opened or closed
via swipe gesture. This caused bugs when trying to interact with the drawer again via gestures since
the drawer would immediately close or open according to the visibility in options.
* Cleanup and reorganise playground app

* Separated tests into three categories
  1. Layouts - layout specific tests and feature showcase
  2. Options - options related tests; interactions between static and dynamic options, merge options etc
  3. Navigation - general navigation features; Orientation handling, events, Overlay etc

* Fixed a few Android bugs
  1. testID wasn’t applied on TopBar react buttons
  2. static options were disregarded when creating initial BottomTab options
  3. Trying to open a none existent SideMenu would result in a crash

* Fix e2e tests

* Fix lint

* Few fixes + split push from SideMenu test into two tests

* Fixes e2e
Fix top bar buttons size on iOS 10

Fixes #4759
If you use overlays to show in-app notifications
it would closes the keyboard every time an overlay is
opened.
yogevbd and others added 26 commits September 16, 2019 20:44
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];
        }
      }
    }
```
* 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
For some reason it returned cyan... probably leftover from a debug session
* Sets the window background color to the system's one for dark mode support

* Fix title layouting on iOS 13
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.

# Conflicts:
#	lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ChildController.java
#	lib/android/app/src/main/java/com/reactnativenavigation/viewcontrollers/ComponentViewController.java
#	lib/android/app/src/test/java/com/reactnativenavigation/mocks/SimpleViewController.java
#	playground/android/build.gradle
This commit adds support to update props of screen or custom button/title via the mergeOptions api.

```js
Navigation.mergeOptions('myComponentId', {
  passProps: {
    text: 'new value'
  }
});
```
# Conflicts:
#	lib/src/interfaces/Options.ts
#	playground/src/screens/OptionsScreen.js
#	playground/src/screens/index.js
# Conflicts:
#	lib/android/app/build.gradle
#	lib/android/app/src/main/java/com/reactnativenavigation/presentation/BottomTabPresenter.java
#	lib/android/app/src/main/java/com/reactnativenavigation/utils/ImageLoader.java
Needed to support bottomTab.selectedIcon
This new updateProps command allows to update props for a component registered with Navigation.registerComponent.
The updated props are handled by shouldComponentUpdate and componentDidUpdate lifecycle methods.
This commit builds upon the work done in 291f161 and is a breaking change.
# Conflicts:
#	lib/ios/ReactNativeNavigation.m
When updating a tab icon, if null was used as color - it would get applied.
Edge case when preDrawListener callback is invoked after ViewController is destroyed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.