Commit Graph

2775 Commits

Author SHA1 Message Date
Haseeb Saeed 139559fc07 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-08-20 12:17:59 -07:00
Tim Yung 735be8b24d RN: Support Cached Bundles in Systrace
Summary:
When running Systrace, we currently only surface the JavaScript bundle that is pre-packaged in the binary.

This changes `ReactInstanceManager` so that we prefer a cached bundle if one exists. This allows running Systrace with local changes (as long as you load them into the client before running Systrace).

Differential Revision: D9389704

fbshipit-source-id: 031321b2e07539efc7f47a7c6947ab7b82dc7dfc
2018-08-17 23:16:46 -07:00
David Vacca f9c86f05e9 Implement remove root view operations
Summary: This diff implements the removal of react root view inside fabric cxx implementation

Reviewed By: shergin

Differential Revision: D8939942

fbshipit-source-id: 69835b55c80e2970d65220d947489bc1af4b125d
2018-08-16 16:52:42 -07:00
David Vacca 596f17efda Initialize FabricXX C++ code and register rootview
Summary: This diff initializes Fabric C++ UIManager code from java, it also registers android RootViews inside C++.

Reviewed By: shergin

Differential Revision: D8878148

fbshipit-source-id: 8b7924f715b135eda37bb2683206d3e321a2b7b2
2018-08-16 16:52:42 -07:00
David Vacca fd29878a8b Create CXX Binding
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: D8878123

fbshipit-source-id: ce41ad6addfdfb58e602b2dbafebd8f05847e69f
2018-08-16 16:52:42 -07:00
Marc Horowitz f71c6b6feb Expose executor name in ReactInstanceManager
Reviewed By: achen1

Differential Revision: D9231741

fbshipit-source-id: 34e616844c35b8cf8c7fb9760669a8905c3b86c5
2018-08-16 16:52:42 -07:00
Stephen Cook 22cf5dc566 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-08-13 21:31:57 -07:00
Alex Dvornikov 1cd9aa2dea Add REGISTER_JS_SEGMENT perf markers
Reviewed By: cwdick

Differential Revision: D9244289

