2798 Commits
Author SHA1 Message Date
Lorenzo Sciandra 44bfffb116 [0.57.5] Bump version numbers 2018-11-13 15:07:04 +00:00
Lorenzo Sciandra 08b14f4814 Revert "Fix ReactRootView mount/unmount race condition"
This reverts commit 6524591c7e.
2018-11-09 15:44:02 +00:00
Andrew Chen (Eng)andLorenzo Sciandra 6524591c7e Fix ReactRootView mount/unmount race condition 2018-11-09 14:01:35 +00:00
DulmandakhandLorenzo Sciandra 5d28300373 fix android ci (#21913)
Summary:
This PR adds support-annotations to devsupport buck dependency, which fixes Android CI.
Pull Request resolved: https://github.com/facebook/react-native/pull/21913

Differential Revision: D10842175

Pulled By: hramos

fbshipit-source-id: f3f3e0e6a3a5e9ceb18db11ac67e820a7f10937a
2018-11-07 10:30:54 +00:00
David VaccaandLorenzo Sciandra e8c9f3cc9b RN crash when processing Exception with null message
Summary: This diff fixes a crash that happens when a component throws an exception that contains a null message

Reviewed By: achen1

Differential Revision: D10429661

fbshipit-source-id: 9faed36906844b51f5a3dc2b3cbc80ede6b93457
2018-11-07 10:05:54 +00:00
David VaccaandLorenzo Sciandra 676985f4b6 Re-introduce UIImplementationProvider 2018-11-07 10:05:43 +00:00
David VaccaandLorenzo Sciandra 293fd40077 Remove unused parameters in ReactInstanceManager methods
Summary: Just a small diff to remove some unused parameters in some methods of the ReactInstnaceManager class

Reviewed By: achen1

Differential Revision: D10011168

fbshipit-source-id: 2247ecd01bfc63c27837c6abad4bff1b4e590ac0
2018-11-06 10:39:40 +00:00
Sergei DryganetsandLorenzo Sciandra 820612207a Incorrect ref API usage fixed. (#20913)
Summary:
release method of local_ref and global_ref doesn't call deallocator, in fact, it leaves the caller responsible for deletion of the reference, while otherwise the reference is released on scope left.

Fixes #18292.
Pull Request resolved: https://github.com/facebook/react-native/pull/20913

Differential Revision: D9616237

Pulled By: hramos

fbshipit-source-id: 021aa3e4f039e6b7a98da3e4224c1ee49d5a4921
2018-11-06 10:39:09 +00:00
Lorenzo Sciandra 468161232e [0.57.4] Bump version numbers 2018-10-25 17:52:59 +01:00
Stephen CookandLorenzo Sciandra ef835b52e7 Android textTransform style support (#20572)
Summary:
Issue https://github.com/facebook/react-native/issues/2088 (closed, but a bit pre-emptively imo, since Android support was skipped)

Related (merged) iOS PR https://github.com/facebook/react-native/pull/18387

Related documentation PR https://github.com/facebook/react-native-website/pull/500

The basic desire is to have a declarative mechanism to transform text content to uppercase or lowercase or titlecase ("capitalized").
Pull Request resolved: https://github.com/facebook/react-native/pull/20572

Differential Revision: D9311716

Pulled By: hramos

fbshipit-source-id: dfbb855117196958e7ae5e980700d31be07a448d
2018-10-23 09:32:15 +01:00
David VaccaandLorenzo Sciandra 05a036da6d Cleaning up imports in ViewGroupManager
Summary: Trivial cleanup of imports in ViewGroupManager class

Reviewed By: shergin

Differential Revision: D10343029

fbshipit-source-id: 0b049df545a4101f11dd67809c9a96723e746945
2018-10-23 09:32:06 +01:00
Mehdi MulaniandLorenzo Sciandra be39e8a4f3 Fix onTextLayout metrics on Android when using alignText
Summary:
With this, we send the correct x position when using center or right aligned text. In order to accomplish this though, we have to pass the text alignment into the Layout object that we create.

Also update RNTester to allow us to try different alignments.

Reviewed By: sahrens

Differential Revision: D10316494

fbshipit-source-id: 11c7d2a59e636528f12211168acb46f16b54a126
2018-10-23 09:31:39 +01:00
Mehdi MulaniandLorenzo Sciandra 1e3eb9c5ec Android: Send <Text> metrics in onTextLayout events
Summary:
@public
As we're doing in D9440914 (OSS 64a52532fe), send text metrics in an onTextLayout callback. These can be used by surrounding views for doing complicated layout like:
- displaying a cursor at the end of text
- vertical centering using capheight-baseline

This right now isn't very performant but is only done when `onTextLayout` is set. I plan to optimize it with a capheight and xheight cache in a follow up diff.

Reviewed By: achen1

Differential Revision: D9585613

fbshipit-source-id: aa20535b8371d5aecf15822d66a0d973c9a7eeda
2018-10-23 09:30:59 +01:00
Jonathan LeeandLorenzo Sciandra ac3b236c71 Back out "[react-native][PR] Rounded corner rendering fixed on Android N."
Summary:
Original PR: https://github.com/facebook/react-native/pull/21340

The original PR fixed a bug with border radius on Android 7.0, but caused a new bug where no `ReactART` components would render if they were nested within a View with border radius set.

Differential Revision: D10409352

fbshipit-source-id: 0b4e36ae9d4c3bc2f4884a43909f8efdeeb41b74
2018-10-23 09:30:17 +01:00
Haitao LiandLorenzo Sciandra d9f5319cf0 Fix DynamicFromMap object pool synchronization (#17842)
Summary:
DynamicFromMap internally uses SimplePool object to recycle dynamic prop objects. But the pool is not multi-thread safe. Currently the most used dynamic props are size props such as left, paddingVertical, marginTop and so on. These props are only accessed from the layout thread so the pool works fine. If a dynamic prop is needed in UI thread, then the two threads can access the same pool object and cause random errors. This PR make the pool object thread local to avoid synchronization. After this change there are two pool objects created in the process.

Tested in official Airbnb app after updating accessibilityComponentType to be dynamic.

Once this is merged, I'll send another PR to support "disabled" state in `accessibilityComponentType`.

[ANDROID] [BUGFIX] [DynamicFromMap] - Fix a crash caused by dynamic props.
Pull Request resolved: https://github.com/facebook/react-native/pull/17842

Differential Revision: D10374238

Pulled By: hramos

fbshipit-source-id: 7ebf89c5abf06bd5fb43b205348ba4dc7e19517d
2018-10-23 09:29:30 +01:00
DulmandakhandLorenzo Sciandra b6f474cf5a bump okhttp3 to 3.11 (#21626)
Summary:
OkHTTP3 3.11 version includes many bug fixes, and few new features. Also it embed R8/ProGuard rules in the jar, which will help reduce APK size.

Changelog https://github.com/square/okhttp/blob/master/CHANGELOG.md
Pull Request resolved: https://github.com/facebook/react-native/pull/21626

Differential Revision: D10367048

Pulled By: RSNara

fbshipit-source-id: b168138178f96eeefba493002f7b6a2e921a531d
2018-10-19 15:47:58 +01:00
DulmandakhandLorenzo Sciandra 82f241dd69 Consolidate native dependencies versions (#20742)
Summary:
This PR tries to consolidate Android native dependencies versions to make it less error prone to version bumps.
Pull Request resolved: https://github.com/facebook/react-native/pull/20742

Differential Revision: D9818155

Pulled By: hramos

fbshipit-source-id: 9bf631640910edad5731014f4e23dbca45af2b59
2018-10-19 15:47:55 +01:00
Andrew Chen (Eng)andLorenzo Sciandra f49f633d03 Fix accessibilityRole value lookup (with conflict fixed) 2018-10-19 15:17:47 +01:00
Haseeb SaeedandLorenzo Sciandra 94a0146c02 Fix accessibility role crash
Summary: We were using a locale-specific `toUpperCase()` for accessibility roles. In the Turkish locale, `"image".toUpperCase()` does not become `"IMAGE"`; it becomes some weird turkish alphabet word, and we throw an error. This diff uses US-locale to avoid the error.

Reviewed By: YaoPersonal

Differential Revision: D9402330

fbshipit-source-id: a3fd7c54eec4b313c7e9df9236adb7ae42854ed8
2018-10-19 15:16:36 +01:00
Lorenzo Sciandra 5139b0bef7 Revert "Update bad method"
This reverts commit 1592a8d424.
2018-10-19 14:22:35 +01:00
Lorenzo Sciandra 8fd5bcc888 [0.57.3] Bump version numbers 2018-10-12 12:19:21 +01:00
Radovan ŠmitalaandLorenzo Sciandra b1aed4d376 Normalize scheme for URL on Android (#21561)
Summary:
Android requires lowercase for URL scheme. This commit https://github.com/facebook/react-native/commit/d00bdb9bb8b9b11bce900689c7e28cebd2eb0807 fixed it but on React Native side.
Because it is Android specific, it should be fixed on Android side.

Android has method to normalize url scheme: https://developer.android.com/reference/android/net/Uri.html#normalizeScheme()
Pull Request resolved: https://github.com/facebook/react-native/pull/21561

Differential Revision: D10287868

Pulled By: hramos

fbshipit-source-id: f5e474164fdb2cfd49bd8ee51da17de3f1341a9c
2018-10-12 11:38:44 +01:00
Jonathan KimandLorenzo Sciandra 5468aeef03 Move RN's DEFS.bzl to tools and rename to rn_defs.bzl
Reviewed By: mzlee

Differential Revision: D9553765

fbshipit-source-id: cb65081668ea2726f24d2c9c02661e859cc7a994
2018-10-12 11:21:40 +01:00
Lorenzo Sciandra 46bb737b98 Revert "[0.57.3] Bump version numbers"
This reverts commit 56cde24863.
2018-10-12 10:28:20 +01:00
Mike Grabowski 56cde24863 [0.57.3] Bump version numbers 2018-10-11 23:39:41 +02:00
Mike Grabowski 1592a8d424 Update bad method 2018-10-11 23:35:08 +02:00
Emily JanzerandMike Grabowski 300ba7a87e Fix for InterpolatorType crash
Summary:
We're currently getting a redbox in Turkish when we try to convert the string 'easeInEaseOut' to an InterpolatorType. This is because I use toLowerCase() to compare the string without setting a locale; in Turkish, the capital letter 'I' doesn't convert to 'i' when you lowercase it, but rather to 'ı' (http://www.i18nguy.com/unicode/turkish-i18n.html).

Passing in a locale param to `toLowerCase()` fixes it. Also updating the test.

Differential Revision: D10315474

fbshipit-source-id: 54be3ff1d3f91cb2ec765ff705ac364b976b8c6f
2018-10-11 23:18:32 +02:00
Emily JanzerandMike Grabowski 69a51da3a1 Add test for InterpolatorType
Summary: Adding a test for the newly added InterpolatorType.fromString()

Reviewed By: axe-fb

Differential Revision: D10203814

fbshipit-source-id: f3c70db1a5754c79b1bdd881d266bec110934494
2018-10-11 23:18:30 +02:00
Emily JanzerandMike Grabowski 0df8e7d65b Simplify OSS enums
Summary: Simplifying our OSS enums (remove private variables and methods) so that redex can more easily optimize them for us.

Reviewed By: achen1, Feng23

Differential Revision: D9812796

fbshipit-source-id: 11a8272db41ff04399d1cdf366e28ddf1b07b7be
2018-10-11 23:17:31 +02:00
Andrew Chen (Eng)andMike Grabowski 21204d750e Fix accessibility role/label
Summary: D10138128 had some shamefully wrong boolean logic to determine whether we should customize the accessibility delegate. Previously, we did it if BOTH the accessibility label AND role were present. We should actually do it if EITHER are present.

Reviewed By: mdvacca

Differential Revision: D10182135

fbshipit-source-id: 209a8ab43f5869762843fe878cfd59a7b9b5ab1a
2018-10-11 21:48:45 +02:00
Andrew Chen (Eng)andMike Grabowski 677f1de70b Fix default accessibility delegate
Summary:
The current accessibility implementation tries to generalize every view's accessibility node info by setting an accessibility delegate on every view -- regardless of whether or not any accessibility properties are set. This delegate however doesn't correctly set the appropriate accessibility node fields for every view. For example, ScrollViews needs AccessibilityNode.setScrollable(true) set, but the generic delegate does not account for this. For now let's avoid unnecessarily
setting an accessibility delegate on views that don't have any accessibility props set, which will likely fix the majority of these issues.

Reviewed By: mdvacca

Differential Revision: D10138128

fbshipit-source-id: b999b41e7256e3dce94cd70e9b944979d52f74fd
2018-10-11 21:48:39 +02:00
Mike Grabowski 113e891264 Revert "Fix accessibility role/label"
This reverts commit fa6035bda6.
2018-10-11 21:47:40 +02:00
Oleg LokhvitskyandMike Grabowski 1fa7150ce9 Android ScrollView fix for snapToInterval not snapping to end
Summary:
The end-of-scrollable-range offset was not clipped before the nearestOffset calculation causing the ScrollView to not snap to the end of the view when the width of the ScrollView was not an exact multiple of snapToInterval.

Addresses https://github.com/facebook/react-native/issues/21116#issuecomment-427944838

Reviewed By: yungsters

Differential Revision: D10248545

fbshipit-source-id: 2bdc94ea0a9d9f063769f2c5da4c33d4872b1db2
2018-10-11 21:43:10 +02:00
Lorenzo SciandraandMike Grabowski 47a1b0461b Update to Detox 9 (#21570)
Summary:
Updating to Detox 9 - this should help with better Xcode 10 support, and should fix https://github.com/facebook/react-native/issues/21539.

I've updated to fixed `9.0.4` since it seems that each version is fairly different from the next, and I've followed the [migration guide](https://github.com/wix/detox/blob/master/docs/Guide.Migration.md#migrating-from-detox-8xx-to-9xx) for the android native dependencies.

Release Notes:

[INTERNAL] [ENHANCEMENT] [DETOX] - Update to version 9.0.4

Pull Request resolved: https://github.com/facebook/react-native/pull/21570

Reviewed By: TheSavior

Differential Revision: D10242373

Pulled By: RSNara

fbshipit-source-id: bd29d554e0972f16d96b9b39b86c7143941d5b7c
2018-10-11 21:42:12 +02:00
Alexander KhayloandMike Grabowski 265804867c Fix CameraRoll.getPhotos() crash on Android if device has a problematic video asset (#21438)
Summary:
Changed catching IOException to Exception
Fixes #20112
Pull Request resolved: https://github.com/facebook/react-native/pull/21438

Differential Revision: D10132453

Pulled By: hramos

fbshipit-source-id: c68fa8c45d43e4f2d116b8084ffd731ad6bf5aec
2018-10-11 21:39:43 +02:00
Marc HorowitzandMike Grabowski 413e7c8304 When converting arguments JS->Java, handle integers correctly
Summary:
If a folly::dynamic contains a double when a Java method is
declared to take an int, getInt() will be called, and a C++ exception
will be thrown.  This change uses similar logic to
NativeReadableMap.getInt() to convert a folly::dynamic double to a
jint.  This will still throw an exception if the JS value cannot be
represented as a jint without loss.

Reviewed By: fromcelticpark

Differential Revision: D10209492

fbshipit-source-id: fd96416200c6b283ce5c8f8fa4c227ceb8f43054
2018-10-11 21:39:29 +02:00
Andrew Chen (Eng)andMike Grabowski 049e56e272 Fix accessibility role/label
Summary: D10138128 had some shamefully wrong boolean logic to determine whether we should customize the accessibility delegate. Previously, we did it if BOTH the accessibility label AND role were present. We should actually do it if EITHER are present.

Reviewed By: mdvacca

Differential Revision: D10182135

fbshipit-source-id: 209a8ab43f5869762843fe878cfd59a7b9b5ab1a
2018-10-11 21:37:13 +02:00
Hector Ramos 4a440f4018 [0.57.2] Bump version numbers 2018-10-04 13:29:30 -07:00
Hector Ramos 67dca8bbf9 Revert "[0.57.2] Bump version numbers"
This reverts commit b7437639df.
2018-10-04 13:29:04 -07:00
Hector Ramos b7437639df [0.57.2] Bump version numbers 2018-10-04 11:40:58 -07:00
Hector Ramos e4607a4ec3 Revert "[0.57.2] Bump version numbers"
This reverts commit 8e810838a2.
2018-10-04 11:40:24 -07:00
Mike Grabowski 8e810838a2 [0.57.2] Bump version numbers 2018-10-04 17:01:57 +02:00
Mike Grabowski 29fb119404 Revert "[0.57.2] Bump version numbers"
This reverts commit 4aec7c953e.
2018-10-04 17:01:51 +02:00
Mike Grabowski 4aec7c953e [0.57.2] Bump version numbers 2018-10-02 14:39:35 +02:00
Mike Grabowski 63cf888161 Revert "[0.57.2] Bump version numbers"
This reverts commit aae1e296e9.
2018-10-02 14:38:01 +02:00
Oleg LokhvitskyandMike Grabowski 0869e546fe Android ScrollView fix for pagingEnabled
Summary:
The snapToOffsets changes improved the flinging algorithm for snapToInterval/snapToOffsets but actually broke it for pagingEnabled because it's meant to only scroll one page at a time.

First, I just brough back the old algorithm, but noticed that it has a bunch of issues (e.g. #20155). So, I tried to improve the algorithm to make sure it uses the proper target offset prediction using the same physics model that Android uses for it's normal scrolling but still be limited to one page scrolls.

This resolves #21116.

Reviewed By: shergin

Differential Revision: D9945017

fbshipit-source-id: be7d4dfd1140f4c4d32bad93a03812dc80286069
2018-10-02 14:33:06 +02:00
Mike Grabowski aae1e296e9 [0.57.2] Bump version numbers 2018-10-02 14:30:15 +02:00
Timothy KukulskiandMike Grabowski b7ba2255df allow zero offset when shadow radius is nonzero
Summary:
update creation logic for text shadow: allow shadows with zero offset when the radius is nonzero

(?should we also add a check to drop the node as a no-op when color.alpha == 0 ?)

Reviewed By: yungsters

Differential Revision: D10017778

fbshipit-source-id: 0168ac6db5ad22a5d7eb32dcd184aede361d6651
2018-10-02 14:29:27 +02:00
Krzysztof MagieraandMike Grabowski bc973d20e0 Expose a getter for overflow setting in ReactViewGroup (#21398)
Summary:
This change adds getter for overflow attribute in ReactViewGroup class. Overflow setting can affect how view children are drawn but also how hit testing behaves when receiving touch. Exposing this setting makes it possible for gesture-handler library to implement proper hit testing that takes into account overflow property of a view.
Pull Request resolved: https://github.com/facebook/react-native/pull/21398

Differential Revision: D10105398

Pulled By: shergin

fbshipit-source-id: 15ae2b31be3bf80e7e1d28b87ce4474af0f486f5
2018-10-02 14:29:16 +02:00
Artur ChruscielandMike Grabowski 8744e00ea9 Check if child view != null before dropping (#20465)
Summary:
Fixes our top crash when framework try drop a view from parent, but it's a null (already removed etc.).

Fixes #20288
Pull Request resolved: https://github.com/facebook/react-native/pull/20465

Differential Revision: D10113976

Pulled By: hramos

fbshipit-source-id: 34f5654f3bdbc63eb7f7d0b5c94885576fc3cdcd
2018-10-02 14:29:06 +02:00