Summary:
Set clipChildren to false by default in ReactRootView.java so that Overflow: visible/hidden will work for the root view.
Moved sDefaultOverflowHidden from ReactViewGroup.java to ViewProps.java so that it can be used in both ReactViewGroup.java and ReactRootView.java.
Reviewed By: mdvacca
Differential Revision: D8727140
fbshipit-source-id: b593bed63e479cdbd22e4a025b936e6aeb28fc8c
Summary: Fix ReactHorizontalScrollView so that its children won't overflow. (Task: https://our.intern.facebook.com/intern/tasks/?t=31128239)
Reviewed By: achen1
Differential Revision: D8923947
fbshipit-source-id: 56c36b25c29a87a306d92544273603d0d086edc0
Summary:
Problem: The first ReactTextInputShadowNode layout calculation didn't consider the placeholder. When the layout with placeholder was actually being measured, its height was constraint by the previously calculated height, causing long placeholder content to be clipped.
Fix: Access the placeholder property in ReactTextInputShadowNode, set the dummyEditText's hint with placeholder before ReactTextInputShadowNode's first measurement.
Reviewed By: mdvacca
Differential Revision: D8903108
fbshipit-source-id: 8f3e518d0395ac875807f9ea989a0b5bbe4b2a26
Summary: Fix the calculation of offsetX in onLayout (ReactHorizontalScrollContainerView.java) that re-positions the updated layout. A private instance variable (oldWidth) is added in order to track the width difference between consecutive updates. (Issue report: https://github.com/facebook/react-native/issues/19979)
Reviewed By: mdvacca
Differential Revision: D8772780
fbshipit-source-id: 969dcead550f4a3d24d06416b63d960492b7a124
Summary:
Context:
After discussing with @[1038750002:yungsters], `currentViewStates` is a very ambiguous name for a prop, especially because there are only two possible values. From a developer's perspective, it makes more sense to just call them `accessibilityStates` because the main use for them is to add states to Talkback and Voiceover.
Defense for changing name in Android: The actual implementation of what we're changing under the hood in Native Code is abstracted away from developers using React Native, so as long as behavior is as they would expect, it makes more sense to change the name into a clear one regardless of how it is implemented.
Changes:
changed the Prop name from `currentViewStates` to `accessibilityStates` in the BaseViewManager file where the view property is being exposed.
Reviewed By: PeteTheHeat
Differential Revision: D8896389
fbshipit-source-id: 35dcd9239fae016b790e528947994681684bd654
Summary:
Currently, `AccessibilityInfo.setAccessibilityFocus` is only available on iOS. The same behaviour can be achieved on Android by dispatching the proper accessibility event. I implemented the same function for Android, to make life slightly more convenient for the developer.
Today, developers must write something like this:
```
if (Platform.OS === 'ios') {
AccessibilityInfo.setAccessibilityFocus(reactTag)
} else {
UIManager.sendAccessibilityEvent(reactTag, 8)
}
```
With this change, the following is enough for both Android and iOS:
```
AccessibilityInfo.setAccessibilityFocus(reactTag)
```
Pull Request resolved: https://github.com/facebook/react-native/pull/20229
Differential Revision: D8874107
Pulled By: mdvacca
fbshipit-source-id: a6ffd7bb89ce56d6d65b06419633a71dcf3d0733
Summary: Trying to see what it takes to get server snapshot tests working on android. This will be landed after fixing few things.
Reviewed By: achen1
Differential Revision: D8237948
fbshipit-source-id: 926555ba752171dac4e5814f5c8e5c2c173a82c7
Summary:
Added native android support for the prop accessibilityStates.
If 'selected' is passed in, it calls view.setSelected(true)
If 'disabled' is passed in, it calls view.setEnabled(false)
If both are passed in, both are set on the view.
Reviewed By: blavalla
Differential Revision: D8838407
fbshipit-source-id: a942dabcdc5d9e35f0316465e97317739a8b4b25
Summary: This diff initializes Fabric C++ UIManager code from java, it also registers android RootViews inside C++.
Reviewed By: shergin
Differential Revision: D8794819
fbshipit-source-id: b4d1d0958a3f8e01d4a51be957d9a2e2f442489e
Summary: This diff creates the C++ base classes for Fabric and it integrates them into the starting process of Fabric inside Catalyst App
Reviewed By: shergin
Differential Revision: D8786185
fbshipit-source-id: d04208f0781387424fc0ddf7a6e5d46a6bd61f66
Summary:
The keep-alive-duration for the connection pool for mOnChangePollingClient
is a number in milliseconds, but was mistakenly given in minutes. This mistake
was introduced in 6bbaff2944.
I discovered this by chance while lurking around in the codebase.
Pull Request resolved: https://github.com/facebook/react-native/pull/19817
Differential Revision: D8873138
Pulled By: hramos
fbshipit-source-id: c81c1952721449442f18a0c2373f8b2780403749
Summary:
Because we're now separating accessibilityTraits into accessibilityRole and accessibilityState, we're going to only allow one role to be set, and allow on preset combinations of roles that make sense.
This adds android functionality for an added role that is image button.
Reviewed By: blavalla
Differential Revision: D8846987
fbshipit-source-id: 9fe36828f63b05bd2c9cf9680204b1995d678342
Summary:
Added the android functionality for those three roles: search, adjustable, and link.
Until React Native internal framework ports internationalization and localization of strings, I'll handle localization by allowing an extra prop to be passed in that can override talkback's description in another language if needed.
Reviewed By: blavalla
Differential Revision: D8807692
fbshipit-source-id: b51877d187cb6cb663d65d6b4d072e6dc52a2d03
Summary:
Cleanup clang compiler warnings.
The last version delete some variables that still used in code.
Fix the problem and try to launch again.
Reviewed By: hershi
Differential Revision: D8704442
fbshipit-source-id: 8bd37fc9f2b27104fe15c4c8b8323e2bfd8c1060
Summary: Removed Accessibility Trait TabBar for iOS compatibility Issues, since tabbar is only available on iOS 10+
Reviewed By: PeteTheHeat
Differential Revision: D8822469
fbshipit-source-id: 34bf00eb930f631a5a4effa0a4159da07c1573f6
Summary:
Brings back the fix for `overflow: hidden` on Android by implementing a workaround for a bug with `ReactNativeART`.
The ReactNativeART bug is that changes in the canvas due to a resize of the `Surface` are not properly reflected on Android. I have verified that the correct props are being computed and passed to the shadow nodes and that the `ARTSurfaceView`'s canvas is indeed updated. But for some reason, the paint is not updated.
This workaround is to simply unmount and remount `Surface` on Android. It sucks and we should eventually fix it.
Reviewed By: achen1
Differential Revision: D8818010
fbshipit-source-id: 71d1927580b6bde7263fd241797d4655140b5f34
Summary:
Replaces two nested if-blocks with guards. This is intended to help with restructuring this function in follow-ups.
@public
Reviewed By: priteshrnandgaonkar
Differential Revision: D8785659
fbshipit-source-id: 7b9d63e9814b83b999397c016ad67ad348bb0f72
Summary:
Added a new property to View for Accessibility called `accessibilityRole`. This property merges functionality of existing properties: `accessibilityTraits` (iOS) and `accessibilityComponentType` (android).
Currently, nine values are supported with equivalent behavior as `accessibilityTraits` (iOS) when `accessibilityRole` is set on iOS Voiceover and Android TalkBack
```
| 'none'
| 'button'
| 'link'
| 'search'
| 'image'
| 'keyboardkey'
| 'text'
| 'adjustable'
| 'tabbar'
```
They currently support similar behavior on talkback on Android and voice over on iOS
Does not break functionality of existing properties, but have not tested for behavior of setting both this one and the old one.
* iOS - I added a property accessibilityRoles, and basically remapped it to the same thing as accessibilityTraits. I also added in enum mappings for keyboardkey and tabbar.
* Android - Also added a property accessibilityRoles, from the Android side. For the underlying native functionality, I built a helper class that is based off of AccessibilityRolesUtil.java from the accessibility team. Biggest changes made are that I defined my own enums if needed, and also set some properties to match the functionality of iOS Accessibility Traits. I also handled the logic for switch/case statements of setting roles for the android side on this file. Also, I currently haven't localized strings for setRoleDescription, but plan to.
* Javascript - I added a view property accessibilityRoles in ViewPropTypes.
Reviewed By: blavalla
Differential Revision: D8756225
fbshipit-source-id: e03eec40cce86042551764f433e1defe7ee41b35
Summary: Image source null which is in RC D8628053 has a bug which has a fix but didn't make to RC. Reverting so it can be cleaned up before going in RC.
Reviewed By: achen1
Differential Revision: D8751687
fbshipit-source-id: e08b23a031455be23047880871813bdc840542dd
Summary: This makes it possible to specify an optional Request.Builder when calling `downloadBundleFromURL` (the old method still works as usual).
Reviewed By: davidaurelio
Differential Revision: D8691303
fbshipit-source-id: 2fb2aecd3506355c6b3a72457a7bb9acfd03b18d
Summary:
It looks like for some reason when ReactViewGroup uses setClipChildren(false), the ReactNativeARTSurface no longer redraws when its width is expanded.
Disable this new overflow behavior until the underlying issue is fixed.
Reviewed By: achen1
Differential Revision: D8739003
fbshipit-source-id: ffae0e3eb0cd8ce385eae33a87b5ba0325cae3c4
Summary:
Adds a kill switch that reverts the default behavior of `overflow` to be hidden again. The intent of this kill switch is to give applications more time to migrate if necessary (e.g. if they are depending on third party packages with native components that are not compatible with `overflow` being visible by default).
To use the flag, simply set:
import com.facebook.react.views.view.ReactViewGroup;
// Somewhere in the initialization of your application.
ReactViewGroup.sDefaultOverflowHidden = true;
Reviewed By: achen1
Differential Revision: D8718963
fbshipit-source-id: 0eb9aee45dfe04e9ae34d86e3bedcd30a185ef82
Summary:
Fixes `ReactScrollView` so that it respects the drawing rect (i.e. the bounding box of the element).
In JavaScript, this is the backing view for `ScrollView` (vertical) on Android.
Reviewed By: fadinghorse
Differential Revision: D8710256
fbshipit-source-id: f3bd96e39b8569cfcb21e486944b70fdb57c12b6
Summary:
Removes the concept of instance handle. Instead we pass the event target
to createNode and don't pass it to subsequent clones.
The life time of the event target is managed by native (the event emitter).
It has to be released manually.
Reviewed By: shergin
Differential Revision: D8688330
fbshipit-source-id: e11b61f147ea9ca4dfb453fe07063ed06f24b7ac
Summary:
Adds support for the `overflow` style property on React Native for Android.
This is the second attempt to do this. See 6110a4cc75 (D8666509) for the first attempt.
Similar to the first attempt, this sets `setClipChildren(false)` by default on all `ViewGroup` instances. However, this differs in how it implements `overflow: hidden`. Instead of conditionally setting `setClipChildren`, this manually clips children to the `ViewGroup`'s bounds (which was incidentally what we were doing for background + border radius already).
Reviewed By: achen1
Differential Revision: D8690805
fbshipit-source-id: 58757825cd9d138c18c8758918d85b4ca1915f87
Summary:
Tidies up the hardcoded strings for referencing the `overflow` style values.
Also, the `OVERFLOW` case in the optimized view flattening code path is unnecessary because `OVERFLOW` is already in the `LAYOUT_ONLY_PROPS` set.
Reviewed By: achen1
Differential Revision: D8690804
fbshipit-source-id: 3befbe93ed761e57e45f9b50e59bffc8a29a407f
Summary:
Reverts D8666509. Unfortunately, I misunderstood `setClipChildren` on Android.
When set on a `ViewGroup`, `setClipChildren` configures whether its //children// — not itself — are clipped to their bounds. This is unlike `overflow` (as it behaves on iOS) which configures whether the view itself is clipped to its bounds.
But they are definitely related. In theory, I think we could implement `overflow` using `setClipChildren` by:
- Setting `setClipChildren(false)` by default. (This part, I got right.)
- When `overflow` is set to `hidden` on a `View`, we create an extra `ViewGroup` (child) within the normal `ViewGroup` (parent). Then, we can set `setClipChildren(true)` on the parent `ViewGroup` which will cause the child `ViewGroup` to be clipped to its bounds.
However, I think the tricky thing will be to create the child `ViewGroup` without incurring unintentional side effects.
I need to decide whether or not this is worth trying. The alternative is to add a new `clipChildren` boolean prop that is Android-only, but I really hate further bifurcating the platform. But for now, I am reverting my mistake.
Reviewed By: achen1
Differential Revision: D8690551
fbshipit-source-id: 1ba3bbcc5458ffbd5c475430ea0382b3fd0916b2
Summary:
This diff refactors the cloning mechanism for YogaNode used from Fabric UI renderer and RN iOS graphs.
Previously, we were cleaning the owner of the child's cloned node inside the C++ implementation of YogaNode. This was a mistake because this modified the last commited YogaTree, causing side effect in RN iOS graphs.
Reviewed By: shergin
Differential Revision: D8672627
fbshipit-source-id: c9902d00690e0361fd58aed84b506c42258bd995
Summary:
This PR sets gradle targetSdkVersion to 26, which will satisfy new requirements from Play Store. Also removed redundant config from manifest files.
Closes https://github.com/facebook/react-native/pull/19944
Differential Revision: D8679682
Pulled By: hramos
fbshipit-source-id: 5c900d47be1d8b81ce340e38a05d9b309da143c3
Summary:
Adds support for the `overflow` style property on React Native for Android.
This switches overflowing views to be visible by default with the ability to override this at the container level using `overflow: 'hidden'`. This is the same behavior as React Native on iOS.
One major caveat to this solution is that it uses `setClipChildren` which does not extend the hit target to the overflow draw regions. While this is a pitfall, the current state of React Native on Android where `overflow` is hidden by default (which is the opposite of iOS) is also a huge pitfall. But I think this moves us in the right direction because where you *don't* need the touch behavior, you are now able to leverage overflow draws.
Reviewed By: himabindugadupudi
Differential Revision: D8666509
fbshipit-source-id: 5e98e658e16188414016260224caa696b4fbd390
Summary:
This reverts 5898817fc "Implement letterSpacing on Android >= 5.0".
Testing shows that that commit is the cause of #19126, where in a
controlled TextInput after some text is first added, then deleted,
further interaction with the TextInput becomes extremely slow.
Fixes#19126.
Tried the repro case from #19126 without this change, then with it.
The issue reproduces, then doesn't.
Closes https://github.com/facebook/react-native/pull/19645
Differential Revision: D8675230
Pulled By: hramos
fbshipit-source-id: e2c2d352ee781898721b2dff4738572d1a6b7471
Summary:
@public
Apps may need to listen for custom commands via the packager connection. This allows registering such listeners.
Reviewed By: raluca-elena
Differential Revision: D8654477
fbshipit-source-id: 5f17298a88fec31b8939236fef48ee46c0ba2ee8
Summary:
bump glog to 0.3.5.
Version 0.3.4 added support for libc++ or clang. Starting with revision 11, Android NDK recommends and defaults to clang, so it'll add support for it.
notable changes in 0.3.4 and 0.3.5:
* add libc++ support
* reduce dynamic allocation from 3 to 1 per log message
* style fix for C++11
* Add CMake support
Closes https://github.com/facebook/react-native/pull/19890
Differential Revision: D8662179
Pulled By: hramos
fbshipit-source-id: ae2554d36e5b922e8649fc2ac7afc273a34cc127
Summary:
bump double conversion to 1.1.6.
Version 1.1.2 added ARM 64 support, so it's a step to add support for 64bit in RN.
Closes https://github.com/facebook/react-native/pull/19885
Differential Revision: D8662108
Pulled By: hramos
fbshipit-source-id: 446d83eab4df90efed9c08eac912e7f857b7f253
Summary:
@public
This diff deprecates and deletes the UIImplementationProvider class.
It is not required to create an UIImplementation provider anymore, from now on the UIImplementation is created inside the UIManagerModule.
If you are using the UIImplementationProvider to create a ReactInstanceManager
e.g.:
```
ReactInstanceManager =
getReactInstanceManagerBuilder()
...
.setUIImplementationProvider(...)
...
.build();
```
Then you should just remove that line:
```
ReactInstanceManager =
getReactInstanceManagerBuilder()
.set.....
.build();
```
Reviewed By: achen1
Differential Revision: D8650376
fbshipit-source-id: 8d883295d8bf6578a99685edf6a2a84c6d0df0cf
Summary:
This diff removes the Nodes implementation from the source code. Why I'm deleting this code:
- I enabled nodes in catalyst app and it doesn't render even the first screen (see error images)
- This code is not being used at all inside facebook
- The last relevant commit I found was done in April 2017.
- Deleting this code make it easy to do refactors, as we don't have to modify this code.
When rendering an Image:
{F131075074}
When clicking on "RELOAD":
{F131075075}
Based on these errors I assume that this is not being used in Open Source. CC @[121800083:hramos]
Reviewed By: hramos
Differential Revision: D8640978
fbshipit-source-id: 243ee6440ebdbd24fd9f3daadc1066fd8487d9cc
Summary:
According to [ndk release notes](https://github.com/android-ndk/ndk/wiki/Changelog-r14-beta1#ndk-build) flag APP_ALLOW_MISSING_DEPS should be set to true in order to fix ndk-build tool.
If it builds it will work. On older ndk flag is ignored.
[ANDROID] [MINOR] [Application.mk] - build with android-ndk-14+ supported
Closes https://github.com/facebook/react-native/pull/18814
Differential Revision: D8643513
Pulled By: hramos
fbshipit-source-id: d96f8c039a754b9b95839f0a0bd98fcfdaf39bd4
Summary: D8576087 has all the details. Merge conflict messed up the diff hence a new one.
Reviewed By: yungsters
Differential Revision: D8628053
fbshipit-source-id: 8b211864f8f9d6b56f9469396eaa1d8291bbb56f
Summary:
Sync fbjni with `libaries/fbjni`.
This includes a hack to fix a deadlock we found for cmake-debug variants only. This still gets us back in sync with other fbjni consumers which is going to save us trouble in the future if Yoga ever wants to make use of a newer feature.
Manual changes made in addition to the hand-crafted CMakeLists and cxx buck rules:
- `jni::isObjectRefType` has SDK lookup disabled.
- `fbjni/` path is changed back to `fb/` to retain compatibility with Yoga.
Reviewed By: priteshrnandgaonkar
Differential Revision: D8531991
fbshipit-source-id: 776f519e2e5f9bea37f55990348f7ed81c4860b4
Summary: This diff improves performance of re-layout and delivery of OnLayout events for Fabric surfaces.
Reviewed By: fkgozali
Differential Revision: D8622718
fbshipit-source-id: 703b6c3ca70b570e8fb79ae1c1e8d9e8fcd38658
Summary:
This PR will bump NDK APP_PLATFORM to android-16. Below is the excerpt from NDK documentation
> This variable contains the minimum Android platform version you want to support. For example, a value of android-15 specifies that your library uses APIs that are not available below Android 4.0.3 (API level 15) and can't be used on devices running a lower platform version. For a complete list of platform names and corresponding Android system images, see Android NDK Native APIs.
Closes https://github.com/facebook/react-native/pull/19830
Differential Revision: D8620017
Pulled By: hramos
fbshipit-source-id: 0b5578f130938e3ddae03fb855784193183243cf
Summary:
This will bump android build tools to 26.0.3, and will remove warning about newer version of build tools in Android Studio, thus improve developer experience.
Closes https://github.com/facebook/react-native/pull/19831
Differential Revision: D8620094
Pulled By: hramos
fbshipit-source-id: fa1c6739bb7556736c1b323acea88fe87e82f4d7
Summary: This diff optimizes the delivery of onLayout event and re-lauout of views when ReactShadow nodes are updated. This only affects Fabric rendering.
Reviewed By: shergin
Differential Revision: D8601659
fbshipit-source-id: 3e33521e53170320ea952003fada5297a7605934
Summary: This diff checks if ReactShadowNode is sealed before updaing it.
Reviewed By: fkgozali
Differential Revision: D8584768
fbshipit-source-id: 64163d4bf124263d92153f68914c617f007fd90d
Summary: This diff introduces the concept of "Seal" ReactShadowNodes. This new field will be used to guarantee immutability of commited ReactShodow Nodes.
Reviewed By: fkgozali
Differential Revision: D8552709
fbshipit-source-id: dfd95730f10341af0dd762f8a8aa186563cf33e9
Summary: This diff cleans up the parent / owner references for children of ReactShadowNode / YogaNode during cloning. The reason of this behavior is to avoid retaining every generation of trees during cloning. This fixes a memory leak detected when running the ProgressBarExample.android.js in catalyst app
Reviewed By: fkgozali
Differential Revision: D8019894
fbshipit-source-id: b0d38f0c836ffec534f64fa1adbd7511ecf3473d
Summary:
In D8515300 we used the uiManagerType to call the setJSResponder method in UIImplementation or FabricUIManager.
There is a small chance that one of the reactTags received by parameter belongs to a View that is not managed by ReactNative, in that case we could be try to use FabricUIManager from UIManagerModule when Fabric is not running yet, causing a RN crash.
The fix consists in keep calling the UIImplementation.setJSResponder() method for any reactTag, and then perform a NOOP if the ReactShadowNode can not be found.
Reviewed By: fkgozali
Differential Revision: D8518192
fbshipit-source-id: 954fdd5dbed758ef73c16dad7da6b59ed83fe46a
Summary:
Before this fix, ReactNative screens that uses the Fabric renderer crashes when an event is dispatched. The root cause of the bug is that React JS executes the setJSResponder method in UIManagerModule, but this method is not implemented yet in Fabric.
This fix will have to be picked into current RC to fix events into the City Guides screen running the Fabric experiment
Reviewed By: fkgozali
Differential Revision: D8515300
fbshipit-source-id: 40fe2f77987470abed8164f848680a911efa4bd2
Summary:
Suppress lint errors in Dialog module. remove abortOnError=false.
This might hide future problems, so removing it
``` gradle
lintOptions {
abortOnError false
}
```
Builds locally just fine. But CI is failing for unknown reasons. https://circleci.com/gh/dulmandakh/react-native/265
RNTester will built without errors
Closes https://github.com/facebook/react-native/pull/19740
Differential Revision: D8450600
Pulled By: hramos
fbshipit-source-id: faf508a0c546af18a05ee224628f88b02a38ab9f
Summary:
Android Support Library page says https://developer.android.com/topic/libraries/support-library/
> Caution: Starting with Support Library release 26.0.0 (July 2017), the minimum supported API level across most support libraries has increased to Android 4.0 (API level 14) for most library packages. For more information, see Version Support and Package Names in this document.
_android.support.v4.app.FragmentActivity_ is used to support **Fragment**s on Android API versions below 11. Now, we support only API version 14 and above, it's ok to remove _ReactFragmentActivity_ that extends _FragmentActivity_.
Once ReactFragmentActivity removed, we can remove some codes that use _android.support.v4_ to work support _ReactFragmentActivity_ on **unsupported** Android versions.
CI is failing for unknown reasons: https://circleci.com/gh/dulmandakh/react-native/278
> Received 'killed' signal
Everything will build and work just fine, except showing _ ReactFragmentActivity_ as deprecated
Closes https://github.com/facebook/react-native/pull/19741
Differential Revision: D8454968
Pulled By: hramos
fbshipit-source-id: e5f901438ef764163af013fe854904a28c73070a
Summary:
On pre-M devices, `PermissionsAndroid.request` currently returns a boolean, whereas on newer, it returns GRANTED, DENIED or other constants defined in `PermissionsModule.java`
given the example form the [docs](https://facebook.github.io/react-native/docs/permissionsandroid.html) which I guess many people use, this will lead to code that does not work before M (it will tell you that permissions are not given even if they are in the manifest).
I believe the author of [this](51efaab120) forgot to change the resolved value in this one place but changed it in other places, eg [here](51efaab120 (diff-2a74096453bc8faa5d4a1599ad0ab33fL99)).
The docs are written correctly:
> On devices before SDK version 23, the permissions are automatically granted if they appear in the manifest, so check and request should always be true.
but the code is not right because we'd need to check for `if (granted === PermissionsAndroid.RESULTS.GRANTED || granted === true) {`
Also, the behavior is done correctly in [requestMultiplePermissions](26684cf3ad/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java (L148)) so returning a boolean is an inconsistency.
I tested this locally. The code is the same as on line [148](26684cf3ad/ReactAndroid/src/main/java/com/facebook/react/modules/permissions/PermissionsModule.java (L148)) where it is done correctly.
[ANDROID] [BUGFIX] [PermissionAndroid] - return GRANTED / DENIED instead of true / false on pre-M android
<!--
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [ {Component} ]
[ INTERNAL ] [ ENHANCEMENT ] [ {Filename} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/19734
Differential Revision: D8450402
Pulled By: hramos
fbshipit-source-id: 46b0b7f83f81d817d60234f155d43de7f57248c7
Summary:
I met the error `Native module xyz tried to override xyz for module name xyzModuleName. If this was your intention...` after something went wrong during `react-native link` - one module somehow ended up being included twice in the `getPackages` method, as in:
```java
Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new WowPackage(),
new WowPackage(),
```
Since I have > 20 native modules it took me a little while to find out what the problem was. The improved error message should make the problem clearer to anybody who may encounter it. I did try to refactor the code a little more, by extracting the whole part of:
```java
String name = moduleHolder.getName();
if (namesToType.containsKey(name)) {
Class<? extends NativeModule> existingNativeModule = namesToType.get(name);
if (!moduleHolder.getCanOverrideExistingModule()) {
throw new IllegalStateException(getModuleOverridingExceptionMessage(
type.getSimpleName(),
existingNativeModule.getSimpleName(),
name
));
}
mModules.remove(existingNativeModule);
}
namesToType.put(name, type);
mModules.put(type, moduleHolder);
```
out into a separate method since there were two places where nearly identical code was written.
I have built RN from source and used it in a very simple app with RN vector icons (the package creates a native module as can be seen [here](https://github.com/oblador/react-native-vector-icons/blob/master/android/src/main/java/com/oblador/vectoricons/VectorIconsPackage.java#L19)).
After including the module twice, ie.
```java
Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new VectorIconsPackage(),
new VectorIconsPackage()
);
}
```
I get the improved error description, as seen in the screenshot.
<img src="https://user-images.githubusercontent.com/1566403/36340960-3289d9d0-13e7-11e8-8d17-e1651da17841.png" height="500">
[ANDROID] [MINOR] [NativeModuleRegistryBuilder] - Improve error message and refactor putting native modules to module maps
Closes https://github.com/facebook/react-native/pull/16402
Differential Revision: D8421392
Pulled By: hramos
fbshipit-source-id: 719bd37b4681933d35858621b402ae73dd460a5b
Summary:
Android Target API Level 26 will be required starting from August 2018, it's so soon 😄.Read https://android-developers.googleblog.com/2017/12/improving-app-security-and-performance.html
This PR uses android build tools 26.0.2, support library 26.1.0 (with android lifecycle) and setting compileSdkVersion to 26, but leaving minSdkVersion and targetSdkVersion intact, which will make targeting 26 easy.
Circle CI: https://circleci.com/gh/dulmandakh/react-native/209
Everything will build and work just fine.
[ANDROID] [ENHANCEMENT] [TOOLS] - Use android build-tools 26.0.2 and set compileSdk to 26, and use support library version 26.1.0.
Closes https://github.com/facebook/react-native/pull/19662
Differential Revision: D8398855
Pulled By: hramos
fbshipit-source-id: a4066eb04cb5f947efe1f3202b638c1092b79aae
Summary:
Motivation: getting NPE on BlobModule part
<img width="1718" alt="screen shot 2018-06-12 at 3 03 48 pm" src="https://user-images.githubusercontent.com/4340636/41292212-31e0acc8-6e52-11e8-916a-dd6fc2bb695a.png">
Should still build and pass all tests since project settings changes should be safe changes.
<!--
Required: Write your test plan here. If you changed any code, please provide us with
clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->
No documentation change is required
<!--
Does this PR require a documentation change?
Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->
<!--
Required.
Help reviewers and the release process by writing your own release notes. See below for an example.
-->
[ANDROID][BUGFIX][BlobModule] safe equals checks
<!--
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [ {Component} ]
[ INTERNAL ] [ ENHANCEMENT ] [ {Filename} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/19675
Differential Revision: D8380228
Pulled By: hramos
fbshipit-source-id: 1d3caefdb7a7d638228490ef7b3771617745d26f
Summary:
I'm not totally sure what I'm doing so if this needs changes let me know.
Closes https://github.com/facebook/yoga/pull/775
Reviewed By: emilsjolander
Differential Revision: D8331892
Pulled By: passy
fbshipit-source-id: eb1023e666322d2472e4081fd4a4e72a7b43d049
Summary:
Fixes#18637 & #19309
<!--
Required: Write your test plan here. If you changed any code, please provide us with
clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->
Check Android `ReactImagePropertyTest` tests pass.
<!--
Does this PR require a documentation change?
Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->
<!--
Required.
Help reviewers and the release process by writing your own release notes. See below for an example.
-->
[ANDROID] [BUGFIX] [Unit Tests] - Fix ReactImagePropertyTest SoLoader failure
<!--
**INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**
CATEGORY
[----------] TYPE
[ CLI ] [-------------] LOCATION
[ DOCS ] [ BREAKING ] [-------------]
[ GENERAL ] [ BUGFIX ] [ {Component} ]
[ INTERNAL ] [ ENHANCEMENT ] [ {Filename} ]
[ IOS ] [ FEATURE ] [ {Directory} ] |-----------|
[ ANDROID ] [ MINOR ] [ {Framework} ] - | {Message} |
[----------] [-------------] [-------------] |-----------|
EXAMPLES:
[IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
[ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
[CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
[DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
[GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
[INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/19607
Differential Revision: D8325415
Pulled By: hramos
fbshipit-source-id: 598baa3499646bb50da065815c19bb9f76bf6c87