Граф коммитов

3134 Коммитов

Автор SHA1 Сообщение Дата
David Vacca d451c03284 Remove createMountItem code
Summary:
Now that pre-allocation of views update props, we can just force the execution of "pre-allocation" instead of "create" mount item.

This diff removes the methods that were used by view creation

This way we reduce the amount of mountItems that are created during commit phase.
This should improve TTI (I'm running a MobileLab)

Reviewed By: shergin

Differential Revision: D14297477

fbshipit-source-id: a100bab798467e9f0fa9773e0206ba1ded472298
2019-03-03 15:51:32 -08:00
David Vacca 7720613bda Add systraces for pre-mountItems executed during commit
Summary:
Now that pre-allocation of views update props, we can just force the execution of "pre-allocation" instead of "create" mount item.

This diff adds systraces to the execution of pre-mountItems during commit

This should reduce the amount of mountItems that are created during commit phase.
This should improve TTI (I'm running a MobileLab)

Reviewed By: shergin

Differential Revision: D14297478

fbshipit-source-id: d8e515d34cf6edacce53c0903f74a08029259f6f
2019-03-03 15:51:32 -08:00
David Vacca 861e406097 Force execution of all pre-allocation of views before execution of mount items
Summary:
Now that pre-allocation of views update props, we can just force the execution of "pre-allocation" instead of "create" mount item.

This should reduce the amount of mountItems that are created during commit phase.
This should improve TTI (I'm running a MobileLab)

Reviewed By: shergin

Differential Revision: D14297476

fbshipit-source-id: 3ade662848ed836dc3221abe78611bb4a2b94e00
2019-03-03 15:51:32 -08:00
David Vacca ca6e1793ed Cleanup android log
Summary:
Cleaning up <android/log.h> from includes
We use LOG
```
LOG(INFO) << "message";
```
to log

Reviewed By: shergin

Differential Revision: D14297264

fbshipit-source-id: 1a9a760a092b6947cca7d7d59b66c574b3e41ad8
2019-03-03 15:51:32 -08:00
David Vacca 747d1f7029 Cleanup SchedulerDelegate interface
Summary: This diff removes the "isLayoutable" parameter from SchedulerDelegate.schedulerDidRequestPreliminaryViewAllocation. This now can be infered from the shadowView parameter

Reviewed By: shergin

Differential Revision: D14296481

fbshipit-source-id: b200504f9c2bef41f0a70257f1f5a274fbe97cbb
2019-03-03 15:51:32 -08:00
David Vacca 70447775f7 Update Props during pre-allocation avoiding re-updating the same props during mounting
Summary:
Update Props during pre-allocation avoiding re-updating the same props during mounting

MobileLab test showed an improvement of:
MARKETPLACE_YOU_TTI_SUCCESS: -3.34% = 58ms

Reviewed By: shergin

Differential Revision: D14252170

fbshipit-source-id: 1f4e9ad5dcecbc06651fa065135ffeed4892d984
2019-03-03 09:00:48 -08:00
David Vacca 95c414cfbf Introduce "updateProps" field InsertMutation
Summary: This diff introduces the concept of "updateProps" as part of InsertMutation and it changes the diffing algorithm to populate this field.

Reviewed By: shergin

Differential Revision: D14289608

fbshipit-source-id: 642f00d03d294a12ea7fa7482c72e701b756f3d4
2019-03-03 09:00:47 -08:00
David Vacca f6ba52bf1e Enable update of props during preallocation for all views
Summary:
Before only the props of Images components were being applied during the pre-allocation phase.
Now that we have a limit of time that pre-allocations will be executed we can update props for any component

Reviewed By: shergin

Differential Revision: D14252171

fbshipit-source-id: afea4b71a32b7ae2c184b0cdce97f778bc3a47d2
2019-03-03 09:00:47 -08:00
David Vacca ed8573f957 Implement limit to execute pre-mount operations
Summary: This diff implements a limit on the execution of pre-allocation of views, taking into consideration the time it is left on the frame, with a maximum of 8 ms / frame

Reviewed By: shergin

Differential Revision: D14252172

fbshipit-source-id: 1780a489122a8bc476d6ec7c92b45fdc58993e1d
2019-03-03 09:00:47 -08:00
David Vacca aa69e51096 Preallocate Image views
Summary:
This diff changes the pre-allocation of Images update the props on the ImageViews during the creation of ShadowNodes instead of during rendering.
The purpose of this change is to optimize TTI.

This was originally landed in D14214844 and then backed out in D14247897

Reviewed By: shergin

Differential Revision: D14286232

fbshipit-source-id: 8437f57f9473eb22ef98d80531b4020ee5fbb9ae
2019-03-03 09:00:47 -08:00
David Aurelio f41cb21c3d clean up config context
Summary: `YGConfigContext` was using `global_ref` instances for the config, leading to the config object never being freed. Since we no longer need it after getting rid of cloning, we can make the context a pointer to a `global_ref` to the logger.

Reviewed By: SidharthGuglani

Differential Revision: D14258571

fbshipit-source-id: cce632499839a680eef00a3854f61ab74ae2a87a
2019-03-01 05:45:05 -08:00
Luna Wei bc06d1cc9c Use a surface switch
Summary: Flesh out how surface will be used with a flag in ReactRootView

Reviewed By: mdvacca

Differential Revision: D14112897

fbshipit-source-id: adf6078048dbf83452d3523f0530a4d6dca7b3e8
2019-02-28 17:30:13 -08:00
Sidharth Guglani 87a6ebda2a Setting flags for margin, padding, position and border
Summary:
We set flags to true when setting margin, padding, border, position individually
Doing the same for batching API

Reviewed By: davidaurelio

Differential Revision: D14207550

fbshipit-source-id: ddfdcd5056bea0dd76bd6762f47e90370e26c9e1
2019-02-28 12:55:39 -08:00
Sidharth Guglani 754011c144 Added getters for flexWrap and flex style inputs in java bindings
Summary: Added getters fro flexWrap an flex style input properties in java bindings

Reviewed By: davidaurelio

Differential Revision: D14207517

fbshipit-source-id: e8d2ad17b5edbdf02e69011c6d95a4de076bd366
2019-02-28 12:55:39 -08:00
Sidharth Guglani 30dd48e0f6 JNI batching API using float array
Summary:
Added a new API `YGNodeSetLayoutStyleInputs` to pass layout style inputs from java to native code.
All the style inputs are passed in a float array in [key1, key2, value2, key3, value3a, value3b .....] format over JNI layer.
There are three types of style inputs
- do not need any value to be passed along with them like WidthAuto, HeightAuto
- need one value to be passed like Width, Height
- need two values to be passed like Margin, Padding (edge value and actual margin, padding value)

Reviewed By: davidaurelio

Differential Revision: D14166948

fbshipit-source-id: 4bea64d6a429959c3962c87e337914dcd99199fd
2019-02-28 12:55:39 -08:00
Sidharth Guglani 6c7649503a added mEdgeSetFlags inside YogaNodeContext and using it YGJNI in getters/setters of margin, padding, border
Summary:
We have now create a yoga node context which consists of weak reference to java yoga node object and flag which tells us whether margin, padding , border are set or not.

This flag was initially in java layer and we have moved this to native layer as it will help us with enabling the bacthing API for setting style inputs.

Reviewed By: davidaurelio

Differential Revision: D14243378

fbshipit-source-id: fed935ef18c1abf2b07e5d69d9ca79ced51699f2
2019-02-28 12:55:39 -08:00
Sidharth Guglani 5a9d944e57 not setting flags when setting margin, padding, border and position on yoga node
Summary: We are now not setting flags when we set style inputs margin, padding, border and position on yoga node.

Reviewed By: davidaurelio

Differential Revision: D14224000

fbshipit-source-id: deef4c1ab1a60fbc4909183bc2aa59fa23939d43
2019-02-28 12:55:39 -08:00
Peter Argany f2d20d2904 Set Platform.isTesting true when running Server Snapshot Tests
Summary:
`Platform.isTesting` returns false when running SSTs. This diff changes that to true.

See https://our.intern.facebook.com/intern/qa/9690/how-to-detect-when-running-as-sst for inspiration.

I fixed this for iOS in D13981728.

Reviewed By: cpojer

Differential Revision: D14244606

fbshipit-source-id: ed95b772cc4206cf7c835aed7415aa5fc5fbdf7d
2019-02-28 12:50:30 -08:00
Yedidya Feldblum fc91bccd53 Add assorted missing includes in xplat
Summary: Add assorted missing includes in `xplat` that would be exposed by future changes.

Reviewed By: ispeters, nlutsenko

Differential Revision: D14213660

fbshipit-source-id: 329f133784015fe20ee99feaec8ef05e117fe3a6
2019-02-28 00:52:48 -08:00
David Vacca b3790d283f Back out "[Fabric][C++][Android] update props during pre allocation of views"
Summary:
This is a back-out of D14214844, we noticed that this regressed TTI for Marketplace You screen running in Fabric

Original commit changeset: b81005f2bf49

Reviewed By: JoshuaGross

Differential Revision: D14247897

fbshipit-source-id: de0cea92b437b2fbcd075f0d6a0066156800e3f0
2019-02-28 00:04:09 -08:00
Vishwesh Jainkuniya 60c0a60c50 Fix: mostRecentEventCount is not updated. (#17990)
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.

Help us understand your motivation by explaining why you decided to make this change.

You can learn more about contributing to React Native here: http://facebook.github.io/react-native/docs/contributing.html

Happy contributing!

-->

Update it's value as it changes on the JS thread, so that updated value is used (f7f5dc6649/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java (L243)) whenever setSelection(int start, int end) is called (f7f5dc6649/ReactAndroid/src/main/java/com/facebook/react/views/textinput/ReactEditText.java (L315)).
Pull Request resolved: https://github.com/facebook/react-native/pull/17990

Differential Revision: D14255969

Pulled By: mdvacca

fbshipit-source-id: 555d6752eabca5c31c1762955a56f99cc1828546
2019-02-27 22:18:55 -08:00
David Aurelio 537ed61d94 Breaking remove `YogaNode#clone`
Summary:
@public

The cloning features of YogaNode don’t seem to be used. Let’s remove them.

Reviewed By: SidharthGuglani

Differential Revision: D14165624

fbshipit-source-id: 5b710964a4abf1b35f3bcc25b143ffc719a03cec
2019-02-27 05:03:12 -08:00
Joshua Gross 3c1114eea7 Enable Slider component
Summary:
Enable Slider component in Fabric on Android.

{F151706188}

Reviewed By: mdvacca

Differential Revision: D14220147

fbshipit-source-id: 10b29112e950c8de98cba995839780c4f4e8d3b6
2019-02-26 14:40:58 -08:00
Valentin Shergin 9a64755a18 Fabric: `events` module was merged into `core` module
Summary: That's bummer that we have to do it, but it's actually reasonable. Files in `core` and `events` depend on each other creating circular dependencies and other similar hard problem.

Reviewed By: mdvacca

Differential Revision: D14195022

fbshipit-source-id: 96a44ae28631cc9ccd7d7de72a94526f9e0dd12a
2019-02-25 19:12:08 -08:00
Luna Wei 4cf70306b9 Use cached react tag versus id on view
Summary: Due to the way (initial) surface implementation plays with ReactRootView (RRV), the react tag from the UIManagerModule is now set on the surface container view rather than on RRV as it was historically done. RRV still caches the react tag but just doesn't use it as an id on the view so `RRV.getViewId()` no longer equals `RRV.getReactTag()`.

Reviewed By: mdvacca

Differential Revision: D14110104

fbshipit-source-id: 6dbcc41c85fd7a6c32c7250f68f4a84bed4e075a
2019-02-25 17:25:42 -08:00
David Vacca 19765c9b8c update props during pre allocation of views
Summary:
This diff changes the pre-allocation of Images update the props on the ImageViews during the creation of ShadowNodes instead of during rendering.

The purpose of this change is to optimize TTI.

Reviewed By: shergin

Differential Revision: D14214844

fbshipit-source-id: b81005f2bf494f62f421dc24846e1561e13b9a87
2019-02-25 17:21:24 -08:00
David Vacca 4859b1a126 Remove unused variables
Summary: Trivial diff to remove unused variables

Reviewed By: fkgozali

Differential Revision: D14214843

fbshipit-source-id: ace624bafce12c9ee6ce02051d684e581e78fe2c
2019-02-25 17:21:24 -08:00
Sergei Dryganets 972f39985a This change fixes currently broken ReactContext listeners mechanism. (#22318)
Summary:
This mechanism is heavily abused inside of the react-native and inside of the various native modules.
The main problem is that people don't remove their listeners and as result, we have memory leaks.

Some modules like UIManager, NativeAnimatedModule have resources holding Activity context. Those modules are held through a pretty long chain of dependencies.

In order to allow GC to collect those listeners, I replaced the CopyOnWriteSet by WeakHashMap and synchronized access. It is not such a big deal in terms of performance as those listeners are not called/modified too frequently but this prevents hard to debug memory leaks.

Changelog:
----------
Help reviewers and the release process by writing your own changelog entry. When the change doesn't impact React Native developers, it may be ommitted from the changelog for brevity. See below for an example.

[Android] [Fixed] - ReactContext - lifecycle listeners don't cause the leaks even if not removed.

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

Reviewed By: mdvacca

Differential Revision: D13106915

Pulled By: hramos

fbshipit-source-id: d506e5035a7f7bea1b57a6308fb5d9b5fcb277a7
2019-02-25 08:06:22 -08:00
yukai1 b2d3052de7 ModalHostView's child view can not fill screen (#18615)
Summary:
Signed-off-by: yukai <yk3372@gmail.com>

In some Android device such as Samsung S8, the ModalHostView's child view can't fill the screen.
before:
![before](https://user-images.githubusercontent.com/1514899/38024961-3e756f8e-32b9-11e8-9555-50a7cf778288.jpeg)
The JS ModalHostView can't fill the bottom, the area is device's navigation bar.

In class ModalHostShadowNode, follow code calculate is error:
`Point modalSize = ModalHostHelper.getModalHostSize(getThemedContext());`
This way not care the device's navigation bar, so the height is smaller than real.
For Samsung S8, real height is 2220 and modalSize.y is 2076.
Pull Request resolved: https://github.com/facebook/react-native/pull/18615

Differential Revision: D14206830

Pulled By: cpojer

fbshipit-source-id: abe35ce1ab253aa1472d2c798543b515218be445
2019-02-25 01:18:42 -08:00
August Lilleaas a8449c14ac Allow ReactActivityDelegate subclass to overrride mainComponentName (#19814)
Summary:
Currently, the final field mMainComponentName is used. This field is
initialized in the constructor of ReactActivityDelegate, and the
ReactActivityDelegate itself is initialized in the constructor of
ReactActivity. This means that the only way you can pass a main
component name to ReactActivityDelegate, is when your ReactActivity
subclass is constructed. At this point in the lifecycle of an
activity, the getIntent() value that the activity was initialized by
returns null, making it impossible to set the mainComponentName
dynamically based on data passed to the activity via an intent.

The mMainComponentName final field is also only used in onCreate of
the delegate, so it's not actually needed by the ReactActivityDelegate
at construction time. So the above limitation is not fundamental, it's
just a side effect of the API design.

By allowing subclasses of ReactActivityDelegate to implement a
getMainComponentName method, the subclass then has full control of how
to initialize the value. So an implementation of getMainComponentName
could be:

    public String getMainComponentName() {
        return getIntent().getStringExtra("reactMainComponentName");
    }

This commit doesn't remove anything and only adds a new method, so it
should be fully backwards compatible.

Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/19814

Differential Revision: D14206644

Pulled By: cpojer

fbshipit-source-id: 8532560f944362fe0cce263a7f9a503df8ae539f
2019-02-25 00:40:11 -08:00
Wei Yang b9d3743cda add talkback navigation support for links and header (#22447)
Summary:
1. add role description for heading
2. add talkback navigation support for link and header

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

Differential Revision: D14205822

Pulled By: cpojer

fbshipit-source-id: 86bfc3bfc851f3544b1962012abaf8d1a357a9d2
2019-02-24 19:25:51 -08:00
David Vacca 2e42cc7652 optimize calls to updateRootLayoutSpecs
Summary: This diff changes the onMeasure method of the RootView to optimize the amount of times we call updateRootLayoutSpecs in Fabric

Reviewed By: shergin

Differential Revision: D14198155

fbshipit-source-id: ff2deee04540899c25d4e38b0bd93333f74c6ace
2019-02-24 11:58:47 -08:00
David Vacca daccb54353 Add new performance metric in Fabric
Summary: This diff adds a new metric in Fabric to measure time it takes to Fabric finish transaction in CPP

Reviewed By: shergin

Differential Revision: D14198153

fbshipit-source-id: 987d1db1ae669906192060cc9b9e077901da6787
2019-02-24 11:58:47 -08:00
David Vacca 10679a97c3 Temporarily remove optimization of updateRootLayoutSpecs
Summary: revert D14142305

Reviewed By: shergin

Differential Revision: D14198154

fbshipit-source-id: 2f2b2b6e0c0d64b71dc720b3d934c348600e0367
2019-02-24 11:58:47 -08:00
Dulmandakh 0b4f74176c add nullable annotations to some ViewManager methods (#23610)
Summary:
Add nullable annotations to BaseViewManager and ViewManager methods. This will improve Kotlin developer experience and help Android Studio to offer better autocomplete.

[Android] [Changed] - add nullable annotations to BaseViewManager and ViewManager methods. Might break ViewManagers in Kotlin.
Pull Request resolved: https://github.com/facebook/react-native/pull/23610

Differential Revision: D14198630

Pulled By: mdvacca

fbshipit-source-id: c596c88254e1d02f0af233a466f685200fac8917
2019-02-23 10:07:31 -08:00
Nate Hunzaker 0d5aebbd9a Use existing character set in POST body when possible (#23603)
Summary:
This commit fixes a bug introduced in a previous attempt (https://github.com/facebook/react-native/pull/23580) to address an issue where okhttp appended `charset=utf-8` to the Content-Type header when otherwise not specified.

In that commit, I converted all characters to UTF-8, however it should instead use an existing encoding when possible.

Related issues:
https://github.com/facebook/react-native/issues/8237#issuecomment-466304854

[Android][fixed] - Respect existing character set when specified in fetch() POST request
Pull Request resolved: https://github.com/facebook/react-native/pull/23603

Differential Revision: D14191750

Pulled By: hramos

fbshipit-source-id: 11c1bfd98ccd33cd8e54ea426285b7d2ce9c2d7c
2019-02-22 16:20:49 -08:00
Chris Sarbora c1349b5960 Rename makeCriticalNativeMethod to discourage over-use
Summary: "Critical" or "Fast" JNI methods are enticing by their name, but carry dangers that are not trivially visible.

Reviewed By: davidaurelio

Differential Revision: D14184560

fbshipit-source-id: 89ec70f53bb2cb89ff568d8b1fe222ede86c9824
2019-02-22 14:29:45 -08:00
David Vacca 8928358108 optimize updateRootLayoutSpecs to not call setContraints if they did not change
Summary: This diff avoids calling mBinding.setConstraints when the measurespecs haven't changed

Reviewed By: shergin

Differential Revision: D14142305

fbshipit-source-id: 6770c97dcf0fb23c605a90fb6c3311d2fb771d11
2019-02-22 13:51:30 -08:00
David Vacca 1aa279d78b Force updateRootLayoutSpecs to run synchronously
Summary: This diff makes updateRootLayoutSpecs to run synchronously on any thread instead of schedulling this to run in the JS thread

Reviewed By: shergin

Differential Revision: D14142306

fbshipit-source-id: 746f9c51f13e6d987fd9bca35a7c502cc8622f7b
2019-02-22 13:51:30 -08:00
David Vacca eae89d829f Add logging for BatchMountItem
Summary: trivial diff to add logging in BatchMountItem

Reviewed By: JoshuaGross

Differential Revision: D14142307

fbshipit-source-id: 39ca5dd00a0beed9e6a7baf5434d82f9d26381c4
2019-02-22 13:51:29 -08:00
David Vacca cda8171af3 Fix IllegalArgumentException when creating CookieManager
Summary:
This prevents this https://bugs.chromium.org/p/chromium/issues/detail?id=559720 to crash the app.
When using this fix the webView will not function correctly

More details about the bug https://bugs.chromium.org/p/chromium/issues/detail?id=559720

Reviewed By: fkgozali

Differential Revision: D14181851

fbshipit-source-id: 5a8c149df82a7373fe8b5b32006f034868532485
2019-02-22 11:27:16 -08:00
David Aurelio c3522a017d Don't call `jni_YGNodeFree` as fast native method
Summary:
@public

If `jni_YGNodeFree` is called while GC is running, the weak reference table lock is held by the GC, leading to deadlock.

Here, we revert the method to being a regular native method, solving that problem.

Reviewed By: SidharthGuglani

Differential Revision: D14184220

fbshipit-source-id: 2882fa10586617cea2df99550a7dd8885376d11e
2019-02-22 09:00:39 -08:00
Nate Hunzaker 4a807761a4 Prevent okhttp from adding ;charset=utf8 to ContentType Header (#23580)
Summary:
Before this commit, `fetch()` calls append `"charset=utf8"` to the `Content-Type` header on Android (and not on iOS). This is because of an implementation detail in the okhttp library. This means that you can make a call on the JavaScript side like:

```javascript
let body = JSON.stringify({ key: "value" });

let headers = {
  "Content-Type": "application/json"
};

fetch("http://10.0.2.2:3000", { method: "POST", body, headers });
```

However the resulting request appends the utf8 character:

```
POST - 13:34:32:
  content-type: application/json; charset=utf-8
  content-length: 15
  host: 10.0.2.2:3000
  connection: Keep-Alive
  accept-encoding: gzip
  user-agent: okhttp/3.12.1
```

Passing byte array into the RequestBody avoids this, as recommended by a maintainer of okhttp:

https://github.com/square/okhttp/issues/2099#issuecomment-366757161

Related issues:
https://github.com/facebook/react-native/issues/8237

[Android][fixed] - Prevent fetch() POST requests on Android from appending `charset=utf-8` to `Content-Type` header.
Pull Request resolved: https://github.com/facebook/react-native/pull/23580

Differential Revision: D14180849

Pulled By: cpojer

fbshipit-source-id: b84cadf83361331a9f64d1ff5f2e6399a55527a6
2019-02-21 22:36:06 -08:00
Vojtech Novak 976f4be457 support checkbox tinting (#18300)
Summary:
RN offers checkbox component on android: https://facebook.github.io/react-native/docs/checkbox.html

The Checkbox colors for checked and unchecked states cannot be controlled from JS at the moment; this PR adds support for that.

The essence of changing colors for the states is this:

```
ColorStateList cls = new ColorStateList(
        new int[][] {
                new int[] { -android.R.attr.state_checked }, // unchecked
                new int[] {  android.R.attr.state_checked }  // checked
        },
        new int[] {
                uncheckedColor,
                checkedColor
        }
);
checkBox.setSupportButtonTintList(cls);
```

Because of this, I did it so that both colors have to provided together in an object. This is similar to [switch](https://facebook.github.io/react-native/docs/switch#trackcolor)
Pull Request resolved: https://github.com/facebook/react-native/pull/18300

Differential Revision: D14180218

Pulled By: cpojer

fbshipit-source-id: 88a9d1faf061c0651e3e28950f697535b90fbfd4
2019-02-21 20:16:14 -08:00
Luna Wei e758435167 Refactor the way UIManagerModule uses measure specs
Summary:
Instead of using measure specs to set certain yoga properties on the root node (like max width, auto width, specific width), use yoga's calculateLayout(width, height) instead. The measure specs will be stored in the shadow node. This allows us to remove duplicated code that processes the measure specs and allows us to remove other logic like the enableLayoutCalculation() method.

This diff also removes MeasureSpecProvider. MeasureSpecProvider was originally introduced to pass previously measured view measure specs to the initial creation of the root shadow node, but it turns out that this is unnecessary. We can update the root layout specs from the root view instead.

Reviewed By: mdvacca

Differential Revision: D9729744

fbshipit-source-id: 79b0b27ca879758f5dc3fc7cc8a0d38856a6cc79
2019-02-21 20:04:23 -08:00
mannol b47191608b Fix issue with composing text not being cleared on some Android devices (#18859)
Summary:
Clearing the android TextInput text programmatically (i.e. calling: this.textInputRef.clear()) does not clear the previously composing text, if enabled, causing inconveniences when such behaviour is desired (i.e. chat input box, where you constantly have to clear the input after sending a message). Instead, the currently observed behaviour is that, after a new text is entered (usually as soon as the first letter), the previously composing text reappears making the input unusable.

The effect is only observable on some devices, for example, we observed it on Samsung S6 devices using both Android 6 and 7, and several LG devices running Android 6.

This issue is only present when clearing the text; setting text to some other value does not produce the same effect.

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/18859

Differential Revision: D14067144

Pulled By: hramos

fbshipit-source-id: 09f337edc026b83221f8a399749222cd75457ec7
2019-02-21 17:42:56 -08:00
Joshua Gross c933755c6a Remove unused import, followup to D14114388
Summary: Remove an unused import.

Reviewed By: mdvacca

Differential Revision: D14161154

fbshipit-source-id: f1156020e6e8e90fb9ea86b313decd524c883e2a
2019-02-21 17:27:53 -08:00
David Aurelio 25566ef28b `setBaseLine` -> `setBaseline`
Summary:
@public

`setBaseLine` was the only place where we used a capitalised *L.* Fixed here.

Reviewed By: SidharthGuglani

Differential Revision: D14152320

fbshipit-source-id: abf54fe7d6088e03775968baa8421c4bf43d6a6e
2019-02-21 05:38:51 -08:00
David Aurelio dc7dce130b Allow to use JNI without global refs
Summary:
@public

Adds the ability to opt into avoiding global weak JNI refs via `YogaConfig`.

Note that only homogeneous trees are supported, i.e. **mixing weak-ref and non-weak-ref nodes will break!**

Not using JNI refs hopefully will help with avoiding JNI reference table overflows, and will help creating trees on multiple threads, as no lock has to be acquired at any time.

Reviewed By: SidharthGuglani

Differential Revision: D14151037

fbshipit-source-id: 56d94713d39aee080d54be4cb4cdf5e3eccb473a
2019-02-21 05:38:51 -08:00
Mike Lambert f32dc63546 Fix two bugs with Location when not using ACCESS_FINE_LOCATION (#10291)
Summary:
Fix two bugs with Location when not using ACCESS_FINE_LOCATION:
- If we request highAccuracy=false, because we don't have ACCESS_FINE_LOCATION, but we don't have access to the NETWORK_PROVIDER...then the code should not trigger a SecurityException because it fell-back to using GPS_PROVIDER (which we don't have permission for)
- If the device is pre-lollipop, and doesn't have a provider, we should detect this properly instead of letting the pre-lollipop code raise a SecurityException.

Unfortunately, SecurityExceptions cannot be caught by the calling JS code. But I am not fixing that one here, instead choosing to fix/obviate the SecurityExceptions altogether.
Pull Request resolved: https://github.com/facebook/react-native/pull/10291

Differential Revision: D4163659

Pulled By: cpojer

fbshipit-source-id: 18bb4ee7401bc4eac4fcc97341fc2b3a2a0957c9
2019-02-21 02:25:18 -08:00