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

290 Коммитов

Автор SHA1 Сообщение Дата
Dulmandakh f01c4e2a14 add support for native/downloadable fonts (#23865)
Summary:
Android API 26 and Android Support Library 26 added support for font resource type and native/downloadable fonts. It allows apps to easily download fonts from online providers, but also use of various font weights other than normal and bold, like medium. So it deprecated APIs for asset fonts, and should be removed in the future.

Advantages:
- Just copy font files in res/font and use it specifying filename (without extension) in fontFamily
- Define custom font-family using XML file (in res/font) and font files, it may have many weights and styles. See PR for example.
- Define configuration to download fonts from online font providers, and use it.

See https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml and https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts

[Android] [Changed] - add support for custom/downloadable fonts
Pull Request resolved: https://github.com/facebook/react-native/pull/23865

Differential Revision: D14506542

Pulled By: hramos

fbshipit-source-id: 67ba3148fb4b548cdbc779213cf6c1b2c3baffd2
2019-04-10 13:53:25 -07:00
James Ide 26cce3d7a8 Rewrite imports in RNTester to use standard paths (#24317)
Summary:
See https://github.com/facebook/react-native/issues/24316 for the motivation. This commit rewrites the imports in the RNTester project.

[General] [Changed] - Replaced Haste-style imports with standard path-style imports for RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/24317

Differential Revision: D14870504

Pulled By: cpojer

fbshipit-source-id: b14f22e7ce559efc332ced032617ca581196d90f
2019-04-10 10:20:25 -07:00
Spencer Ahrens fa10796d0b Cleanup native anim example
Summary: Makes things a little more clear.

Reviewed By: TheSavior, yungsters

Differential Revision: D14790256

fbshipit-source-id: 42e47487adfd48b8de5e987ac0e73a128a200824
2019-04-05 13:52:30 -07:00
MoOx e980d83389 - VirtualizedSectionList/SectionList: replace enableVirtualization prop annotation by correct underlying disableVirtualisation of VirtualizedList (#24312)
Summary:
It seems (I used git history to confirm) that FlatList/VirtualizedList have ([since the begining](c13f5d48cf/Libraries/Lists/VirtualizedList.js (L79))) a `disableVirtualization` prop.
SectionList ([since it's begining](abe737fe74/Libraries/Lists/VirtualizedSectionList.js (L98))) have a `enableVirtualization` prop, but since SectionList is VirtualizedSectionList which use VirtualizedList, this prop probably never did something. This fix just rename the prop properly so it can have an effect on the underlying VirtualizedList when you use a SectionList.

Since props are spread it's kind of working already, but the flow annotation are wrong (so it tells you it won't work/ you can't use it) which sucks.

(NB: I am doing this since I was trying to use a SectionList with react-native-web & server side rendering to get the all list, you can laugh).

[General] [Fixed] - VirtualizedSectionList/SectionList: replace enableVirtualization prop annotation by correct underlying disableVirtualisation of VirtualizedList
Pull Request resolved: https://github.com/facebook/react-native/pull/24312

Differential Revision: D14779449

Pulled By: cpojer

fbshipit-source-id: e51e1d639d2bb265b5b286786010d01ffd9d90e0
2019-04-04 14:32:39 -07:00
Pieter De Baets d9a82221a4 Back out "[react-native] Remove experimental gating for LayoutAnimation on Android"
Summary: We've identified a couple of remaining issues that need to be re-tested before we can ship this more broadly.

Reviewed By: fred2028

Differential Revision: D14775730

fbshipit-source-id: 22402149066c5fbe72c36fcf7f547d63feaf5241
2019-04-04 09:47:12 -07:00
Pieter De Baets 9895d01137 Remove experimental gating for LayoutAnimation on Android
Reviewed By: sahrens

Differential Revision: D14658087

fbshipit-source-id: 378ef4a5c5336d428b5045772d094a297b2767c7
2019-04-03 04:42:15 -07:00
Pieter De Baets f571c62ddf Implement completion callback for LayoutAnimation on Android
Summary: All animations are scheduled by the UIManager while it processes a batch of changes, so we can just wait to see what the longest animation is and cancel+reschedule the callback.

Reviewed By: mdvacca

Differential Revision: D14656733

fbshipit-source-id: 4cbbb7e741219cd43f511f2ce750c53c30e2b2ca
2019-04-03 04:42:14 -07:00
Christoph Nakazawa 9834c580af Move Geolocation JS code to FB internal
Summary: This removes the JS parts of Geolocation from React Native open source.

Reviewed By: yungsters

Differential Revision: D14693179

fbshipit-source-id: 1da5b7ec0e3e9d21d2019b7ee43e5f85661795b4
2019-04-01 15:21:59 -07:00
Christoph Nakazawa 45bd2b514b Remove navigator.geolocation, use Geolocation
Summary: This is the first diff in an effort to remove Geolocation from React Native. This diff removes the globally injected navigator.geolocation feature and instead requires explicit importing of `Geolocation`. When using Web APIs, people will need to patch `navigator.geolocation` on their own from now on.

Reviewed By: sahrens

Differential Revision: D14692386

fbshipit-source-id: c57b290b49728101250d726d67b1956ff23a9a92
2019-04-01 09:09:54 -07:00
Christoph Nakazawa 6345fcf12b Remove WebView from public RN interface
Summary:
This diff removes the `WebView` export from React Native. Internally, we are requiring `WebView` directly now and externally people will have to use the community maintained module. This diff does not yet move the WebView files from the repo, this will happen in a follow-up.

Note that I had to remove a test for Cookies that displayed data in a WebView. I don't think there is an easy way to retain this (debugging) information that likely very few people ever take a look at so I think it is fine.

Reviewed By: TheSavior

Differential Revision: D14613077

fbshipit-source-id: b1d412f970d09d7d70ecac2c23e62cfdd09d7c8e
2019-03-28 17:37:05 -07:00
Christoph Nakazawa 9ca7989f60 Remove SwipeableFlatList from RN
Summary: According to TheSavior this was an experimental module that "accidentally" got added to RN open source. In fact, we only use it in two places internally. This diff moves these files to FB internal and removes them from RN completely. I skipped the deprecation message because it was always an experimental feature and I don't expect anyone out there using it.

Reviewed By: TheSavior

Differential Revision: D14631749

fbshipit-source-id: 87878fcbb901e1e7fa4a3ff3205e09886ff3ed43
2019-03-27 16:30:09 -07:00
Kyle Pinkham b1251d067a Implement data detection for android Text elements (#19216)
Summary:
We want the ability to use Linkify on android text elements. This only adds this property to Text and not TextInput since there are some functional differences with how the types could be used between iOS and android - iOS allows one or many types while Linkify restricted us to providing only one option (using the masks).

Performance is affected ONLY FOR TEXT ELEMENTS USING THIS FEATURE since Linkify is searching for patterns.
Pull Request resolved: https://github.com/facebook/react-native/pull/19216

Differential Revision: D14621883

Pulled By: cpojer

fbshipit-source-id: cb692021d314140b9a92b29e23384afd7fd1b09e
2019-03-26 12:31:30 -07:00
Marshall Roch 5613aa8948 flow v0.95
Summary: 0.95 has a more accurate definition of JSON.stringify which could return void.

Reviewed By: dsainati1

Differential Revision: D14494286

fbshipit-source-id: 6cf9cb5889b4078548665bc66fe899a266c689ce
2019-03-16 09:12:27 -07:00
Dulmandakh d6ee448e15 fix switch trackColor on Android. fixes #23962 (#23977)
Summary:
fixes #23962, where trackColor is reset when value changed. This PR will set trackColor corresponding trackColor every-time value changes.

[Android] [Changed] - Fix Switch trackColor
Pull Request resolved: https://github.com/facebook/react-native/pull/23977

Differential Revision: D14495206

Pulled By: hramos

fbshipit-source-id: d712f540cd3f8359d6e85f79c12732689870a112
2019-03-16 07:33:14 -07:00
ericlewis 97e6ea1371 Fabric: working podspecs & works in RNTester (#23803)
Summary:
This is the couple of hacks I used after I finished #23802 in order to get fabric working on RNTester. This is inspired from prior work by kmagiera.

The goal of this PR is to show others what I’m struggling with, and to eventually merge it sans hacks.

- Yarn Install
- Uncomment the commented out pods in RNTester's pod file
- Open RNTesterPods workspace
- Run App

- this is only for pods, the non-pod RNTester will no longer work until updated with fabric too.
- `SurfaceHostingView` & `SurfaceHostingProxyRootView` both try to start the surface immediately, this leads to a race condition due to the javascript not having loaded yet, the hack here is:
   1. Swizzle the `start` method on `RCTFabricSurface` to no-op when called.
   2. Add observer for `RCTJavaScriptDidLoadNotification`
   3. Call private method `_startAllSurfaces` on `_surfacePresenter` in AppDelegate when we receive `RCTJavaScriptDidLoadNotification`.

[General] [Added] - Use Fabric in RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23803

Reviewed By: shergin, mdvacca

Differential Revision: D14450726

Pulled By: fkgozali

fbshipit-source-id: 8ae2d48634fecb60db539aaf0a2c89ba1f572c27
2019-03-15 23:59:22 -07:00
zhongwuzw 942bf4054d Fixed minuteInterval invalid in time mode (#23923)
Summary:
From https://github.com/facebook/react-native/pull/23861#issue-260337314
> changing "interval" example from "time-only" to "datetime" because there's a known bug that prevented the previous example from working

We need to ensure set minuteInterval after set datePickerMode, otherwise minuteInterval invalid in time mode.

cc. grabbou cpojer .

[iOS] [Fixed] - Fixed minuteInterval invalid in time mode
Pull Request resolved: https://github.com/facebook/react-native/pull/23923

Differential Revision: D14477549

Pulled By: cpojer

fbshipit-source-id: 2c612d488b6d592b1907e150df5e07fe83132829
2019-03-15 11:34:20 -07:00
zhongwuzw 25f7657cf6 Add key for items in TextInputExample of RNTester (#23900)
Summary:
We added the key at wrong places, so let's fix it.

CC. cpojer
<img width="365" alt="image" src="https://user-images.githubusercontent.com/5061845/54288501-894d9800-45e2-11e9-9a74-8bebf366aa04.png">

[iOS] [Fixed] - Add key for items in TextInputExample of RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23900

Differential Revision: D14477284

Pulled By: cpojer

fbshipit-source-id: 69cc46ea57aaeb652df6cdd831e6d0058fa26b24
2019-03-15 02:19:30 -07:00
ericlewis fc94ade11c Move RCTTest & takeSnapshot to RNTester (#23721)
Summary:
Part of: #23313.

This moves the `RCTTest` lib from `Libraries/RCTTest` to `RNTester/RCTTest`. This also removes `takeSnapshot` from React Native, and implements it as a standalone module in RNTester called `ScreenshotManager`.

[General] [Removed] - RCTTest & ReactNative.takeSnapshot
Pull Request resolved: https://github.com/facebook/react-native/pull/23721

Differential Revision: D14434796

Pulled By: PeteTheHeat

fbshipit-source-id: d6e103a0ea0b6702701cdb5ce8449163ca4628ce
2019-03-14 11:24:21 -07:00
ericlewis bbf715685e Fix semi-transparent backgrounds on Text components (#23872)
Summary:
Fix #23849. When setting a semi-transparent background on text, it becomes obvious that we are drawing the background color twice. Since background color is handled by the view, we should not need to draw the glyph background color too.

| Before        | After   |
| ------------- |-------------|
|<img src="https://i.imgur.com/8JGpKTC.png" width="300">     | <img src="https://imgur.com/qjKU9Ze.png" width="300">

[iOS] [Fixed] - Semi-transparent backgrounds on text
Pull Request resolved: https://github.com/facebook/react-native/pull/23872

Differential Revision: D14430501

Pulled By: shergin

fbshipit-source-id: 19743415b2d20a3b941b1c80bd7b47144e929458
2019-03-14 10:23:19 -07:00
Peter van der Zee dcd4e90d9a Bump Prettier to 1.16.4
Summary:
@public
This bumps Prettier to v1.16.4
Only format source files were updated.

Reviewed By: mjesun

Differential Revision: D14454893

fbshipit-source-id: 72f9872fe764a79dbf0d9fab9bebb1456b039f2f
2019-03-14 07:00:27 -07:00
zhongwuzw 9df493dc94 Added placeholder attributes example to RNTester (#23769)
Summary:
After some works, we already support some attributes to text input's placeholder, so we can add example to show it in RNTester.

[iOS] [Added] - Added placeholder attributes example to RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23769

Differential Revision: D14436086

Pulled By: cpojer

fbshipit-source-id: 8637dcb82a2e6aa51e351fd696b049aaee893997
2019-03-12 22:27:26 -07:00
Pavlos Vinieratos 629708beda Crash reporting heaven (#23691)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
I have used RN for a long time, and for all this time, crash reporting has been less great than native development crash reporting. At some point, companies like sentry, bugsnag and a bunch of others started supporting sourcemaps for js crashes in RN, which helped a lot.
But native crashes were (and still are) much harder to diagnose.

..Until now :D

I have make a repo of a sample RN app, included this PR in it, and some code and screenshots to help.
The repo is [here](https://github.com/pvinis/react-native-project-with-crash-heaven-pr).

I was trying to get good crash reports from native crashes in iOS for a looong time. I spoke with people in sentry, in bugsnag and more, and I could not get this solved. There was no clear way to get the **native** crashed to display correctly.
I made two repos here, one for [sentry](https://github.com/pvinis/SentryBadStack) and one for [bugsnag](https://github.com/pvinis/BugsnagBadStack), demonstrating the correct js handling and the bad native handling.

After all this, and talks with their support, twitter etc, I investigated further, on **why** this was happening. I thought there must be some reason that native crashes look bad in all the tools, and in the same way. Maybe it's not their fault, or up to them to fix it, or maybe they didn't have the experience to fix it.

In a test project I created, I checked what's up with the `RCTFatalException`, and I found out that the React Native code is catching the `NSException`s that come from any native modules of a RN app and converting it into an string and sending it to `RCTFatal` that created an `NSError` out of that string. Then it checks if the app has set a fatal error handler and if not, goes ahead and throws that `NSError`.

The problem here is that `NSException` has a bunch more info that the resulting `NSError` is missing or is altering. Turning the callstack into a string renders crash reporting tools useless as they are missing the original place the exception was thrown, symbols, return addresses etc. In both repos above it can be seen that both tools were thinking that the error happened somewhere in the `RCTFatal` function, and it did, since we create it there, losing all the previous useful info of the original exception. That leaves us with just a very long name including a callstack, but very hard to actually map this to the code and dsym.

I added a fatal exception handler, that mirrors the fatal error handler, as the error handler is used around React Native internal code.

Then I stopped making a string out of the original `NSException` and calling `RCTFatal`, and I simply throw the exception. This way no info is lost!

Finally, I added some code examples of native and js crashes and added a part in the `RNTester` app, so people can see how a js and a native error look like while debugging, as well as try to compile the app in release mode and see how the crash report would look like if they connect it to bugsnag or sentry or their tool of choice.

I have attached some images at the bottom of this PR, and you can find some in the 3 repos I linked above.

[iOS] [Fixed] - Changed the way iOS native module exceptions get handled. Instead of making them into an `NSError` and lose the context and callstack, we keep them as `NSException`s and propagate them.
[General] [Added] - Example code for native crashes in iOS and Android, with buttons on RNTester, so developers can see how these look when debugging, as well as the crash reports in release mode.
Pull Request resolved: https://github.com/facebook/react-native/pull/23691

Reviewed By: fkgozali

Differential Revision: D14276366

Pulled By: cpojer

fbshipit-source-id: b308d5608e1432d7676447347ae77c0721094e62
2019-03-12 19:41:51 -07:00
Mike Grabowski 8270de9c2c Fix DatePickerIOS e2e tests (#23861)
Summary:
DatePickerIOS tests stopped working after US changed their time zone on CircleCI. I decided to update the tests to be more reliable, by:
- removing "timezoneoffset" from the examples - I don't think it's needed. We don't demonstrate other props and it was causing us some troubles when timezones actually changed
- changing "interval" example from "time-only" to "datetime" because there's a known bug that prevented the previous example from working https://github.com/facebook/react-native/issues/9566
- splitting the label to two: one for date and other one for time, so that we can match the date only when we test "date" mode only

[IOS] [FIXED] - Improved reliability of DatePickerIOS e2e tests
Pull Request resolved: https://github.com/facebook/react-native/pull/23861

Differential Revision: D14434324

Pulled By: cpojer

fbshipit-source-id: 0f82b7e94bb1cb6ce75b44badd0064d1754370b9
2019-03-12 18:35:02 -07:00
George Zahariev 35d2dfcabf Deploy 0.94 to xplat
Summary:
Update Flow version in xplat (https://our.intern.facebook.com/intern/wiki/Flow/Flow_Release_Process/#update-xplat-js)

allow-large-files
bypass-lint

Reviewed By: nmote

Differential Revision: D14317820

fbshipit-source-id: 07ec22c0745321db036f4e10a502009a4b640652
2019-03-06 14:57:30 -08:00
Sunny Luo d2153fc58d Text: Implement textAlign justify for android O+ (#22477)
Summary:
Add textAlign justify for android O+(api level >=26)
Resolves https://github.com/facebook/react-native/issues/22475

<img src="https://user-images.githubusercontent.com/615282/49341207-35e3b980-f685-11e8-91ab-dbc19c1ee4d0.gif" width="400" />

Changelog:
----------
[Android] [Added] - Implement textAlign justify for android O+
Pull Request resolved: https://github.com/facebook/react-native/pull/22477

Differential Revision: D13512004

Pulled By: cpojer

fbshipit-source-id: e20f4976bfd957a5faeae0bbed2ff27c03023bb1
2019-03-05 00:35:08 -08:00
Sharon Gong 1889b797d3 Create a cross-platform accessibility example module (#23722)
Summary:
This PR divides the accessibility tests into two activities-- a cross-platform activity for accessibility features which are expected to work on all platforms, and platform specific tests for Android and iOS.

We believe that most, if not all, accessibility features should be cross-platform, with fallback implementations where the underlying concept doesn't exist on a particular platform.

This division of the tests makes it clearer for developers which features are expected to work on all supported platforms, and which are platform-specific.

[CATEGORY] general, Android, iOS
[TYPE] change

Message

Refactor the RNTester accessibility activities to better represent where the features are expected to work. Moves all cross-platform tests to AccessibilityExample.js,  Android-specific tests to AccessibilityAndroidExample.android.js, and iOS-specific tests to AccessibilityIOsExample.ios.js.
Pull Request resolved: https://github.com/facebook/react-native/pull/23722

Differential Revision: D14320696

Pulled By: cpojer

fbshipit-source-id: b5ab7a82a90f06d55a24262e86bd69fbdc890427
2019-03-04 22:08:09 -08:00
ericlewis 58c3a4c078 Fix crash when calling substring() on a string containing emoji. (#23609)
Summary:
Fixes #23459. It is not legal to write the character array of a std::string, and can result in undefined behavior.

[General] [Fixed] - Crash when substring intersects with emoji
Pull Request resolved: https://github.com/facebook/react-native/pull/23609

Differential Revision: D14198159

Pulled By: mdvacca

fbshipit-source-id: 71060b1b99ddab89793c98c09f99ec9974479e62
2019-03-01 00:57:00 -08:00
zhongwuzw 7ad2f43d72 Make RNTester GIF example locate local file system image (#23689)
Summary:
The reason I change GIF image url is `tumblr` blocked in some countries, like China , Kazakhstan, Pakistan, Indonesia. (PS. I can only confirm China blocked it 😂 ), so can we change this to local image?

[iOS] [Fixed] - Make RNTester GIF example locate local file system image
Pull Request resolved: https://github.com/facebook/react-native/pull/23689

Differential Revision: D14275149

Pulled By: cpojer

fbshipit-source-id: c4141cdda40792e5d8bfa805ccc74279e2eef55a
2019-02-28 18:09:37 -08:00
Christoph Nakazawa 14d9b2d68d Remove ListView and SwipeableListView from React Native
Summary:
This diff removes ListView and SwipeableListView from React Native:
* Removes the code and all examples
* Removes the exports on `react-native-implementation` but leaves an error message in dev mode only
* Uses `deprecated-react-native-listview` for `ListView` and `deprecated-react-native-swipeable-listview` for `SwipeableListView`

Both ListView and SwipeableListView are now fully removed from React Native in open source and we will continue to use the deprecated packages internally.

Reviewed By: TheSavior

Differential Revision: D14181708

fbshipit-source-id: 5030c33791f998567de058fee934449c16fa1d54
2019-02-25 22:40:10 -08:00
zhongwuzw 9ac219e077 fix getter of result from Image query cache (#23602)
Summary:
We assume `map` is the type of `Map`, but actually it's not, so we would get type error.

[iOS] [Fixed] - [RNTester] fix getter of result from Image query cache
Pull Request resolved: https://github.com/facebook/react-native/pull/23602

Differential Revision: D14221747

Pulled By: cpojer

fbshipit-source-id: 06cf08078a330e4d5731ad72010c87e9e69fcd7b
2019-02-25 20:34:44 -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
Eric Lewis 8ce3c1b43e Toggle secureTextEntry cursor spacing (#23524)
Summary:
This is a fix for #5859, based on the feedback in #18587. Instead of using `didSetProps` it uses a setter. I will also note that setting to `nil` no longer works (crashes) so setting it to a blank string then back to the original works fine.

[iOS] [Fixed] - Toggling secureTextEntry correctly places cursor.
Pull Request resolved: https://github.com/facebook/react-native/pull/23524

Differential Revision: D14143028

Pulled By: cpojer

fbshipit-source-id: 5f3203d56b1329eb7359465f8ab50eb4f4fa5507
2019-02-21 23:51:16 -08:00
Eric Lewis 1dff96b428 Refactor CameraRollView to not rely on ListView (#23517)
Summary:
CameraRollView was the last remaining code in RN to use ListView, this refactor changes it to FlatList.

[General] [Fixed] - CameraRollView in RNTester uses FlatList instead of ListView
Pull Request resolved: https://github.com/facebook/react-native/pull/23517

Differential Revision: D14126509

Pulled By: cpojer

fbshipit-source-id: b2aa03758e7c56493fb5fc59a7a0fc452b98fbc3
2019-02-21 20:26:25 -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
Eric Lewis a9c8e2c078 Update ws dependency (#23520)
Summary:
Our `ws` dependency is super outdated, and is [insecure](https://www.npmjs.com/advisories/550). It is used for the websocket example code in RNTester. This PR updates the dependency, and removes undefined console.logs.

[General] [Security] - Updates ws dependency to 6.4.1
Pull Request resolved: https://github.com/facebook/react-native/pull/23520

Differential Revision: D14147596

Pulled By: cpojer

fbshipit-source-id: a03041f613a84bf019d8d0a8c5028d6657b5d89a
2019-02-21 13:55:36 -08:00
Eric Lewis 38e91e6a9d fix getPhotos params on RNTester XHR example. (#23548)
Summary:
Fixes redscreen on RNTester's XHR page. CameraRoll getPhotos was missing params.

ss: https://i.imgur.com/JLThyrF.png

[iOS] [Fixed] - RNTester XHR Example crash
Pull Request resolved: https://github.com/facebook/react-native/pull/23548

Differential Revision: D14151304

Pulled By: hramos

fbshipit-source-id: 7ff02c7fe32f09aecd50bc7df9f37b7cd2851b1c
2019-02-20 09:57:26 -08:00
Levi Buzolic a89fe4165c Map TextInput textContentType strings to Objective-C constants (#22611)
Summary:
This is an updated version of #22579 which uses compile conditionals to prevent `use of undeclared identifier` errors when compiling on older versions of Xcode.

--------

Currently the only `textContentType` values that work are: `username`, `password`, `location`, `name` and `nickname`. This is due to the strings provided by React Native not matching up with the underlying string constants used in iOS (with the exception of the aforementioned types). Issue #22578 has more detail examples/explanation.
Pull Request resolved: https://github.com/facebook/react-native/pull/22611

Differential Revision: D13460949

Pulled By: cpojer

fbshipit-source-id: e6d1108422b850ebc3aea05693ed05118b77b5de
2019-02-19 23:52:40 -08:00
Eric Lewis d419f0787c Fix testScrollViewExample flakiness (#23541)
Summary:
Sometimes images are slow to load, and they are quite heavy. This converts the ScrollViewExample to a list of simple text items, similar to the append example inside of it.

What it looks like: https://i.imgur.com/jt083Iv.png

[iOS] [Fixed] - Fix testScrollViewExample flakiness
Pull Request resolved: https://github.com/facebook/react-native/pull/23541

Differential Revision: D14142947

Pulled By: hramos

fbshipit-source-id: c897a4caa5374ef67e3d67306e3124c29b969565
2019-02-19 16:24:08 -08:00
James Munro 794da6a4e4 Remove SnapshotViewIOS from public interface (#23497)
Summary:
Part of Lean Core #23313

Removes `SnapshotViewIOS` from the public RN interface.

I think there's a wider discussion to be had here about whether `RCTTest` should be part of the public distribution or at least whether this should be split into a separate utils package. It's mainly used by the RNTester app. It seems to be little known about but there are [some references to it online](https://blog.callstack.io/testing-your-react-native-apps-abfe41903dfd).

[iOS] [Removed] - `SnapshotViewIOS` is no longer publicly exported from RN
Pull Request resolved: https://github.com/facebook/react-native/pull/23497

Differential Revision: D14123280

Pulled By: cpojer

fbshipit-source-id: badaf6cb5d2195268f0f8b429fc11d6525747708
2019-02-18 04:04:23 -08:00
Daniel Sainati 8da1f1149f deploy 0.93
Summary:
upgrades flow version

allow-large-files
bypass-lint

Reviewed By: nmote

Differential Revision: D14095305

fbshipit-source-id: 000b3b2e085f673bc443fc8bc1b3aae1b42df0e9
2019-02-15 12:04:32 -08:00
Håvard Fossli cf5f25472d Add support for needsOffscreenAlphaCompositing on iOS (#19052)
Summary:
Currently on iOS in UIKit and in RN all views are by default set to `allowsGroupOpacity=true`. Any view that has all of the following
- `allowsGroupOpacity` set to true
- opacity greater than 0.0 and less than 1.0
- have any subviews

will be rendered off screen (on CPU). [See this link for more details](https://stackoverflow.com/questions/13158796/what-triggers-offscreen-rendering-blending-and-layoutsubviews-in-ios/13649143#13649143).  Which means performance will be decreased and may affect the user experience. Therefore it makes sense to allow the developers to override this property.

This pull request allows for changing `allowsGroupOpacity` via `needsOffscreenAlphaCompositing`. Android already supports this. This is not a new name or variable. See https://facebook.github.io/react-native/docs/view.html#needsoffscreenalphacompositing.
Pull Request resolved: https://github.com/facebook/react-native/pull/19052

Differential Revision: D14071300

Pulled By: hramos

fbshipit-source-id: 004278801a19463ebf9da6f8855f02ed27926025
2019-02-13 16:43:20 -08:00
Brent Erickson 08a6b573f7 Add scrollEnabled example to RNTester (#23409)
Summary:
RNTester is missing a test for the scrollEnabled prop

[General] [Added] - Added RNTester ScrollView scrollEnabled prop test
Pull Request resolved: https://github.com/facebook/react-native/pull/23409

Differential Revision: D14059824

Pulled By: hramos

fbshipit-source-id: 0287277b64aeac69c4aeba83dbb3f73be646ede7
2019-02-12 17:31:30 -08:00
Brent Erickson da6a26548b Fix crash in RNTester when removing/developing tests (#23406)
Summary:
Ensure that the current openExample (stored in AsyncStorage) exists in the module list.

It's possible for the example to be missing if a test was removed & previously open in RNTester OR when actively developing RNTester tests & switching between branches

[General] [Fixed] - Potential crash in RNTester when removing/developing test cases
Pull Request resolved: https://github.com/facebook/react-native/pull/23406

Differential Revision: D14055695

Pulled By: cpojer

fbshipit-source-id: 6cf00e097e934f7a342e7d210b6319e1cba142ca
2019-02-12 13:53:18 -08:00
Wellinton Monge e2bd7db732 Merge AlertIOS with Alert (#23318)
Summary:
Itwas merged AlertIOS into Alert and removed type parameter from Alert.alert line 60 at Alert.js

[AlertIOS] [Change and Replace] - Merge AlertIOS into Alert.
Pull Request resolved: https://github.com/facebook/react-native/pull/23318

Reviewed By: mjesun

Differential Revision: D14031421

Pulled By: cpojer

fbshipit-source-id: 98db173adeb65aa90d309f8a583993bc0cddb6e1
2019-02-12 07:38:42 -08:00
Josh Justice 43b56ecb24 Separate RTL examples in RNTester (#23354)
Summary:
Splits RTLExample into separate exported examples, so they can be filtered. This will help with Detox tests.

Previously the single forceRTL toggle affected multiple examples because they all share state—although the box model examples at the end had their own toggles. Now each example has its own RTL toggle so it is always available even when examples are filtered, and so the examples don't have to share state. There is still the separate forceRTL toggle that changes the setting in `I18nManager`, which affects the default setting when the page appears, as well as the direction of the "with directional meaning" pointer icon.

[General] [Changed] - Split RTLExample into separate exported examples
Pull Request resolved: https://github.com/facebook/react-native/pull/23354

Differential Revision: D14030498

Pulled By: cpojer

fbshipit-source-id: 44eb493297f6a4832b55ef2b02a93dc5c213f337
2019-02-11 14:08:36 -08:00
Spencer Ahrens 10c8352141 Fix flow typing of Text
Summary:
Make Text prop types exact to catch tons of errors, including typos like in https://fb.workplace.com/groups/rn.support/permalink/2306953619353240/.

I tried to fix things when it was totally obvious what the intent was, but otherwise tried to keep the existing behavior the same, even if it meant that usage of some props was getting ignored, like `hitSlop`.

Reviewed By: TheSavior

Differential Revision: D13892999

fbshipit-source-id: 5003508a648287e4eca8055fb59da5f03bd066cc
2019-02-05 15:26:53 -08:00
Ram N 02697291ff Remove TabbarIOS from OSS
Reviewed By: fkgozali

Differential Revision: D13858496

fbshipit-source-id: ba9dd9912f4abcbeb3326f412ec91be9bee9cfd3
2019-01-30 23:41:40 -08:00
zhongwuzw 8508da425e Disable animation native driver in AnimatedGratuisousApp of RNTester (#23172)
Summary:
`Animated.event` not work with direct events and not bubbling events, which means it does not work with `PanResponder`, please see [Animation Caveats](https://facebook.github.io/react-native/docs/animations#caveats)

Changelog:
----------

[General] [Fixed] - Disable animation native driver in AnimatedGratuisousApp of RNTester.
Pull Request resolved: https://github.com/facebook/react-native/pull/23172

Differential Revision: D13838555

Pulled By: cpojer

fbshipit-source-id: 866bc83e780d6712ffae5964615af44a72bf998c
2019-01-28 03:26:12 -08:00
Josh Justice b0302eca24 Separate MaskedViewExample into individual examples (#23168)
Summary:
In RNTester, previously the MaskedViewExample was returned as a single example record. However, within that one example there were several sub-examples. Now that we've implemented example filtering, filtering didn't really work for MaskedViewExample because it only operates on top-level examples.

There was no benefit to grouping MaskedViewExample into a single example, so this PR splits it into separate examples.

Changelog:
----------

Help reviewers and the release process by writing your own changelog entry. See http://facebook.github.io/react-native/docs/contributing#changelog for an example.

[General] [Fixed] - Fix filtering of MaskedViewExample by splitting into separate example records.
Pull Request resolved: https://github.com/facebook/react-native/pull/23168

Differential Revision: D13838524

Pulled By: cpojer

fbshipit-source-id: 21ae8228e4ce5bfc06fb1ea230163da9261cb36a
2019-01-28 03:18:44 -08:00
Janic Duplessis 3a33e75183 Fix textTransform when used with other text styles on Android (#22670)
Summary:
On Android `textTransform` breaks other styles applied to the text. It seems related to the usage of `ReplacementSpan` which allows drawing the text manually but seems to throw away some changes made by other span applied to the text.

To fix it I removed the usage of `ReplacementSpan` and simply transform the text before appending it to the `Spannable` string. To make sure textTransform is inherited correctly I added it to TextAttributes which handles this.
Pull Request resolved: https://github.com/facebook/react-native/pull/22670

Differential Revision: D13494819

Pulled By: cpojer

fbshipit-source-id: 1c69591084aa906c2d3b10153b354d39c0936340
2019-01-25 06:27:21 -08:00