fbshipit-source-id: 9004a0405f9622cbd0bbb837b99df32454f35bb8
2018-08-10 09:37:42 -07:00
Linus Unnebäck e6b305b722 Properly escape JavaScript code on Android (#20366)
Summary:
These changes will fix executing javascript with any special characters, by making use of the `evaluateJavascript` function on Android 4.4+, and by properly escaping the URI on Android <4.4.

Fixes #19611Fixes #20365Fixes #9749Closes #19655Closes #12321

This PR supersedes #19655 by patching the same problem in all the places, and fixing it for Android <4.4 as well.
Pull Request resolved: https://github.com/facebook/react-native/pull/20366

Differential Revision: D9242968

Pulled By: hramos

fbshipit-source-id: f2e1abc786ba333dbd8aaa8922e716fd99ec26e0
2018-08-09 11:16:59 -07:00
Wayne Cheng f536a0c268 Adding flow strict local to remaining possible files in xplat/JS
Summary:
ag -L --ignore __snapshots__ 'flow strict|noflow|generated|The controller you requested could not be found.' | ag '\.js$' | xargs ag -l 'flow' | sort > ~/temp
  cat ~/temp | xargs ag -L 'flow strict' | xargs sed -i '' 's/flow$/flow strict-local/'
  until flow check; do flow check --json | jq -r '.errors[].message[0].path' | sort | uniq | xargs hg revert; done

allow_many_files
The controller you requested could not be found.
The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9004573

fbshipit-source-id: 936bd5741706b781be06bf08b6ad805a69407dfd
2018-08-09 08:54:44 -07:00
Ram N 617e25d9b5 Explicitly make UIManagerModule use OnBatchComplete on Android
Summary:
Currently, we scan all native modules to see if they implement the OnBatchCompleteListerner. If they do, we add those modules to a list, and when C++ calls OnBactchComplete is called, we execute the callback on each of the modules.
The only native module implementing this callback today is the UIManagerModule. With Fabric, UIManager will also not be a native module anymore. This diff removes all the work done for creating the list and assumes that UIManagerModule is the only place that is interested in OnBatchComplete call - and calls it directly.

Reviewed By: achen1

Differential Revision: D9186651

fbshipit-source-id: 473586b37c2465ccd041985dcdd56132026f34f1
2018-08-08 14:18:07 -07:00
Dulmandakh 69912495f9 Bump imagepipeline-okhttp3 to 1.10.0 (#20580)
Summary:
This is a small missing piece from b6f2aad9c0 and will complete fresco version bump.
Pull Request resolved: https://github.com/facebook/react-native/pull/20580

Differential Revision: D9228658

Pulled By: hramos

fbshipit-source-id: 9cf1509a590cedfe4c3358006cfb62533058e946
2018-08-08 14:02:26 -07:00
Ziqi Chen d3f0919816 added accessibilityHints implementation on Android
Summary:
Implemented a version of accessibility Hints on android by adding hint text to the end of contentDescription. There is already an existing prop on js and iOS implementation.

Changes involve:
* adding a prop on native android code for accessibilityHints
* setting the accessibilityDelegate after the props are all loaded.
* Instead of directly updating the accessibility delegate, the prop setters now update state by setting the values of the variables. Once all props are set, the accessibility delegate is set based on the props
   * BaseViewManager keeps track of whether or not accessibility props have been set
   * AccessibilityDelegateUtil keeps track of what the props have been set to. (Renamed AccessibilityRoleUtil to AccessibilityDelegateUtil)

Currently, this is the easiest way of emulating the way accessibility hints work on iOS, and I think having an android counter part is better than having nothing.

It's different from iOS in that it will announce the hint before the role, and also cannot be turned off.

Ex:

if I set the accessibility like this:
```
      <View
        style={styles.container}
        accessible={true}
        accessibilityLabel="accessibility label"
        accessibilityRole="button"
        accessibilityStates={['selected']}
        accessibilityHint="accessibility Hint">
        <Text> Tester </Text>
      </View>
```

Talk back will read:
`accessibility label, accessibility Hint, button, selected`

In the future for next steps, I plan on investigating the process of making a second announcement after the first

Reviewed By: achen1

Differential Revision: D9037226

fbshipit-source-id: 8d484e1114eb69aa5f5314b3755b351b8ea80b09
2018-08-08 01:02:24 -07:00
David Aurelio 151ec411aa Back to JNI storage
Summary:
@public

This reverts the Yoga/Java storage experiment. I will follow up with any learnings.

Reviewed By: pasqualeanatriello

Differential Revision: D9168405

fbshipit-source-id: fb227fb9353bd4c4e3bebbe9b04eec1132e532e8
2018-08-06 02:16:22 -07:00
David Aurelio 73d5746122 Add `Unsafe` based storage backend
Summary:
@public

Adds another version of property storage for `YogaNode`, using `sun.misc.Unsafe`.

Adopts the stub concept from Litho for `Unsafe`, as it is hidden by the Android SDK.

Reviewed By: pasqualeanatriello

Differential Revision: D9140103

fbshipit-source-id: a4b376eca341b724a00f873467ae8bf8eaac69f4
2018-08-05 16:46:26 -07:00
Ram N 407e033b34 Remove the flag about Lazy native modules
Summary: The method removes all settings for mLazyReactModules since Lazy and non lazy modules can exist in a single application now

Reviewed By: achen1

Differential Revision: D9012312

fbshipit-source-id: 0420149654f8146453250d83d4de4b4c2fd31e9f
2018-08-02 16:02:36 -07:00
Ram N 42146a7a4a Fix LazyReactPackage in OSS
Summary:
In OSS, during gradle build, the ReactModuleSpecProcess annotation-processor does not run. As a result, the `ReactModuleInfo` that we need for CoreReactPackage is not generated, resulting in a runtime error.

The fix is to make LazyReactPackage revert to what it was doing earlier. In `NativeModuleRegistryBuilder`, if we dont find `ReactModuleInfo` for any `ModuleSpec`, we eagerly instantiate the module and get all the `ReactModuleInfo` from it. By returning an emoy collection if the class is not available, we force the modules in `CoreReactPackage` to use this codepath instead.

The alternate fix would be to ensure that the annotation processor runs in gradle/OSS. However, the annotation processor will be removed eventually in the future, and we will also be move to generating them for JS, so that work will soon be irrelevant.

Reviewed By: fkgozali, achen1

Differential Revision: D9130517

fbshipit-source-id: 469cf0e32a2f3650f098547667b3cd09a63eb1a0
2018-08-02 12:16:38 -07:00
Leo Nikkilä 1f88a7111d Fix view indices with Android LayoutAnimation (attempt 2) (#19775)
Summary:
/cc janicduplessis mdvacca

This addresses the same issue as #18830 which was reverted since it didn’t handle `removeClippedSubviews` properly.

When subview clipping is on, ReactViewGroup keeps track of its own children directly and accounts for the offset introduced by clipped views when calling ViewGroup methods that modify children.

Instead of accounting for just clipped children (views with no parent), it should account for any children that aren’t in the ViewGroup which also includes children that are being transitioned. If you look at the ViewGroup source code, [it explicitly retains the view parent until the transition finishes](https://github.com/aosp-mirror/platform_frameworks_base/blob/oreo-release/core/java/android/view/ViewGroup.java#L5034-L5036) which caused the `getParent()` checks to pass, even though those views should be ignored. I added a new `isChildInViewGroup` method that handles both clipped and transitioning views to fix this.

I reproduced the [earlier crash](https://github.com/facebook/react-native/pull/18830#issuecomment-382798628) by enabling clipping in [this test app](https://github.com/facebook/react-native/pull/18830#pullrequestreview-111758886) and adding a “clear views” button that resets the state to an empty items array with an animation.

- #18830

[ANDROID] [BUGFIX] [LayoutAnimation] - Removal LayoutAnimations no longer remove adjacent views as well in certain cases.
Pull Request resolved: https://github.com/facebook/react-native/pull/19775

Differential Revision: D9105838

Pulled By: hramos

fbshipit-source-id: 5ccb0957d1f46c36add960c0e4ef2a545cb03cbe
2018-08-02 07:01:42 -07:00
David Aurelio b91184885f Fix behaviour of `freeNatives()`
Summary:
@public

Prevents repeated deallocation of weak references.

Reviewed By: pasqualeanatriello

Differential Revision: D9131551

fbshipit-source-id: bc79596e056ae0657a55146ad786422fd0f5badc
2018-08-02 04:02:09 -07:00
David Aurelio cdf9b84dd0 Adapt micro benchmark
Summary:
- adds more property assignments
- reduces the number of layout roots that exist simultanously

Reviewed By: pasqualeanatriello

Differential Revision: D8989389

fbshipit-source-id: 6a0ac800a4caad61a2f4bf98caa314855b70875f
2018-08-02 04:02:08 -07:00
Himabindu Gadupudi 9f8b5a9ed5 If source is null , source uri is null or source is not an array should respect style
Summary: If source is null , source uri is null or source is not an array should respect style like in iOS

Reviewed By: yungsters

Differential Revision: D9018005

fbshipit-source-id: 5f695e8e3007c96e6004973e7fcbc6b57cc15249
2018-07-31 12:02:10 -07:00
gengjiawen b6f2aad9c0 Upgrade to soloader 0.5.1 (#20325)
Summary:
Upgrade to soloader 0.5.1. Fixes #20323.

pass all current ci.

none

 [GENERAL] [BUGFIX] [ANDROID] - Upgrade to soloader 0.5.1
Pull Request resolved: https://github.com/facebook/react-native/pull/20325

Differential Revision: D9060688

Pulled By: hramos

fbshipit-source-id: 614c0c1e3cd3981a0acb2effab7ddd4e4508cbcd
2018-07-31 01:32:30 -07:00
Dulmandakh 3ea803a814 bump mockito to 2.19.1 (#20317)
Summary:
This PR will bump mockito to 2.19.1, which has many enhancements over 1.x version. Read https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2. Also bumps jsr305 to 3.0.2.
Pull Request resolved: https://github.com/facebook/react-native/pull/20317

Differential Revision: D9071184

Pulled By: hramos

fbshipit-source-id: 109c8adde7dabdb25ddc329ff84ee40c9a0a5e3d
2018-07-30 15:31:38 -07:00
Dulmandakh 6117a6c720 Bump Android NDK to r17b (#20357)
Summary:
This PR bumps Android NDK version to r17b (latest). Cleaned up redundant **LOCAL_EXPORT_CPPFLAGS** rules in .mk files
Pull Request resolved: https://github.com/facebook/react-native/pull/20357

Differential Revision: D9068424

Pulled By: hramos

fbshipit-source-id: 8578637e38e807288b819a36cb75ea9feefcc09f
2018-07-30 14:02:11 -07:00
Daniel Cochran 1b09bd7fba make AsyncStorage serially execute requests (#18522)
Summary:
This patch is a bit of a hack job, but I'd argue it's necessary to dramatically improve the dev UX on Android devices. Somewhere in react-native, there's a shared SerialExecutor which AsyncStorage uses that is getting blocked, causing remote debugging to occasionally hang indefinitely for folks making AsyncStorage requests. This is frustrating from a dev UX perspective, and has persisted across several versions as far back as RN 0.44, and still remains on RN 0.54.

The issue seems to only happen on Android > 7+, which is likely because the ThreadPoolExecutor behavior changed in this version:
https://stackoverflow.com/questions/9654148/android-asynctask-threads-limits

Fixes #14101

We've been using this patch in production for the past 4 months on our team by overriding the AsyncStorage native module. We use AsyncStorage extensively for offline data and caching.

You can test by compiling this commit version into a test react native repository that is set to build from source:

```sh
git clone https://github.com/dannycochran/react-native rnAsyncStorage
cd rnAsyncStorage
git checkout asyncStorage
cd ..
git clone https://github.com/dannycochran/asyncStorageTest
yarn install
cp -r ../rnAsyncStorage node_modules/react-native
react-native run-android
```

No documentation change is required.

https://github.com/facebook/react-native/pull/16905

[Android] [BUGFIX] [AsyncStorage] - Fix AsyncStorage causing remote debugger to hang indefinitely.
Pull Request resolved: https://github.com/facebook/react-native/pull/18522

Differential Revision: D8624088

Pulled By: hramos

fbshipit-source-id: a1d2e3458d98467845cb34ac73f2aafaaa15ace2
2018-07-30 12:03:14 -07:00
David Aurelio 23657ccf5b Add `YogaNodeProperties` implementation with `ByteBuffer` based setters
Summary:
@public
Adds an implementation of `YogaNodeProperties` that sets style properties using a `ByteBuffer` rather than JNI calls.
We hope for a speed improvement.

Reviewed By: pasqualeanatriello

Differential Revision: D9042225

fbshipit-source-id: c7f2b24eaeddd1190755bec85a5034079bd2f492
2018-07-30 09:33:10 -07:00
David Aurelio 0c97e75dfe Add `YogaNodeProperties` implementation based on `ByteBuffer`
Summary:
@public
Adds an implementation of `YogaNodeProperties` that accesses style and layout properties using a `ByteBuffer` rather than JNI calls.
We hope for a speed improvement.

This needs further cleanup after experimenting, e.g. to codegen the offsets.

Reviewed By: pasqualeanatriello

Differential Revision: D8911723

fbshipit-source-id: 3c24b57eb545155878896ebb5d64d4553eb6bedc
2018-07-30 09:33:10 -07:00
David Aurelio 930bf1614c move property storage into sub-object
Summary:
Here we introduce an abstraction over node property storage, in order to experiment with different approaches for Java/C integration.

- interface `YogaNodeProperties` as abstraction
- current JNI code factored into `YogaNodePropertiesJNI.java`
- `YogaNode` delegates all calls, no API changes

Reviewed By: astreet

Differential Revision: D8769448

fbshipit-source-id: e67327ce41fa047a51a986c652b3d59992a510e2
2018-07-30 09:33:10 -07:00
Ram N c383138842 Use string class names for native modules
Summary: Using strings as keys for module names instead of actuall `.class` prevents additional class loading

Reviewed By: achen1

Differential Revision: D8955006

fbshipit-source-id: 12e6ad35fc35c969c05ca081976cc05b054f6821
2018-07-28 00:16:16 -07:00
Ram N c8e000b19a Prevent class loading for lazy native modules
Summary:
When native modules use `LazyReactPackage`, the modules themselves are not initialized. However, they still use the class names, causing the classes to load. This diff removes the need to perform any class loads. Any properties of the classes that are required are now populated in the `ReactModuleInfo` of that class.

Note that this diff itself does not prevent class loading since any references to `*.class` in `LazyReactpackage` needs to be removed in a consequent diff

Reviewed By: achen1

Differential Revision: D8950025

fbshipit-source-id: 80ddf7e1f33bf2af0db1bd262069795de77ec611
2018-07-27 23:47:28 -07:00
Ram N d891ee1dee Make ReactModuleInfoProvider use string keys
Summary: `ReactModuleInfoProvider` was using `Class` as the keys. This would make the classes to load. This change makes the map use canonicalName Strings of the classes, removing the need for the classes to load at this point.

Reviewed By: achen1

Differential Revision: D8944078

fbshipit-source-id: 4aa562d74d6ad3ebb9962b581d4e2f5e89d47ca6
2018-07-27 22:48:11 -07:00
Ziqi Chen 40f6998b67 added a null check on accessibilityStates
Summary:
Added a check for null on `accessibilityStates`.
Now, if a null value is passed in to the prop, it simply does not do anything.

Reviewed By: achen1

Differential Revision: D9034714

fbshipit-source-id: caffa41a1d8b08d5358d085e4e268e8e6f1c9344
2018-07-27 15:18:37 -07:00
Andrew Chen (Eng) 27b3aecb3d Fix RN Litho invalidations
Summary:
We were seeing a bug where embedded feed stories showed the loading spinner forever until a scroll event occurred. Embedded feed stories are built on top of our RN + Litho integration which requires additional logic to support remeasuring the shadow tree when the intrinsic size of the litho component changes (aka wrap_content). Previously, we simply overrode requestLayout() of ReactLithoView to inform the shadow tree that that node needs to be dirtied -- in which case a
subsequent layout pass would resolve these changes. This worked fine in dev builds, but it turns out that release builds never received a subsequent layout pass. Dev builds apparently have a loop that dispatches view updates every second or so while release doesn't (not sure why), but that was the reason why the dev version eventually invalidated the views. The solution here is to simply always invoke a view update when any embedded Litho component requires a relayout.

Reviewed By: mdvacca

Differential Revision: D8983995

fbshipit-source-id: 53c528b3c00aad2bbe8e7f6360dc8e1594da1298
2018-07-27 14:16:33 -07:00
Ram N 059fb2fd81 Make Catalyst support lazy and non-lazy native modules
Summary:
An application could either have lazy, or non-lazy modules. This diff simply lets the individual reactPackages decide if they should be lazy or not, based on the variable in `ReactInstanceManagerBuilder`.

This diff also removed the method `setLazyNativeModules()` since an app can now have both native and non-native modules.

Reviewed By: achen1

Differential Revision: D8940026

fbshipit-source-id: 0399f4f39ad57f2b03e4dce117a9e2c28c4ed2b1
2018-07-27 12:02:09 -07:00
Zhaojun Zhang 6b5343019c Remove clang compiler warnings for Android: -Wno-unused-parameter
Summary: att

Reviewed By: gkmhub

Differential Revision: D8972835

fbshipit-source-id: c8b893eefec6ccb5d8506c959bcf5c3f43701e81
2018-07-27 11:03:32 -07:00
Build Service fd30cf8308 translation auto-update for i18n/instagram-directapp.config.json on master
fbshipit-source-id: 6ea5ace7986919af565061e24f923efa1221ad17
2018-07-26 21:32:51 -07:00
Build Service a414a3b47d translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: 8ab20fd38a37a5ba7f183e1664356e469dca55ad
2018-07-26 21:32:50 -07:00
Build Service 2dc53b0285 translation auto-update for i18n/expresswifi.config.json on master
fbshipit-source-id: ac1a06371a5b0309df0cb0d2485e3a192c8852e1
2018-07-26 21:32:50 -07:00
Build Service f68f1adcfd translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: 05c5d8510fa4ba69bd31eb8ebf9fd00c62350958
2018-07-26 21:32:50 -07:00
Build Service df10d0c4a5 translation auto-update for i18n/analyticsapp.config.json on master
fbshipit-source-id: ae87f5a5b499b5c6990ad2e9e2e8ca634cc2f8ca
2018-07-26 21:32:50 -07:00
Build Service 876d82c77b translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 594329624d7db939ec5bde5c6e878dac9834fff6
2018-07-26 21:32:50 -07:00
Ziqi Chen 48b3d1322b Made strings in the uimanager resource folder non translatable
Summary:
In D8884991, I added a strings.xml file to react-native-github UI Manager resources.
Because this gets deployed to open source, and not all apps have the same Locale support that Facebook has, we temporarily don't want these strings to be translated.

I added `translatable = false` to the strings in this diff.

Reviewed By: fkgozali

Differential Revision: D9018766

fbshipit-source-id: 04d06478d0ac665fa02387e6df035c31522fdea6
2018-07-26 16:01:28 -07:00
Build Service 52a55fd8d1 translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: 3cedbf3b0adee97cc3c33c9c3de88ea4dcf94548
2018-07-26 06:07:09 -07:00
Build Service 4fe5acc570 translation auto-update for i18n/expresswifi.config.json on master
fbshipit-source-id: a22833a1a3eeab52e41e136fe16ed2f4a98d05cb
2018-07-26 06:07:08 -07:00
Build Service 00b4c7da09 translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: a6651b67b5e82543fa846bfddb4553a1202fbf2b
2018-07-26 06:07:07 -07:00
Build Service da5c202fdc translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 271e127b935afb22acdec01b5477ed6f30910ec0
2018-07-26 06:07:07 -07:00
Build Service 2472c8e392 translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: a0029007ee29dc6281d75aa2db5d93119b027709
2018-07-25 21:19:55 -07:00
Build Service 581d87c498 translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: f1b00452ca258faad0a8e26c1b8c6db8c7e99bee
2018-07-25 21:19:55 -07:00
Build Service 50b5be9e16 translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 46d36267672d931519a6ffca90a1953d643c63da
2018-07-25 21:19:55 -07:00
Build Service 12e15e4fdf translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 898dfa57c675ca4e1bbbb89046c124c4efcba576
2018-07-25 11:19:49 -07:00
Build Service c3d31cd1de translation auto-update for i18n/instagram-directapp.config.json on master
fbshipit-source-id: 8364dc804cfcc22e765c57ace66150a3123261a0
2018-07-25 02:02:42 -07:00
Build Service 16b169eb7a translation auto-update for i18n/fb4a.config.json on master
fbshipit-source-id: 0253d535046458f83e7df40d28cbf1d47a7b6c6d
2018-07-25 02:02:42 -07:00
Build Service afa58a2f44 translation auto-update for i18n/expresswifi.config.json on master
fbshipit-source-id: 2250f8f41db0be084e9fd136d033a13d65dda1b3
2018-07-25 02:02:42 -07:00
Build Service 924f49bcef translation auto-update for i18n/creatorapp.config.json on master
fbshipit-source-id: b588c750185c4b20b2cdacdc702285b1f2f06665
2018-07-25 02:02:42 -07:00
Build Service c8c2fece88 translation auto-update for i18n/analyticsapp.config.json on master
fbshipit-source-id: 46ce06cbe9e11893c7fdba4b5a33146acbda0818
2018-07-25 02:02:42 -07:00
Build Service 44734a28a1 translation auto-update for i18n/adsmanager.config.json on master
fbshipit-source-id: 2ca74c012a56fe460ae0ffab898949e7e98da334
2018-07-25 02:02:42 -07:00
Ziqi Chen 9f01e4ccff Added logic to only override role description that is said on TalkBack if it's in english.
Summary:
Context:
On Android, I am currently overriding the role description for TalkBack on certain Roles. Currently, these are done only in English.
I needed to add a checker that only overrides these role descriptions if the language of the phone is set

Changes:
* Added a language checker before I call setRoleDescription
* Put the strings into variables.

Note:
This is done to prioritize a codemod for accessibilityRole. Eventually, we hope to add support for other languages on these roles.

Reviewed By: blavalla

Differential Revision: D8884991

fbshipit-source-id: 3182eb5856ea57939fb25b17522d4b79ef2078e3
2018-07-24 16:47:31 -07:00
Simon Jensen 17485e8ed4 Fix conversion from double to int16_t in JSC bindings
Summary:
Converting from double to int16_t is undefined behavior if the value
doesn't fit in int16_t.

Reviewed By: tmikov

Differential Revision: D8925246

fbshipit-source-id: 4cf57631686a4ce05546f8d30a46e3f9def3aee2
2018-07-24 12:03:30 -07:00
Bhavik Patel 1a6666a116 Check if config contains a key before fetching. Default to 0 (#19808)
Summary:
Potential Fix to #19793

modified the code and tried to recreate the bug and was unable to. The red screen never popped up and nothing else seemed to be affected in a negative way.

[ANDROID] [BUGFIX] [FrameBasedAnimationDriver.java] - Safely unwrapping ReadableMap by defaulting to 0 if key not present.
Pull Request resolved: https://github.com/facebook/react-native/pull/19808

Differential Revision: D8960388

Pulled By: hramos

fbshipit-source-id: 400cc0467e041dfcf2d6b1ec0b61d716c2de159f
2018-07-23 17:02:51 -07:00
Dulmandakh ccdd450b12 bump NDK toolchain to 4.9 (#19945)
Summary:
This PR will bump NDK_TOOLCHAIN_VERSION to 4.9 or use GCC 4.9 to build C++ code. Once merged, we can bump folly to a newer version, which requires GCC 4.9.
Pull Request resolved: https://github.com/facebook/react-native/pull/19945

Reviewed By: fkgozali

Differential Revision: D8943282

Pulled By: hramos

fbshipit-source-id: d239ca67a08788b12e115a9d78443b13a10403f6
2018-07-23 13:47:30 -07:00
Ram N b938cd524a Removed dependency on ReactInstancePackage
Reviewed By: achen1

Differential Revision: D8926248

fbshipit-source-id: 8ab7f3f0cd7bdecc9b0d2cd560ed5da89075d3ba
2018-07-23 10:17:09 -07:00
Vishwesh Jainkuniya 84022321c4 textInput: Fix placeholder is not completely visible on Android. (#20337)
Summary:
On Android, placeholder of TextInput is not completely visible.
TextInput had some default fixed width. On iOS it is perfectly
visible.

This commit makes it consistent on both the platforms.

Before:
https://user-images.githubusercontent.com/39303760/43045649-54cb45e8-8dda-11e8-9935-059ad8ee9def.png

After:
https://user-images.githubusercontent.com/39303760/43045650-54fb9428-8dda-11e8-88b8-176839d6c0a7.png

Testing code:
a0a6fbb491/App.js

Clone code from a0a6fbb491/App.js and test on Android with and without this commit.

Before:
https://user-images.githubusercontent.com/39303760/43045649-54cb45e8-8dda-11e8-9935-059ad8ee9def.png

After:
https://user-images.githubusercontent.com/39303760/43045650-54fb9428-8dda-11e8-88b8-176839d6c0a7.png

 [ANDROID] [BUGFIX] [TextInput] - Fix placeholder is not completely visible on Android.
Pull Request resolved: https://github.com/facebook/react-native/pull/20337

Differential Revision: D8950051

Pulled By: mdvacca

fbshipit-source-id: a583a48c90ecd55d8dd8c6f4eef829608b2a6079
2018-07-22 23:16:29 -07:00
Jiaqi Wu 9c71952f20 Fix overflow issue in root view
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
2018-07-19 17:46:53 -07:00
Jiaqi Wu d5465a9a0a Fix ReactHorizontalScrollView overflow issue
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
2018-07-19 17:17:25 -07:00
Jiaqi Wu 86f24ccf71 Fix placeholder clipping issue
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
2018-07-19 17:17:24 -07:00
Jiaqi Wu de573277bf Fix Horizontal ScrollView's scroll position during layout changes
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
2018-07-19 17:02:38 -07:00
Ziqi Chen 3bedc78a35 Changed prop name "currentViewStates" to "accessibilityStates" in Android (2/3)
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
2018-07-19 14:13:00 -07:00
Mats Byrkeland be715ec705 Make AccessibilityInfo.setAccessibilityFocus cross platform (#20229)
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
2018-07-18 17:24:23 -07:00
Himabindu Gadupudi 7ff7572e5c Fix Android RN server snapshot tests
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
2018-07-18 17:03:04 -07:00
Ziqi Chen c1d0ccde0f added android functionality for currentViewStates
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
2018-07-17 16:06:21 -07:00
Ben Blackburne f5f27b3687 Revert D8786185: [fabric][android] Create CXX Binding
Differential Revision:
D8786185

Original commit changeset: d04208f07813

fbshipit-source-id: 1fc1648146ea9784bb364c4e56e8664bb8bb655f
2018-07-17 03:31:43 -07:00
Ben Blackburne bf22d904fe Revert D8794819: [fabric][android] Initialize FabricXX C++ code and register rootview
Differential Revision:
D8794819

Original commit changeset: b4d1d0958a3f

fbshipit-source-id: a984be9a31601644fb2d20a831f4e27075f24f7f
2018-07-17 03:31:42 -07:00
David Vacca 6c8b68183d Initialize FabricXX C++ code and register rootview
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
2018-07-17 01:46:45 -07:00
David Vacca e155e78451 Create CXX Binding
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
2018-07-17 01:46:45 -07:00
Robert Hönig a87b9db3dc Fix wrong time unit in dev server OKHttp client. (#19817)
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
2018-07-16 22:34:22 -07:00
Ziqi Chen 5741f77156 added image button role on android
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
2018-07-16 19:17:27 -07:00
Nurzhan Bakibayev ecd8802c1f Add @DoNotStrip to RemoteConnection methods
Summary: Add DoNotStrip to RemoteConnection methods

Reviewed By: alexeylang

Differential Revision: D8861729

fbshipit-source-id: d2b339f49dd25379dec6620d367786a9df02d28b
2018-07-16 12:47:16 -07:00
Andrew Chen (Eng) 123b3e1a8e Fix JSLocaleTest
Summary: becausereasons

Reviewed By: mdvacca

Differential Revision: D8838902

fbshipit-source-id: 0c6ca5ccde0439cacfa02771b2d99f26aa86f573
2018-07-16 11:17:50 -07:00
Taras Tsugrii 662c5bfd26 Skylarkify ReactNative build defs.
Summary: https://buckbuild.com/concept/skylark.html

Reviewed By: mzlee

Differential Revision: D8823004

fbshipit-source-id: 164be349782862bf83f5bdf2c869bf10713d5dfe
2018-07-14 17:31:19 -07:00
Ziqi Chen e739143809 added in the three roles: search, adjustable, link that require localization
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
2018-07-12 23:47:12 -07:00
Yuanda Tang 8ee60e9b0d Cleanup clang compiler warnings
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
2018-07-12 13:22:22 -07:00
Ziqi Chen f39d0923c7 removed tabbar for iOS 9 compatibility issues
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
2018-07-12 12:32:03 -07:00
Tim Yung d756d94b3a RN: Workaround for ReactNativeART on Android
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
2018-07-12 08:02:16 -07:00
David Aurelio b5f027dd77 Add `YogaNodeProperties` interface
Summary:
`YogaNodeProperties` will serve as abstraction over JNI adapters / storage backends in follow-ups.

@public

Reviewed By: IanChilds

Differential Revision: D8818805

fbshipit-source-id: 7998a56daebea60dd13b07228dffdf14be852554
2018-07-12 08:02:15 -07:00
Taras Tsugrii 78137bc31a Update deprecated glob usages.
Summary: https://our.intern.facebook.com/intern/wiki/Buck/python-to-skylark/

Reviewed By: davidaurelio

Differential Revision: D8795050

fbshipit-source-id: 1599a0a9ddd9af54a86884291945a93b91ba31bd
2018-07-11 11:02:41 -07:00
David Aurelio a08e8d07d0 Lint java files
Summary:
@public

Applies lint auto-fixes to java files.

Reviewed By: priteshrnandgaonkar

Differential Revision: D8803814

fbshipit-source-id: 2e4dc285b233091a9fbadf38fc22dd6e36f11f8e
2018-07-11 09:47:26 -07:00
David Aurelio 1535ecfa54 guards instead of nested if
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
2018-07-11 04:16:19 -07:00
David Aurelio 7abbd703d4 Lint / reformat `YGJNI.cpp`
Summary:
Run clangformat on `YGJNI.cpp`

@public

Reviewed By: priteshrnandgaonkar

Differential Revision: D8785660

fbshipit-source-id: 9748a5297e7b55e897de0280a79c2ea6ae1c1298
2018-07-11 04:16:19 -07:00
Ziqi Chen c27b495a89 added accessibilityRole Prop, added functionality support for role on android
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
2018-07-10 12:18:27 -07:00
Noam Schachter 1bb2bead8b Fixing Crush on SDK 15 (ICS) on ReactTextInputLocalData
Summary:
We had a crush reprot from Loadstone (manual tests) for RN standalone app on ICS, see:
https://our.intern.facebook.com/intern/tasks/view_inline_attachment/?attachment_id=2296063267087587&fbid=314266832445741

Seems like we are using TextView.getMinLines and TextView.getMaxLines - both added in SDK 16, witought a propert guard. see:
https://developer.android.com/reference/android/widget/TextView#getMinLines()
https://developer.android.com/reference/android/widget/TextView#getMaxLines()

Reviewed By: shergin

Differential Revision: D8763942

fbshipit-source-id: a56a6fc3e575b8ea97ddab983561df878b2f341c
2018-07-10 08:32:15 -07:00
Andrew Chen (Eng) de09fd53bd Remove setJSEntryPoint from ReactRootView
Summary:
Doesn't look like it was ever used according to diffgrep https://our.intern.facebook.com/intern/diffgrep/?author=&expand_all=false&filepath=&matcher=strmatch&query=setJSEntryPoint&repo=fbsource&rev_type=all&result_size=3&search_order=2&source&target=added%20or%20removed

axe is this okay?

Differential Revision: D8730783

fbshipit-source-id: 1e6b9e8fbd50c108a24b592793060a5344f1d0b1
2018-07-06 12:33:00 -07:00
Himabindu Gadupudi 816d302e98 Reverting image source null so the fix can go all once later
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
2018-07-06 12:33:00 -07:00
Yan Soares Couto ac09261a4c downloadBundleFromURL with an optional starting Request.Builder
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
2018-07-06 04:31:53 -07:00
Kevin Gozali fff43614aa android: disable `setClipChildren(false)` until RN ART issue is resolved
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
2018-07-05 14:02:45 -07:00
Tim Yung bbdc12eda7 RN: Add Overflow Visible Kill Switch (Android)
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
2018-07-03 00:34:17 -07:00
David Vacca 27a38dedf1 Enable View flatening optimization by default
Summary: This diff enables view flattening optimizations by default

Reviewed By: wwjholmes, yungsters

Differential Revision: D8699050

fbshipit-source-id: d37d06fe330e223c49a0788e85f6338fd056fd19
2018-07-02 10:04:41 -07:00
Tim Yung 6a16bec882 RN: Fix Drawing Rect for ReactScrollView
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
2018-07-01 16:32:07 -07:00
Sebastian Markbage 5d9326be29 Remove instanceHandle, pass event target instead + add dispatchToEmptyTarget
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
2018-06-29 15:32:27 -07:00
Tim Yung b81c8b51fc RN: Add Support for `overflow` on Android (Take 2)
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
2018-06-29 12:18:27 -07:00
Tim Yung cfce6ee9d7 RN: Android Constants for Overflow Style
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
2018-06-29 12:18:27 -07:00