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

358 Коммитов

Автор SHA1 Сообщение Дата
Victor Calvello 55994f5900 Replace global.alert use to fix eslint warnings (#22184)
Summary:
Replaces `alert` with `Alert.alert` to fix eslint warnings.
Pull Request resolved: https://github.com/facebook/react-native/pull/22184

Reviewed By: TheSavior

Differential Revision: D13105636

Pulled By: RSNara

fbshipit-source-id: 82a9e55fd002051e3cf8238e29d37b2b33f66f0e
2018-11-19 18:10:33 -08:00
Tim Yung d9c2cdae41 JS: Switch from `new Buffer` to `Buffer.from`
Summary:
Constructing `Buffer` using the constructor [[https://nodesource.com/blog/understanding-the-buffer-deprecation-in-node-js-10/ | has been deprecated in Node 10 due to security considerations]].

This is a simple and straightforward conversion.

Reviewed By: mjesun

Differential Revision: D13080655

fbshipit-source-id: 100d8f28c3b255422b26e820aaadcc4f32f41e0d
2018-11-15 12:13:05 -08:00
Ignacio Olaciregui 7b3c91ef16 Fix inline styles eslint warnings for examples (#22123)
Summary:
Fixes `react-native/no-inline-styles` warning for several examples. I'm limiting the size of this PR to make it simpler to review.
Pull Request resolved: https://github.com/facebook/react-native/pull/22123

Reviewed By: RSNara

Differential Revision: D12929701

Pulled By: TheSavior

fbshipit-source-id: 7a976f2208b557fcfda46d5b586b30652c550eb2
2018-11-08 17:20:33 -08:00
Victor Calvello ffd7195543 Remove unused styles (#22083)
Summary:
Removes unused styles.

NOTE: Lint rule `react-native/no-unused-styles` not added because of custom lint rule internally at Facebook that does this.
Pull Request resolved: https://github.com/facebook/react-native/pull/22083

Differential Revision: D12929443

Pulled By: TheSavior

fbshipit-source-id: d42b0be3db745e445447e65df3b78b61f53e4229
2018-11-05 13:57:47 -08:00
Thomas BARRAS 81e5d64bfe Remove createReactClass from ProgressBarAndroidExample (#21874)
Summary:
Related to #21581

This PR was already opened here https://github.com/facebook/react-native/pull/21600 but seems to be inactive.

Remove createReactClass from ProgressBarAndroidExample.

- `yarn run flow` && `yarn run flow-check-android` succeed.
- RNTester app ProgressBarAndroidExample on Android.

[GENERAL] [ENHANCEMENT] [ProgressBarAndroidExample.android.js] - rm createReactClass
Pull Request resolved: https://github.com/facebook/react-native/pull/21874

Reviewed By: TheSavior

Differential Revision: D12827689

Pulled By: RSNara

fbshipit-source-id: 46c70ea67dddf5d928fe936a28ef4a0a929d127f
2018-11-02 12:14:29 -07:00
Sam Goldman adc8a33fcf Deploy Flow v0.85 to xplat/js
Reviewed By: fishythefish

Differential Revision: D12898653

fbshipit-source-id: 2ed11ce569600fe4c12528939a350dd827c9a29a
2018-11-02 00:28:28 -07:00
Ignacio Olaciregui ae8ec39397 Fix linting issues (#22062)
Summary:
Fixes lots of ESLint warnings. Many of them where in PR #20877 by janicduplessis which requested to split the linting fixes from configuration and package changes.

I solved only the issues that I was most certain about but I would love to get hands on all of them with a little bit of input.
Pull Request resolved: https://github.com/facebook/react-native/pull/22062

Differential Revision: D12889447

Pulled By: TheSavior

fbshipit-source-id: 35f7a08104a5b859c860afdde4af2b32c0685c50
2018-11-01 14:29:16 -07:00
Tim Yung a689711f68 RN: Missing Copyright Headers
Summary: Adds copyright headers to all files that are missing them.

Reviewed By: hramos

Differential Revision: D12837494

fbshipit-source-id: 6330a18919676dec9ff2c03b7c9329ed9127d930
2018-10-31 01:37:26 -07:00
nd-02110114 811a99caab Remove var in RNTester (#22013)
Summary:
I removed `var` in RNTester.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22013

Differential Revision: D12849927

Pulled By: TheSavior

fbshipit-source-id: 4a2fd11939bd8ae8604ef59512f532adc0a09eda
2018-10-30 16:33:21 -07:00
nd-02110114 5af577439b Remove var in RNTester (#22014)
Summary:
I removed `var` in RNTester.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22014

Differential Revision: D12843150

Pulled By: TheSavior

fbshipit-source-id: 593adf141164cffe0ddc2db756721df26e38b4f5
2018-10-30 14:39:33 -07:00
nd-02110114 791fa2d83a Remove var in RNTester (#22016)
Summary:
I removed `var` in RNTester.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22016

Differential Revision: D12843122

Pulled By: TheSavior

fbshipit-source-id: 7e207366c457f0bda707773e9de02fe5afdbb144
2018-10-30 14:37:03 -07:00
nd-02110114 6b29b908dd Remove var in RNTester (#22018)
Summary:
I removed `var` in RNTester.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22018

Differential Revision: D12843078

Pulled By: TheSavior

fbshipit-source-id: a3928436b2c73ead931e7c957fab8ad74975ef73
2018-10-30 14:29:30 -07:00
nd-02110114 2648f47a4e Remove var in RNTester (#22015)
Summary:
I removed `var` in RNTester.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22015

Differential Revision: D12843132

Pulled By: TheSavior

fbshipit-source-id: ef835b25bc078fc870127946d013e01e34672b1b
2018-10-30 14:26:59 -07:00
nd-02110114 a21b8b7360 Remove var in RNTester (#22019)
Summary:
I removed `var` in RNTester.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22019

Differential Revision: D12843071

Pulled By: TheSavior

fbshipit-source-id: 3652ea91b3ab92c367332cbe2ff7de0343508dad
2018-10-30 14:05:56 -07:00
nd-02110114 7a9d86019f Remove var in RNTester (#22017)
Summary:
I removed `var` in RNTester.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester] - remove `var`
Pull Request resolved: https://github.com/facebook/react-native/pull/22017

Differential Revision: D12843109

Pulled By: TheSavior

fbshipit-source-id: 936ed5efdcff2e7b85e90ed90c589eb98c60c411
2018-10-30 12:57:29 -07:00
Kudo Chien a70625abd7 Upgrade folly to v2018.10.22.00 for iOS (#21976)
Summary:
Fixes #20302 (For iOS)

Note:
------

1. Checked the changes did not break CocoaPods integration.
2. The change for glog copying header into exported/ is to prevent build break for folly.
    `folly/detail/Demangle.h` will try to use libstdc++'s demangle.h. Unfortunately, glog also has a demangle.h in source code. So I copy exported headers and only search headers in exported/ folder during build.
Pull Request resolved: https://github.com/facebook/react-native/pull/21976

Reviewed By: hramos

Differential Revision: D12818131

Pulled By: fkgozali

fbshipit-source-id: b3c637d09d1b3adde0ea15c82eb56e28f846885b
2018-10-29 12:13:11 -07:00
Matt Hargett 174644846d Add deprecation warnings for a few IOS components
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/21901

Differential Revision: D10502816

Pulled By: TheSavior

fbshipit-source-id: 1890aa35251cff0ac2c15760ecd5aabeb7652558
2018-10-22 23:17:13 -07:00
Ramanpreet Nara 4d917c8207 Additional Flow changes to files that use this component
Summary:
This diff includes:
1. Touchups to the `CameraRollView` typings.
2. Typings for `CameraRollViewExmaple`.
3. Flow fixes for internal callsites.

Reviewed By: yungsters

Differential Revision: D10362686

fbshipit-source-id: 48bf3fba0566e9c5c062aee3342d669f6c143d9f
2018-10-18 12:28:28 -07:00
Ramanpreet Nara 8465094523 Remove createReactClass from CameraRollView
Summary:
Related to #21581

Remove createReactClass from CameraRollView.

Reviewed By: TheSavior

Differential Revision: D10351036

fbshipit-source-id: 394545ac143917e3b483dfc6186e5f45732c602a
2018-10-18 12:28:28 -07:00
Ramanpreet Nara 09d35de50d Fix flow types in file
Summary:
This diff just builds on top of the open source PR:
1. I add a bunch of extra flow typings to the file.
2. I refactor some of the JavaScript code.

Reviewed By: TheSavior

Differential Revision: D10351693

fbshipit-source-id: a6d828518150c11d66a179c5c3fe835cc80a8dfb
2018-10-18 11:45:45 -07:00
Marc Horowitz 8427f64e06 Remove unused code using JSC
Reviewed By: fkgozali

Differential Revision: D10441260

fbshipit-source-id: 5a77ec382e28be046824bd598186e6c29a1510f2
2018-10-18 01:06:25 -07:00
Marc Horowitz 78fcf7c559 Get RNTester xcodeproj to compile
Summary:
Marc deleted a few files from react-native-github, so I removed them from the RNTester XCode project. I also included the files he created, and created new targets: `jsiexecutor-tvOS`, `jsiexecutor`, `jsi`, `jsi-tvOS`.

**Note:** The tvOS build of RNTester is broken in this diff because of a few `WKWebView` changes I landed earlier. D9844322 includes the fix.

Reviewed By: axe-fb

Differential Revision: D9875409

fbshipit-source-id: 31a9f241a524de91e78dfff0555aec5d1373d789
2018-10-18 01:06:24 -07:00
Marc Horowitz f85692cf8f Get RN Podspec xcodeproject to compile
Summary:
This diff includes a few changes to the `React.podspec` file:
1. Introduce a `jsi` spec for code inside the `ReactCommon/jsi` folder. This depends on the JavaScriptCore framework.
2. Introduce a `jsiexecutor` spec for the code inside the `ReactCommon/jsiexecutor` folder. These files depend on files in `ReactCommon/cxxreact`, `ReactCommon/jsi`, and Folly.
3. Since RCTCxxBridge.mm now depends on `JSIExecutor`, we need to have the `CxxBridge` spec depend on the `jsiexecutor` spec.

Reviewed By: hramos

Differential Revision: D9820323

fbshipit-source-id: 0c96d027eed30ee47b6ee0d2d86cd6b1ad7a5887
2018-10-18 01:06:24 -07:00
Mehdi Mulani 1c240ae898 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-17 12:55:10 -07:00
Ramanpreet Nara 298f14da12 Fix crashes on invalid regex
Summary:
**Problem:**
When you type an invalid regex into the input field of the RNTester app, it crashes. What's worse is that it remembers the input string so refreshing the view doesn't get rid of the error. Observe:
https://pxl.cl/jdm3

Reviewed By: yungsters

Differential Revision: D10349249

fbshipit-source-id: aab5977bd47271e9a4ff6202c93b47550da778d2
2018-10-12 13:47:01 -07:00
nd-02110114 76bc15d5e4 remove createReactClass from the RNTester/js/PanResponderExample.js (#21606)
Summary:
Related to #21581 .
Removed createReactClass from the RNTester/js/PanResponderExample.js

 - [x] npm run prettier
 - [x] npm run flow-check-ios
 - [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester/js/PanResponderExample.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21606

Reviewed By: hramos

Differential Revision: D10342587

Pulled By: RSNara

fbshipit-source-id: dac465d65dee7714f55739b77e6ca1b07294ee3c
2018-10-12 13:31:34 -07:00
Rafael Nunes G. da Silveira c96c93ef4a remove createReactClass from TimerExample.js (#21623)
Summary:
Relates to #21581
Removed `createdReactClass` from `TimerExample.js`.
Pull Request resolved: https://github.com/facebook/react-native/pull/21623

Reviewed By: hramos

Differential Revision: D10341474

Pulled By: RSNara

fbshipit-source-id: b4bf6e07fcf0355c89709809fe9a69e447b44e2f
2018-10-12 13:28:46 -07:00
Mehdi Mulani a82f6e164b Fix rntester buck build
Summary: Looks like we have to explicitly require the BuildConfig package if we want to use it.

Reviewed By: mdvacca

Differential Revision: D10275883

fbshipit-source-id: 4fbce3085e1ac6486a782b2bc0e335b7e48fe8de
2018-10-10 15:19:41 -07:00
nd-02110114 897f721728 remove createReactClass from RNTester/js/ImageExample.js (#21602)
Summary:
Related to #21581 .
Removed createReactClass from the RNTester/js/ImageExample.js

The diff of this PR is a little big. If there are any problems, please teach me �
 - [x] npm run prettier
 - [x] npm run flow-check-ios
 - [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester/js/ImageExample.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21602

Reviewed By: TheSavior

Differential Revision: D10304857

Pulled By: RSNara

fbshipit-source-id: 339b1220828c6218cad0d09c7a5034a61e623bc6
2018-10-10 14:47:02 -07:00
Himanshu Soni a7f958376b remove createReactClass from RNTester/js/ProgressViewIOSExample.js (#21611)
Summary:
Related to #21581 .
Removed createReactClass from the RNTester/js/ProgressViewIOSExample.js

Test Plan
----------

  - [x] npm run prettier
  - [x] npm run flow-check-ios
  - [x] npm run flow-check-android
- [x] Run RNTester app, go to ProgressViewIOS component, everything works.

Release Notes
--------------

[GENERAL] [ENHANCEMENT] [RNTester/js/ProgressViewIOSExample.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21611

Reviewed By: TheSavior

Differential Revision: D10304566

Pulled By: RSNara

fbshipit-source-id: 98a9dc83a0517a2866c4174ae254e1a9d9785b87
2018-10-10 14:15:55 -07:00
Eli White 636d01bbd0 Remove legacyImplementation from FlatList and SectionList
Summary:
`legacyImplementation` has caused a warning in FlatList for a long time. FlatList supports the use cases of the legacy implementation and should be adopted.

We will be removing the deprecated MetroListView and ListView components to reduce bundle sizes and the complexity of the codebase.

Reviewed By: yungsters

Differential Revision: D10245824

fbshipit-source-id: 60ff0d54974649b57bac9f9f29b769f34ca2701c
2018-10-09 17:31:27 -07:00
Himanshu Soni b32029f346 remove createReactClass from RNTester/js/SwipeableFlatListExample.js (#21613)
Summary:
Related to #21581 .
Removed createReactClass from the RNTester/js/SwipeableFlatListExample.js

Test Plan
-----

 - [x]  npm run prettier
- [x]  npm run flow-check-ios
- [x]  npm run flow-check-android
- [x]  Run RNTester app, go to SwipeableFlatList component, everything works.

Release Notes
--------

[GENERAL] [ENHANCEMENT] [RNTester/js/SwipeableFlatListExample.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21613

Differential Revision: D10275399

Pulled By: RSNara

fbshipit-source-id: 63030ca7da979a3d25bb94d52d4fd59994504aa3
2018-10-09 17:16:24 -07:00
Thomas BARRAS 80fd4bb2f5 Removing createReactClass from ListView*Example.js (#21582)
Summary:
Related to #21581

Remove createReactClass from ListViewExample and ListViewGridLayoutExample

- All flow tests succeed.
- Run RNTester app, go to ListView component, scroll, expand rows, everything works.
- Run RNTester app, go to ListViewGridLayout component, scroll, click on icons, everything works.

[GENERAL] [ENHANCEMENT] [ListViewExample.js] - rm createReactClass
[GENERAL] [ENHANCEMENT] [ListViewGridLayoutExample.js] - rm createReactClass
Pull Request resolved: https://github.com/facebook/react-native/pull/21582

Differential Revision: D10274350

Pulled By: RSNara

fbshipit-source-id: 4ea505a0f9661300309d6b9457202085293333b5
2018-10-09 17:02:30 -07:00
nd-02110114 5512c47429 remove createReactClass from the RNTester/js/TextExample.ios.js (#21603)
Summary:
Related to #21581 .
Removed createReactClass from the RNTester/js/TextExample.ios.js

- [x] npm run prettier
- [x]  npm run flow-check-ios
- [x] npm run flow-check-android

[GENERAL] [ENHANCEMENT] [RNTester/js/TextExample.ios.js] - remove createReactClass dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21603

Differential Revision: D10260872

Pulled By: RSNara

fbshipit-source-id: f63476756a10ddbce04da901012247d028579d53
2018-10-09 15:33:04 -07:00
Thomas Carlson 6c20017152 Remove TimerMixin from TouchableWithoutFeedback (#21493)
Summary:
Related to #21485.
Removed `TimerMixin` from the `TouchableWithoutFeedback` component since it is currently not used.
Added tests cases for `TouchableWithoutFeedback` to check for any runtime issues.
Pull Request resolved: https://github.com/facebook/react-native/pull/21493

Differential Revision: D10219098

Pulled By: RSNara

fbshipit-source-id: d9517b2bd5b72b0450fa864f3556673ae3181552
2018-10-05 13:34:12 -07:00
Guilherme Varandas f1d6e225c5 Removing TimerMixin on ProgressViewIOSExample (#21500)
Summary:
Related to #21485.
Removed TimerMixin from the `RNTester/js/ProgressViewIOSExample.js` screen since it is currently not used.

- [x] `npm run prettier`
- [x] `npm run flow-check-ios`
- [x] `npm run flow-check-android`
- [x] runtime tests using `ProgressViewIOSExample` on Android and iOS

**RNTester steps**

- [x] Run RNTester.
- [x] Navigate to `ProgressViewIOSExample` and check if the animations are executed correctly and without lag.

[GENERAL] [ENHANCEMENT] [RNTester/js/ProgressViewIOSExample.js] - remove TimerMixin dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21500

Reviewed By: TheSavior

Differential Revision: D10218366

Pulled By: RSNara

fbshipit-source-id: b44a0bbb50f6b0e85f406904131804eace941335
2018-10-05 11:18:21 -07:00
nd-02110114 3d31bebbeb Remove TimerMixin on ProgressBarAndroidExample.android.js (#21501)
Summary:
Related to #21485.
Removed TimerMixin from the `RNTester/js/ProgressBarAndroidExample.android.js` since it is currently not used.

- [x] npm run prettier
- [x] npm run flow-check-ios
- [x] npm run flow-check-android

In progress 🙇

[GENERAL] [ENHANCEMENT] [RNTester/js/ProgressBarAndroidExample.android.js] - remove TimerMixin dependency
Pull Request resolved: https://github.com/facebook/react-native/pull/21501

Reviewed By: TheSavior

Differential Revision: D10218375

Pulled By: RSNara

fbshipit-source-id: c4c12f65855452bc2485f034a0560afd204512f4
2018-10-05 10:50:21 -07:00
Eli White 8a2187b8f9 Remove TimerMixin from TimerExample
Summary: $title

Reviewed By: yungsters

Differential Revision: D10180650

fbshipit-source-id: e757f2ae9a2de582c4b5260e557a66b5ad0c7f57
2018-10-03 15:02:36 -07:00
Héctor Ramos e28d8f6eeb Fix copyright headers
Summary:
Update several files to use the proper copyright header:

```
//  Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
```

In the case of Xcode project files, I used the shortform version, `Copyright (c) Facebook, Inc. and its affiliates.`

Reviewed By: axe-fb

Differential Revision: D10114529

fbshipit-source-id: a1f2d5a46d04797c1cf281ea9ab80d3a2caa6fb4
2018-09-28 17:33:12 -07:00
empyrical 0fb713909b SwipeableListView: Remove PropTypes (#21298)
Summary:
This PR removes the remaining proptypes from `SwipeableListView`, and cleans up its flow types a bit. Its RNTester example has also been cleaned up, and turned into an ES6 class.

`ListView`'s props have been exported so this can use it.
Pull Request resolved: https://github.com/facebook/react-native/pull/21298

Reviewed By: TheSavior

Differential Revision: D10085505

Pulled By: RSNara

fbshipit-source-id: 20300d582f33b83dfc13cc5ddc71de5ab44bb90b
2018-09-27 14:32:21 -07:00
empyrical 2da60a8f45 Prettify remaining unprettified files (#21327)
Summary:
This PR is the result of running `yarn prettify` on the codebase - which caught a few files that were not prettified. This will make instructing people to run prettify a bit less complicated, since unrelated files will not show up in diffs.
Pull Request resolved: https://github.com/facebook/react-native/pull/21327

Differential Revision: D10046057

Pulled By: TheSavior

fbshipit-source-id: 2c771a3c758c72816c707e32ee2f4587e466f277
2018-09-25 19:50:08 -07:00
empyrical ae1817fdb9 RNTester: Remove all but one instance of PropTypes (#21321)
Summary:
Part of: https://github.com/react-native-community/discussions-and-proposals/issues/29

This PR removes all but one instance of PropTypes in `RNTester`. The last remaining conversion is `CameraRollView`, which I will do in a separate PR.
Pull Request resolved: https://github.com/facebook/react-native/pull/21321

Differential Revision: D10041809

Pulled By: TheSavior

fbshipit-source-id: c03b1ce5ad640ae59ae6240a3b6c13581345b5a3
2018-09-25 17:17:37 -07:00
gengjiawen 0a2825f8b3 add x86_64 arm64-v8a support. Fixes #2814 (#18754)
Summary:
add arm64 support, related issue : https://github.com/facebook/react-native/issues/2814.
If we are okay with binary aar android-jsc, then the pr can be directly merged. Otherwise merge facebook/android-jsc#30 first and do a new release.

RNTester all variant works. You can also test the apk from here: https://github.com/gengjiawen/react-native/releases/tag/v0.56beta.

https://github.com/facebook/android-jsc/pull/30.

 [ANDROID] [ENHANCEMENT] [ABI] - add x86_64 arm64-v8a support.

Differential Revision: D9491481

Pulled By: hramos

fbshipit-source-id: d6ec6992768eb0c0866a0317273e09fae5b8935e
2018-09-24 11:32:56 -07:00
Héctor Ramos 5068dfcad3 Use Android SDK 27 in React Native
Summary:
Upgrade React Native to Android SDK 27 again, following the reversal in D9886607 (68c7999c25).

The SDK 27 is actually available internally in an alternate location that is suitable for use cases like React Native's. For future reference, SDK 28 is also available for use in this location.

Reviewed By: axe-fb

Differential Revision: D9929066

fbshipit-source-id: 9413f891d5587293a30544351340e9407a2dce55
2018-09-20 07:56:23 -07:00
Janic Duplessis 2191eecf54 Fix InputAccessoryView safe area when not attached to a TextInput (#21179)
Summary:
When using an InputAccessoryView attached to a TextInput the safe area insets are not applied properly. This uses different autolayout constraints that works in all cases I tested, roughly based on the technique used here https://github.com/stockx/SafeAreaInputAccessoryViewWrapperView/blob/master/SafeAreaInputAccessoryViewWrapperView/Classes/SafeAreaInputAccessoryViewWrapperView.swift#L38.
Pull Request resolved: https://github.com/facebook/react-native/pull/21179

Differential Revision: D9928503

Pulled By: hramos

fbshipit-source-id: b1b623334558093042fd94ac85e1b52dd16aa1a0
2018-09-18 18:31:51 -07:00
Héctor Ramos 68c7999c25 Downgrade to compileSdkVersion 26
Summary:
Go back to using compileSdkVersion 26 and targetSdkVersion 26, temporarily. We can re-add this once Android SDK 27 becomes available in Facebook's internal repository.

The Android SDK Build Tools 27.0.3 **are** available, so we can continue using those.

Reviewed By: axe-fb

Differential Revision: D9886607

fbshipit-source-id: 6c1c9c1e1309c3a0483cc4c0bd8dcb4a5f29fc7e
2018-09-18 08:02:50 -07:00
gengjiawen 4f49404e15 bump android target version to 27 (#20843)
Summary:
bump target version to 27
pass all current ci.
none
[GENERAL] [ANDROID] [FEATURE] - bump android target version to 27
Pull Request resolved: https://github.com/facebook/react-native/pull/20843

Differential Revision: D9845999

Pulled By: hramos

fbshipit-source-id: 3c532a2d5a2b7d201bacab54cf3d60e1efffb653
2018-09-15 05:47:09 -07:00
David Vacca 0c576ef84a Expose AllowFileAccess property in WebView
Summary: This diff adds a new property in ReactWebView to be able to configure allowFileAccess

Reviewed By: achen1

Differential Revision: D9789466

fbshipit-source-id: 39d042ac6ef69e44f006a4c4b0c2dd900f84dbc9
2018-09-12 11:49:20 -07:00
Valentin Shergin 454aa02210 SafeAreaView: A new prop `emulateUnlessSupported` that turns off the custom implementation of `safeAreaInsets` insets
Summary: In some cases, the custom implementation of this prop is undesirable, so this allows to turn it off.

Reviewed By: yungsters

Differential Revision: D9759228

fbshipit-source-id: 4f61cd900c2da9046977c11a61606a4f5f961177
2018-09-11 21:19:18 -07:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Mehdi Mulani 335927db44 Use TextLegend example in Android as well
Summary:
@public
Just movin' stuff around.
This shouldn't render any actual metrics yet on Android, need native changes for that.

Reviewed By: achen1

Differential Revision: D9584669

fbshipit-source-id: 4b6169b14d1f2053258191f67e1f361a4b714a8e
2018-09-07 11:31:54 -07:00
Valentin Shergin 2caa1e01fa `ScrollViewSimpleExample` added to iOS-specific list of examples
Summary: Trivial.

Reviewed By: TheSavior

Differential Revision: D9631869

fbshipit-source-id: 39dccf8d3d7e0055f9aaed946e40ea27db36c9e4
2018-09-07 11:17:53 -07:00
Nicolas Charpentier 0cce0a62c1 Add backface-visibility support on Android (#15970)
Summary:
`backfaceVisibility` was only available on iOS and 3D transformations were lacking on Android.

Backface Visibility is computed from ~the decomposed matrix of transform prop~ the view with their rotation degree values.

~`MatrixDecompositionContext` properties have been made public so we can access to decomposed matrix values from outside (`ReactViewGroup`).~

I'm not sure if this is the best implementation, so if it's not let's discuss it.

cc janicduplessis foghina

Tested in https://github.com/charpeni/react-native-backface-visibility.

| Before | Now |
| - | - |
| <img src="https://user-images.githubusercontent.com/7189823/30123717-e5361598-9300-11e7-8e2e-a87a7a8d896a.gif" width="260" /> | <img src="https://user-images.githubusercontent.com/7189823/30514997-4d203572-9aee-11e7-8542-bfde41678eb6.gif" width="244" /> |

| iOS | Android |
| - | - |
| <img src="https://user-images.githubusercontent.com/7189823/36995899-609513b4-2083-11e8-9834-ee44c1a292e1.gif" width="300" /> | <img src="https://user-images.githubusercontent.com/7189823/36995978-9ed3b158-2083-11e8-841e-b9e3357d2509.gif" width="240" /> |

[ANDROID] [FEATURE] [ReactViewGroup] - Add backface-visibility support on Android
Pull Request resolved: https://github.com/facebook/react-native/pull/15970

Differential Revision: D9411130

Pulled By: hramos

fbshipit-source-id: 62f646a4de37d83922286cb98893a95b55fa889e
2018-09-07 10:26:20 -07:00
Kevin Gozali 0df92afc1c Remove NavigatorIOS
Summary:
Legacy navigator impl. There are other alternatives that should be used instead.

Part of the slimmening effort as described here: https://github.com/react-native-community/discussions-and-proposals/issues/6

Reviewed By: TheSavior

Differential Revision: D9677824

fbshipit-source-id: 24ae500751d2a8c398f246d36604a58f0b3c113b
2018-09-07 10:26:20 -07:00
Jonathan Kim 2515e4861a Move RN's DEFS.bzl to tools and rename to rn_defs.bzl
Reviewed By: mzlee

Differential Revision: D9553765

fbshipit-source-id: cb65081668ea2726f24d2c9c02661e859cc7a994
2018-08-29 13:21:52 -07:00
Mehdi Mulani 64a52532fe Text: send metrics after rendering (iOS)
Summary: This adds a callback for <Text> to get metrics about the rendered text. It's divided by line but that could be changed to "fragments" (which makes more sense for multi-lingual). Right now by line is convenient as you frequently want to know where the first and last line end (though we could make this work with fragments I suppose).

Reviewed By: shergin

Differential Revision: D9440914

fbshipit-source-id: bb011bb7a52438380d3f604ffe7019b98c18d978
2018-08-24 13:33:08 -07:00
Vladimir Zdravkovic 7ae186cd85
Updated the glog library version from 0.3.4 to 0.3.5 (#20811)
Summary:
While the original reason for this change was because of an issue #20780, with further investigation I concluded that the issue is till present for this combo of versions:
glog - 0.3.5
google-cast-sdk - 4.3.1

Downgrading google-cast-sdk to 4.3.0 fixed the build issue.

Release Notes:
--------------
Updated glog version from 0.3.4 to 0.3.5 for iOS

[IOS] [ENHANCEMENT] [GLOG]
Pull Request resolved: https://github.com/facebook/react-native/pull/20811

Differential Revision: D9485221

Pulled By: hramos

fbshipit-source-id: 65caf0839588384a5229a6165506dc6ef62e5fc5
2018-08-24 12:32:55 -07:00
Vladimir Zdravkovic 3b688ae6b2 Updated the glog library version from 0.3.4 to 0.3.5 (#20811)
Summary:
While the original reason for this change was because of an issue #20780, with further investigation I concluded that the issue is till present for this combo of versions:
glog - 0.3.5
google-cast-sdk - 4.3.1

Downgrading google-cast-sdk to 4.3.0 fixed the build issue.

Release Notes:
--------------
Updated glog version from 0.3.4 to 0.3.5 for iOS

[IOS] [ENHANCEMENT] [GLOG]
Pull Request resolved: https://github.com/facebook/react-native/pull/20811

Differential Revision: D9485221

Pulled By: hramos

fbshipit-source-id: 65caf0839588384a5229a6165506dc6ef62e5fc5
2018-08-23 14:17:18 -07:00
gengjiawen 6eac2d4e2f bump android gradle to 3.1.4 (#20767)
Summary:
Bump android gradle plugin to 3.1.4. We have been stay to 2.x too long. With 3.x we can have instant run and great performance and new features brought by google.

Also thanks to CFKevinRef great pr to make this possible.
pass all current ci. I have also tested RNTester release version works without crash.
https://github.com/facebook/react-native/pull/17967.
 [GENERAL] [ANDROID] [FEATURE] - bump android gradle to 3.1.4
Pull Request resolved: https://github.com/facebook/react-native/pull/20767

Differential Revision: D9437576

Pulled By: hramos

fbshipit-source-id: 6084056a1390582a75a879918f2538b0480f6299
2018-08-23 14:55:18 +01:00
Dulmandakh 5992f8d587 Bump compileSdkVersion to 27 and buildToolsVersion to 27.0.3 (#20777)
Summary:
I found that android support library 27.x (874cca1ac2) requires compileSdkVersion to be 27. Also found that many FB projects use SDK 27.
Pull Request resolved: https://github.com/facebook/react-native/pull/20777

Differential Revision: D9478431

Pulled By: hramos

fbshipit-source-id: ca100f6b5b39e7d112926124423f9510a0efc291
2018-08-23 14:55:12 +01:00
Dulmandakh d9868f7ed8 Bump Android Support Library to 27.1.1 (#20586)
Summary:
This PR bumps Android Support Library version to 27.1.1.

FYI, originally was a part of https://github.com/facebook/react-native/pull/20026.
Pull Request resolved: https://github.com/facebook/react-native/pull/20586

Differential Revision: D9414901

Pulled By: hramos

fbshipit-source-id: 580338e62a924c214accc5d944f17c81ad9e3f9f
2018-08-23 14:54:47 +01:00
gengjiawen 6e356895e7 bump android gradle to 3.1.4 (#20767)
Summary:
Bump android gradle plugin to 3.1.4. We have been stay to 2.x too long. With 3.x we can have instant run and great performance and new features brought by google.

Also thanks to CFKevinRef great pr to make this possible.
pass all current ci. I have also tested RNTester release version works without crash.
https://github.com/facebook/react-native/pull/17967.
 [GENERAL] [ANDROID] [FEATURE] - bump android gradle to 3.1.4
Pull Request resolved: https://github.com/facebook/react-native/pull/20767

Differential Revision: D9437576

Pulled By: hramos

fbshipit-source-id: 6084056a1390582a75a879918f2538b0480f6299
2018-08-22 23:19:42 -07:00
Dulmandakh 044b399e65 Bump compileSdkVersion to 27 and buildToolsVersion to 27.0.3 (#20777)
Summary:
I found that android support library 27.x (874cca1ac2) requires compileSdkVersion to be 27. Also found that many FB projects use SDK 27.
Pull Request resolved: https://github.com/facebook/react-native/pull/20777

Differential Revision: D9478431

Pulled By: hramos

fbshipit-source-id: ca100f6b5b39e7d112926124423f9510a0efc291
2018-08-22 23:19:42 -07:00
Dulmandakh 874cca1ac2 Bump Android Support Library to 27.1.1 (#20586)
Summary:
This PR bumps Android Support Library version to 27.1.1.

FYI, originally was a part of https://github.com/facebook/react-native/pull/20026.
Pull Request resolved: https://github.com/facebook/react-native/pull/20586

Differential Revision: D9414901

Pulled By: hramos

fbshipit-source-id: 580338e62a924c214accc5d944f17c81ad9e3f9f
2018-08-20 18:08:52 -07:00
EUROPE\laprosek 1658a4c080 Implement Image.queryCache on iOS (#18782)
Summary:
The API was available only on Android (with no mention to that effect in the docs, AFAICT).
This commit adds a simple iOS implementation based on NSURLCache. It should be possible to
query the decoded image cache as well to provide higher fidelity (i.e. "disk", "memory",
"decoded") if the caller passes size, scale, etc. in addition to the image URL, but it's
probably not worth the complexity. The assumption is that callers are interested in the
durability rather than performance aspect of the returned information.

Tested with RNTester on iPhone emulator.

[IOS] [ENHANCEMENT] [Image] - Implemented queryCache
Pull Request resolved: https://github.com/facebook/react-native/pull/18782

Differential Revision: D9411533

Pulled By: hramos

fbshipit-source-id: b430263959bb5f9b8ed9e28bb0a95f8879df881a
2018-08-20 16:17:18 -07:00
Panagiotis Vekris d4870babe6 v0.79.1 in xplat/js
Summary: The controller you requested could not be found.

Reviewed By: gabelevi

Differential Revision: D9390604

fbshipit-source-id: 68ba89ba197f74322e4c85c3bfc1f334fb740852
2018-08-18 22:19:34 -07:00
Eli White 76948ad1bd Typing View style as ViewStyleProp
Summary: Locking down view style so that invalid styles can't be passed into View.

Reviewed By: yungsters

Differential Revision: D9309097

fbshipit-source-id: 69e7e3c5626609cfd47c167027a55470c42228c8
2018-08-14 16:32:11 -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
Jordan Brown e05ceb824c Add flow suppressions to xplat android
Summary:
.android.js files may be checked (when the next version of flow is released) by using `flow start --flowconfig-name .flowconfig.android` and `flow status --flowconfig-name .flowconfig.android`

This diff adds suppressions to the errors that are in .android.js files, which flow does not check right now.

When site is `react_native_fb` or `react_native_android_fb`, error will be suppressed when checking with .flowconfig.android
When site is `react_native_fb` or `react_native_ios_fb`, error will be suppressed when checking with .flowconfig.

You can use `react_native_fb` when it should be suppressed for both.

The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9122178

fbshipit-source-id: 0ec9d3cae3d887f58645e6585b2a3f6c3889b13e
2018-08-13 21:38:58 +01:00
Wayne Cheng 43ded753b1 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-13 21:38:57 +01:00
rainywan 36440ff4b5 remove code relating to Nesting of <View> within <Text>, which result… (#20558)
Summary:
…s a crash in Text Example of RNTester.

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.

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/20558

Differential Revision: D9235009

Pulled By: hramos

fbshipit-source-id: 23ed28f7c8b84f509d35ac0fe7aa72c183a9ab11
2018-08-13 21:38:57 +01:00
Yury Zholobov e2ab0b762d add Image border*Radius tests
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20264

Differential Revision: D9228814

Pulled By: TheSavior

fbshipit-source-id: cad4c15e8070c7ab2023c20045b82f7ab3f994cf
2018-08-13 21:38:57 +01:00
Jordan Brown 2c0d7b461e Replace '@flow strict(-local)' with '@flow' in .android.js files
Summary:
Flow doesn't check .android.js files yet anyway.

I'm going to be adding suppressions in a followup diff. It would be nice to not have >1k suppressions saying that we can't do certain things in `flow strict` when we don't even typecheck with regular `flow` just yet

I ran these commands to produce this diff:
`find . -name '*.android.js' -exec sed -i 's/flow strict-local/flow/g' {} +`
`find . -name '*.android.js' -exec sed -i 's/flow strict/flow/g' {} +`

Followed https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files to do it.

The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9143783

fbshipit-source-id: e9af4fe695ebdba4db4083de1697cc248d48eb0d
2018-08-13 21:38:57 +01:00
Ziqi Chen 860d2d2012 Added 5 examples of new Accessibility API to RN Tester on Android
Summary:
I added three examples to the RN Tester in order to test the new accessibility props I've added to the accessibility API.

These examples test the following properties on views and touchables:
* AccessibilityRole
* AccessibilityStates
* AccessibilityHint

Reviewed By: PeteTheHeat

Differential Revision: D9167874

fbshipit-source-id: 4971b9ae43ad4f35c6be7e8548cc31393c3f0a33
2018-08-13 21:38:57 +01:00
Jordan Brown f125815efc Add flow suppressions to xplat android
Summary:
.android.js files may be checked (when the next version of flow is released) by using `flow start --flowconfig-name .flowconfig.android` and `flow status --flowconfig-name .flowconfig.android`

This diff adds suppressions to the errors that are in .android.js files, which flow does not check right now.

When site is `react_native_fb` or `react_native_android_fb`, error will be suppressed when checking with .flowconfig.android
When site is `react_native_fb` or `react_native_ios_fb`, error will be suppressed when checking with .flowconfig.

You can use `react_native_fb` when it should be suppressed for both.

The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9122178

fbshipit-source-id: 0ec9d3cae3d887f58645e6585b2a3f6c3889b13e
2018-08-13 11:16:41 -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
rainywan 03663491c6 remove code relating to Nesting of <View> within <Text>, which result… (#20558)
Summary:
…s a crash in Text Example of RNTester.

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.

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/20558

Differential Revision: D9235009

Pulled By: hramos

fbshipit-source-id: 23ed28f7c8b84f509d35ac0fe7aa72c183a9ab11
2018-08-08 18:16:55 -07:00
Yury Zholobov 9b5b07f97f add Image border*Radius tests
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/20264

Differential Revision: D9228814

Pulled By: TheSavior

fbshipit-source-id: cad4c15e8070c7ab2023c20045b82f7ab3f994cf
2018-08-08 14:32:49 -07:00
Jordan Brown b64b9dbece Replace '@flow strict(-local)' with '@flow' in .android.js files
Summary:
Flow doesn't check .android.js files yet anyway.

I'm going to be adding suppressions in a followup diff. It would be nice to not have >1k suppressions saying that we can't do certain things in `flow strict` when we don't even typecheck with regular `flow` just yet

I ran these commands to produce this diff:
`find . -name '*.android.js' -exec sed -i 's/flow strict-local/flow/g' {} +`
`find . -name '*.android.js' -exec sed -i 's/flow strict/flow/g' {} +`

Followed https://unix.stackexchange.com/questions/112023/how-can-i-replace-a-string-in-a-files to do it.

The controller you requested could not be found.

Reviewed By: TheSavior

Differential Revision: D9143783

fbshipit-source-id: e9af4fe695ebdba4db4083de1697cc248d48eb0d
2018-08-08 10:48:19 -07:00
Ziqi Chen 893e4d19a9 Added 5 examples of new Accessibility API to RN Tester on Android
Summary:
I added three examples to the RN Tester in order to test the new accessibility props I've added to the accessibility API.

These examples test the following properties on views and touchables:
* AccessibilityRole
* AccessibilityStates
* AccessibilityHint

Reviewed By: PeteTheHeat

Differential Revision: D9167874

fbshipit-source-id: 4971b9ae43ad4f35c6be7e8548cc31393c3f0a33
2018-08-08 01:31:46 -07:00
Tim Yung 9a4fd6b78d Switch: Warn for Deprecated Color Props
Summary:
Introduces warnings to `Switch` when the deprecated props are being used.

See D9081343 for more details on the specific prop changes.

Reviewed By: blairvanderhoof

Differential Revision: D9081451

fbshipit-source-id: 7f997fc97d316038f0917d2540b982bd9cf34d03
2018-07-31 21:01:41 -07:00
gengjiawen 847261be8e fix windows gradle bug (#20293)
Summary:
fix windows gradle bug, you can also see full log in https://ci.appveyor.com/project/gengjiawen/react-native/build/1.0.11/job/ic0nml8s4qbmni4e.
```
FAILURE: Build failed with an exception.

* What went wrong:
Failed to capture snapshot of input files for task ':RNTester:android:app:bundleReleaseJsAndAssets' property '$1' during up-to-date check.
> Failed to create MD5 hash for file content.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
```
Build success log: https://ci.appveyor.com/project/gengjiawen/react-native/build/1.0.12/job/xuaj8tm3p1piovbt.

pass all current ci.
https://github.com/facebook/react-native/pull/20281
 [GENERAL] [INTERNAL] [RNTester] - fix windows gradle bug
Pull Request resolved: https://github.com/facebook/react-native/pull/20293

Differential Revision: D9071261

Pulled By: hramos

fbshipit-source-id: 87fab94d15d78dac1db51f15ca5f4ea9e3a6ad04
2018-07-30 20:16:19 -07:00
Rotem M 7f0a4f72b4 Initial Detox E2E iOS configuration to be run on RNTester (#20235)
Summary:
This PR adds initial setup for Detox E2E iOS and some tests for ButtonExample.
Pull Request resolved: https://github.com/facebook/react-native/pull/20235

Reviewed By: hramos

Differential Revision: D8924525

Pulled By: TheSavior

fbshipit-source-id: 8117fc1559c2e9cb831f7b081aa8f4ddc8ba7401
2018-07-30 14:31:24 -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
Mehdi Mulani 892212bad2 Fix controlled <TextInput> on iOS when inputting in Chinese/Japanese
Summary:
@public
This should fix #18403.
When the user is inputting in Chinese/Japanese with <TextInput> in a controlled manner, the RCTBaseTextInputView will compare the JS-generated attributed string against the TextInputView attributed string and repeatedly overwrite the TextInputView one. This is because the native TextInputView will provide extra styling to show that some text is provisional.
My solution is to do a plain text string comparison at this point, like how we do for dictation.

Expected behavior when typing in a language that has "multistage" text input: For instance, in Chinese/Japanese it's common to type out the pronunciation for a word and then choose the appropriate word from above the keyboard. In this model, the "pronunciation" shows up in the text box first and then is replaced with the chosen word.
Using the word Japan which is written 日本 but first typed as にほん. It takes 4 key-presses to get to 日本, since に, ほ, ん, are all typed and then 日本 is selected. So here is what should happen:

1. enter に, onChange fires with 'に', markedTextRange covers 'に'
2. enter ほ, onChange fires with 'にほ', markedTextRange covers 'にほ'
3. enter ん, onChange fires with 'にほん', markedTextRange covers 'にほん'
4. user selects 日本 from the menu above the keyboard (provided by the keyboard/OS), onChange fires with '日本', markedTextRange is removed

previously we were overwriting the attributed text which would remove the markedTextRange, preventing the user from selecting 日本 from above the keyboard.

Cheekily, I've also fixed an issue with secure text entry as it's the same type of problem.

Reviewed By: PeteTheHeat

Differential Revision: D9002295

fbshipit-source-id: 7304ede055f301dab9ce1ea70f65308f2a4b4a8f
2018-07-30 08:01:10 -07:00
Wayne Cheng 86f8e9e760 Adding flow strict to as many xplat files as possible
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/'
  cat ~/temp | xargs ag -L 'flow strict$' | xargs sed -i '' 's/flow strict-local$/flow strict/'
  until flow; 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: yungsters

Differential Revision: D9003523

fbshipit-source-id: d0c9fbfe3c32e65d57819fa040d06cd6ebbd59cc
2018-07-27 12:31:42 -07:00
Ziqi Chen 1bc52267f5 accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 3/3
Summary:
Previously, I created two props, `accessibilityRole` and `accessibilityStates` for view. These props were intended to be a cross-platform solution to replace  `accessibilityComponentType` on Android and `accessibilityTraits` on iOS.

In this stack, I ran a code mod to replace instances of the two old properties used in our codebase with the new ones.
For this diff, I did a search for the few remaining uses of `accessibilityTraits` that was not caught by my script or the previous diff in the stack, and I manually changed them to `accessibilityRole` and `accessibilityStates`.

Changes in this diff generally followed this pattern:

Before:
```
function accessibilityTraits(props: Props): Array<string> {
  const traits = ['button'];
  if (props.selected) {
    traits.push('selected');
  }
  return traits;
}

  <AdsManagerTouchableHighlight
        accessibilityTraits={accessibilityTraits(this.props)}
```

After:
```
function accessibilityStates(props: Props): Array<AccessibilityState> {
  const states = [];
  if (!props.enabled) {
    states.push('disabled');
  }
  if (props.checked) {
    states.push('selected');
  }
  return states;
}

  <AdsManagerTouchableHighlight
        accessibilityRole="button"
        accessibilityStates={accessibilityStates(this.props)}
```

Reviewed By: PeteTheHeat

Differential Revision: D8944741

fbshipit-source-id: 4b309d9c858e7e831fbf971aca2f546df7a1431d
2018-07-26 13:48:29 -07:00
Ziqi Chen 121e2e5ca6 accessibilityTraits + accessibilityComponentType >> accessibilityRole + accessibilityStates 2/3
Summary:
Previously, I created two props, `accessibilityRole` and `accessibilityStates` for view. These props were intended to be a cross-platform solution to replace  `accessibilityComponentType` on Android and `accessibilityTraits` on iOS.

In this stack, I ran a code mod to replace instances of the two old properties used in our codebase with the new ones.
For this diff, I did a search for all the remnant uses of `accessibilityComponentType` that was not caught by my script, and I manually changed them to `accessibilityRole` and `accessibilityStates`. If the same prop also set `accessibilityTraits` I also removed that here because the two new props works on both platforms.

It was difficult to write a script for this, because most of them were contextual changes.
Out of the contextual changes, most of them followed one of these two patterns:

Before:

```
const accessibilityComponentType = 'button';
const accessibilityTraits = ['button'];

if (this.props.checked) {
  accessibilityTraits.push('selected');
}
if (this.props.disabled) {
 accessibilityTraits.push('disabled');
}

      contentView = (
        <AdsManagerTouchableHighlight
          accessibilityComponentType={accessibilityComponentType}
          accessibilityTraits={accessibilityTraits}
```

After:
      const accessibilityRole = 'button';
      const accessibilityStates = [];

        if (this.props.checked) {
          accessibilityStates.push('selected');
        }
        if (this.props.disabled) {
           accessibilityStates.push('disabled');
        }

      contentView = (
        <AdsManagerTouchableHighlight
          accessibilityRole={accessibilityRole}
          accessibilityStates={accessibilityStates}

Before:

```
  <PressableBackground
          accessible={this.props.accessible}
          accessibilityLabel={this.props.accessibilityLabel}
          accessibilityTraits={this.props.accessibilityTraits}
```

After:

```
  <PressableBackground
          accessible={this.props.accessible}
          accessibilityLabel={this.props.accessibilityLabel}
          accessibilityRole={this.props.accessibilityRole}
          accessibilityRole={this.props.accessibilityStates}
```

In addition to changing the props on the components,
Another fix I had to do was to add props  accessibilityRole and accessibilityStates to components that don't directly inherit properties from view including text input and touchables.

Reviewed By: PeteTheHeat

Differential Revision: D8943499

fbshipit-source-id: fbb40a5e5f5d630b0fe56a009ff24635d4c8cc93
2018-07-25 23:48:26 -07:00
Mats Byrkeland 253b29dbd8 Add accessibilityHint for iOS (#18093)
Summary:
This adds the accessibilityHint for View, Text and Touchable* on iOS.
The accessibilityHint provides some more information about an element
when the accessibilityLabel is not enough.

The accessibilityHint is a core accessibility property on iOS.

From https://developer.apple.com/documentation/objectivec/nsobject/1615093-accessibilityhint:
> An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label.

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

The npm scripts `test`, `flow`, `lint` and `prettier` are satisfied.

I added a couple of examples to the RNTester app. The Accessibility Inspector on Mac helps debugging accessibility stuff on a simulator, but it does not show the accessibilityHint. Therefore I tested the RNTester app on an iPhone 8 device using VoiceOver to verify the hint functionality. It works fine, and I've tested disabling and enabling "read hints" in the VoiceOver settings on the phone.

https://github.com/facebook/react-native-website/pull/222

[IOS][FEATURE][Accessibility] - Add accessibilityHint for View, Text, Touchable* on iOS
Closes https://github.com/facebook/react-native/pull/18093

Reviewed By: hramos

Differential Revision: D7230780

Pulled By: ziqichen6

fbshipit-source-id: 172ad28dc9ae2b67ea256100f6acb939f2466d0b
2018-07-25 17:47:42 -07:00
Yunyu Lin daa7c78055 Add FlatList and SectionList to Animated exports
Summary: There are several cases for creating an animated implementation of FlatList or SectionList (e.g. passing Animated.Event for onScroll with useNativeDriver enabled, see FlatListExample or SectionListExample), so we might as well add them to the exports.

Reviewed By: sahrens

Differential Revision: D8886446

fbshipit-source-id: 4b207500ea4d8d10de8c1b2639a5f492bc62e560
2018-07-17 22:35:28 -07:00
Wenting Hu 781f181610 Back out "[react-native][PR] Remove the deprecated `isIPhoneX_deprecated` constant"
Summary:
Original commit changeset: 0b0b3a2d7b80

This constant is still in use at Facebook. Its removal has been pushed to sometime in the future.

Reviewed By: mdvacca

Differential Revision: D8721213

fbshipit-source-id: d1197c96804e4d2dc96be27421e5248a2394cdac
2018-07-08 13:16:41 -07:00
Florian Schoellhammer 0f4926598a Back out "[react-native][PR] Remove the deprecated `isIPhoneX_deprecated` constant"
Summary:
Original commit changeset: 0b0b3a2d7b80

Reverting D8714400 which removed the `isIPhoneX_deprecated` flag, which is still widely used across the RN codebase https://fburl.com/biggrep/16jg5bzn

Reviewed By: hramos

Differential Revision: D8743401

fbshipit-source-id: cfc44bdd8019eda41e67ca573b20be417d121d12
2018-07-05 19:17:22 -07:00
Janic Duplessis 3b29274cc1 Remove the deprecated `isIPhoneX_deprecated` constant (#19920)
Summary:
Cleanup the `isIPhoneX_deprecated` constant which was said to be removed by June 1st 2018.
Closes https://github.com/facebook/react-native/pull/19920

Differential Revision: D8714400

Pulled By: hramos

fbshipit-source-id: 0b0b3a2d7b8098baf0474afea230780c79b2fe14
2018-07-02 14:49:22 -07:00
gengjiawen 6dcadca712 Add back ImageEditingExample example (#19972)
Summary:
add back missing file.
pass all current ci.
none
 [GENERAL] [INTERNAL] [RNTester] - Add back ImageEditingExample example.
Closes https://github.com/facebook/react-native/pull/19972

Differential Revision: D8711888

Pulled By: TheSavior

fbshipit-source-id: 14070bfbf747f7f59c4039981a9bc83c1c10862b
2018-07-01 16:32:07 -07:00
Tim Yung d9fa1d70dc RNTester: Better View Overflow Example
Summary:
Improves the examples in `ViewExample.js` that tests overflow behavior. Notable:

- Test view flattening behavior by setting `overflow` on views that only have other layout-only styles.
- Test the default behavior when `overflow` is not set at all.

Reviewed By: achen1

Differential Revision: D8690560

fbshipit-source-id: 6320ef51305952d13bf5724b369651fdfd32ff21
2018-06-29 12:18:27 -07:00
Tim Yung b283dcdd3e RNTester: Cleanup ViewExample.js
Summary: Minor cleanup of ViewExample.js in the RNTester.

Reviewed By: sahrens

Differential Revision: D8690133

fbshipit-source-id: d034f6d215679dac7f19fab90729bb7e7ef39edd
2018-06-29 12:18:27 -07:00
Dulmandakh bfb68c09ee android targetSdkVersion is 26 (#19944)
Summary:
This PR sets gradle targetSdkVersion to 26, which will satisfy new requirements from Play Store. Also removed redundant config from manifest files.
Closes https://github.com/facebook/react-native/pull/19944

Differential Revision: D8679682

Pulled By: hramos

fbshipit-source-id: 5c900d47be1d8b81ce340e38a05d9b309da143c3
2018-06-28 11:49:32 -07:00
gengjiawen 60827c6338 use same signing config for debug build (#19760)
Summary:
use same signing config for debug build
pass all current ci.
none
 [GENERAL] [INTERNAL] [RNTester] - use same signing config for debug build .
Closes https://github.com/facebook/react-native/pull/19760

Differential Revision: D8623409

Pulled By: hramos

fbshipit-source-id: 420842db3f954101ee8f771aaf0b021bea385741
2018-06-25 17:17:25 -07:00
Dulmandakh b569154ae6 bump build tools to 26.0.3 (#19831)
Summary:
This will bump android build tools to 26.0.3, and will remove warning about newer version of build tools in Android Studio, thus improve developer experience.
Closes https://github.com/facebook/react-native/pull/19831

Differential Revision: D8620094

Pulled By: hramos

fbshipit-source-id: fa1c6739bb7556736c1b323acea88fe87e82f4d7
2018-06-25 17:17:25 -07:00
Eli White 4c6dece09c Animated Example using Image
Summary: Need to test a potential issue with Animated.Image on Android. Adding a RNTester example to exercise it.

Reviewed By: yungsters

Differential Revision: D8559440

fbshipit-source-id: 4319d958de146c177cb0bd4b84679b773ce50833
2018-06-20 23:48:18 -07:00