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

376 Коммитов

Автор SHA1 Сообщение Дата
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
ericlewis 9d817751b3 Fix RNTester warnings (#23584)
Summary:
Part of #22609. This brings the warning count down to 0 for the RNTester target, also adds a fancy new icon!

[General] [Fixed] - All RNTester warnings fixed
Pull Request resolved: https://github.com/facebook/react-native/pull/23584

Differential Revision: D14181197

Pulled By: cpojer

fbshipit-source-id: 4377a55cee6a2d87a7926f1c34663b8a070aef88
2019-02-21 23:17:37 -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
Ville Immonen 2321b3fd7f Split React.podspec into separate podspecs for each Xcode project (#23559)
Summary:
This PR implements the first part of [RFC0004: CocoaPods Support Improvements](353d44f649/proposals/0004-cocoapods-support-improvements.md), splitting the `React.podspec` into separate podspecs to more closely match the structure of Xcode projects.

The new structure aims to have one to one mapping between Xcode projects and podspecs. The only places where we differ from this mapping are:
* `React/React-DevSupport.podspec`: `DevSupport` is a part of `React.xcodeproj`, which corresponds to the `React-Core` pod. However, we can't include it in the `React-Core` pod because `DevSupport` depends on `React-RCTWebSocket`, which depends on `React-Core`. Pods may not have circular dependencies.
* The new pods under `ReactCommon/` don't have a corresponding `xcodeproj` because there are no `xcodproj` files in `ReactCommon/`. Those C++ modules are included in `React.xcodeproj`.

*Next steps (not in scope of this PR):*
- Start submitting the Podspecs to CocoaPods on a deploy (or turn the React Native repo into a spec repo): this is important in order to make the experience nicer for library consumers, so that it's not necessary to specify the local path of each Podspec in `Podfile`, you can just add `pod 'React', <version>`.
- Add `Podfile` to the default project template (I have a PR ready for this, but because of bugs related to subspecs, it's blocked on this PR)

[iOS] [Changed] - Split React.podspec into separate podspecs for each Xcode project
Pull Request resolved: https://github.com/facebook/react-native/pull/23559

Differential Revision: D14179326

Pulled By: cpojer

fbshipit-source-id: 397a9c30b6b5d24f86c790057c71f0d403f56c3d
2019-02-21 18:35:44 -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
Héctor Ramos eb414b7f8d Update iOS Snapshots (#23538)
Summary:
The iOS snapshots needed to be updated after cf5f25472d updated `ViewExample.js`.

[iOS] [Fixed] - Updated snapshots on iOS.
Pull Request resolved: https://github.com/facebook/react-native/pull/23538

Differential Revision: D14146723

Pulled By: cpojer

fbshipit-source-id: f949d4c7925ab53ef42f42689bc2ed7b254dea48
2019-02-19 22:07:32 -08:00
zhongwuzw 9375a12620 Fixed RNTester tvOS build error on Xcode10 (#23543)
Summary:
We add info.plist into `Copy Bundle Resources`, it leads to build error on new Xcode10 compile system.

[iOS] [fixed] - Fixed RNTester tvOS build error on Xcode10
Pull Request resolved: https://github.com/facebook/react-native/pull/23543

Differential Revision: D14146488

Pulled By: cpojer

fbshipit-source-id: 10d9973fadb7e79e76e6a2a4945c9108184e4708
2019-02-19 21:28:09 -08:00
zhongwuzw be36aa89c5 Remove fake OCMock group (#23546)
Summary:
We created a fake OCMock group like below which text color is red, actually we have another OCMock group in `RNTesterUnitTests`, so we can remove this.
![image](https://user-images.githubusercontent.com/5061845/53064665-9dcad300-3503-11e9-93c0-fd63b4395ba3.png)

[iOS] [Fixed] - Remove fake OCMock group in RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23546

Differential Revision: D14146477

Pulled By: cpojer

fbshipit-source-id: 4878c8d40eab451f20bd7e223d93d212e514f26d
2019-02-19 21:17:02 -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
Dulmandakh 57f444bd8a bump targetSdkVersion to 28 (#23431)
Summary:
Bump targetSdkVersion to 28

[Android] [Changed] - Bump targetSdkVersion to 28
Pull Request resolved: https://github.com/facebook/react-native/pull/23431

Differential Revision: D14065177

Pulled By: cpojer

fbshipit-source-id: a161d1d385b7b40ec93d70851e5a41baeb58f830
2019-02-13 07:13:19 -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
Héctor Ramos 05c56edf41 Remove flaky Switch e2e test (#23410)
Summary:
'Switch that starts on should switch' appears to be flaky, as it has failed on seemingly unrelated commits, only to succeed on the next CI run. `Switch` is scheduled to be removed from the core repository anyway, so I'm removing this test to ensure we get a clear signal for the rest of the repository.

[GENERAL] [Changed] - Tests: Removed flaky Switch e2e test.
Pull Request resolved: https://github.com/facebook/react-native/pull/23410

Differential Revision: D14057068

Pulled By: cpojer

fbshipit-source-id: dc7bc74c3d23ec3856107fec4ee9fa388adce2e5
2019-02-12 14:53:22 -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
Dulmandakh 38eb2a70af Enable Java8 (#23295)
Summary:
Running *lint* on RN found that there are some Java 8 features used without specifying Java 8 compatibility in projects. This PR adds Java 8 compatibility and fixes errors caused by Java 8 feature use. I suspend that it may be cause of many failures on older Androids, but also found that many modules/packages switched to and require Java 8.

```java
../../src/main/java/com/facebook/react/devsupport/BundleDownloader.java:167: Try-with-resources requires API level 19 (current min is 16)
../../src/main/java/com/facebook/react/devsupport/DevServerHelper.java:658: Try-with-resources requires API level 19 (current min is 16)
```

For more information https://developer.android.com/studio/write/java8-support

[Android] [Changed] - Enable Java 8
Pull Request resolved: https://github.com/facebook/react-native/pull/23295

Differential Revision: D13959096

Pulled By: cpojer

fbshipit-source-id: 0bfd0565b61a132906cf35ee55b4afcf5450f7cb
2019-02-05 10:18:27 -08:00
Ramanpreet Nara f37093319b Start using getConstants
Summary:
TurboModules depend on a getConstants method. Existing ObjectiveC modules do not have this method. Therefore, I moved the contents of `constantsToExport` to `getConstants` and then had `constantsToExports` call `getConstants`.

facebook
Since all NativeModules will eventually need to be migrated to the TurboModule system, I didn't restrict this to just the NativeModules in Marketplace.

```
const fs = require('fs');

if (process.argv.length < 3) {
    throw new Error('Expected a file containing a list of native modules as the third param');
}

function read(filename) {
    return fs.readFileSync(filename, 'utf8');
}

const nativeModuleFilenames = read(process.argv[2]).split('\n').filter(Boolean);

nativeModuleFilenames.forEach((fileName) => {
    if (fileName.endsWith('.h')) {
        return;
    }

    const absPath = `${process.env.HOME}/${fileName}`;
    const fileSource = read(absPath);

    if (/(\n|^)-\s*\((.+)\)getConstants/.test(fileSource)) {
        return;
    }

    const constantsToExportRegex = /(\n|^)-\s*\((.+)\)constantsToExport/;
    const result = constantsToExportRegex.exec(fileSource);

    if (result == null) {
        throw new Error(`Didn't find a constantsToExport function inside NativeModule ${fileName}`);
    }

    const returnType = result[2];

    const newFileSource = fileSource.replace(
        constantsToExportRegex,
        '$1- ($2)constantsToExport\n' +
        '{\n' +
        `  return ${returnType.includes('ModuleConstants') ? '($2)' : ''}[self getConstants];\n` +
        '}\n' +
        '\n' +
        '- ($2)getConstants'
    );

    fs.writeFileSync(absPath, newFileSource);
});
```

```
> xbgs -l ')constantsToExport'
```

Reviewed By: fkgozali

Differential Revision: D13951197

fbshipit-source-id: 394a319d42aff466c56a3d748e17c335307a8f47
2019-02-04 17:46:56 -08:00
Dulmandakh dda2b82a0a ReactActivity extends FragmentActivity (#22662)
Summary:
In https://github.com/facebook/react-native/pull/20602, I tried to make ReactActivity to extend AppCompatActivity per Google recommendation. But import failed, now ReactActivity extends FragmentActivity which is a parent class of AppCompatActivity and step forward to extend AppCompatActivity.
Pull Request resolved: https://github.com/facebook/react-native/pull/22662

Reviewed By: mdvacca

Differential Revision: D13505140

Pulled By: hramos

fbshipit-source-id: d4edc8dc5c606c45811c1deddf5727a47ad484d8
2019-02-01 12:34:13 -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
Héctor Ramos 47a5bcbca2 Remove TabBarExample from Screenshot Tests (#23206)
Summary:
Fixes https://github.com/facebook/react-native/issues/23108. The TabBarIOS component is scheduled to be removed from core any day now, so it's OK to remove it from our test suite.

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

[iOS] [Removed] - Remove TabBarExample SST
Pull Request resolved: https://github.com/facebook/react-native/pull/23206

Differential Revision: D13864064

Pulled By: hramos

fbshipit-source-id: f65da75e2789d384dcd713a27ca5528f0faa7526
2019-01-29 14:38:31 -08:00
Mike Grabowski 9a9370481f Fix Detox tests after upgrading to latest CLI (#23191)
Summary:
Latest changes inside CLI now require that Metro configuration is provided when building RNTester app. This is to let CLI know that instead of looking for "react-native" under "node_modules" (that is obviously not present since we are running from source), it should check the paths provided.

When running "npm start", it finds the configuration at the root. However, when building through Xcode (e.g. "react-native bundle" or "xcodebuild" in Release scheme), it runs "react-native-xcode.sh" that works in different folder and makes Metro not detect the configuration file.

This PR explicitly sets path to the configuration via `BUNDLE_CONFIG`.

It also removes `pwd` from being prepended to all `BUNDLE_CONFIG` values. In my case, `pwd` was `/Users/grabbou` and the RNTester files where inside `/Users/grabbou/Repositories/react-native`. I was unable to point the script to correct location without making it aware of the folder structure - which is not going to work on the CI.
Pull Request resolved: https://github.com/facebook/react-native/pull/23191

Differential Revision: D13851741

Pulled By: hramos

fbshipit-source-id: d920353fd68d39468bd33bd1ad47e03b017a7727
2019-01-28 20:29:58 -08:00
Janic Duplessis 959a13363a Disable no-inline-styles lint rule for RNTester (#23169)
Summary:
We have a million of inline styles in RNTester which causes a lot of noise with the lint bot in PRs. The rule makes sense for the main libraries but for RNTester it usually makes examples easier to read to just use inline styles.  Also reduces lint warnings from 357 to 77.

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

[General] [Changed] - Disable no-inline-styles lint rule for RNTester
Pull Request resolved: https://github.com/facebook/react-native/pull/23169

Differential Revision: D13838529

Pulled By: cpojer

fbshipit-source-id: 474e159e0b0c07bce42878db2b214b8903b49c08
2019-01-28 03:26:12 -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
Woraphot Chokratanasombat 27617be9bb RNTesterSnapshotTests update ios snapshot images due to layout changes (#23152)
Summary:
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change:

Changelog:
----------
Currently ci in master fail for `test_ios`. Due to tests in `RNTesterSnapshotTests`. (Related to https://github.com/facebook/react-native/issues/23108)
Root cause is layout in RNTest was changed and snapshot is not updated to reflect changes. https://user-images.githubusercontent.com/4032276/51730680-06609480-20ab-11e9-88cb-d4113e2819f2.png

Reference: https://circleci.com/gh/facebook/react-native/68285?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link

[iOS] [Fixed] - Fix test ios in ci
Pull Request resolved: https://github.com/facebook/react-native/pull/23152

Differential Revision: D13817049

Pulled By: cpojer

fbshipit-source-id: 7df8b6744ae91cf9be0ef9eee476c8f1565ae1f6
2019-01-25 05:25:39 -08:00
zhongwuzw 803480aef5 Remove AlertExample from RNTester in iOS (#23099)
Summary:
Changelog:
----------

[iOS] [Removed] - Removed AlertExample from RNTester in iOS.
Pull Request resolved: https://github.com/facebook/react-native/pull/23099

Differential Revision: D13781905

Pulled By: cpojer

fbshipit-source-id: 38c4359792c8ad9d8205d87a33c24f834ef51bbf
2019-01-23 04:10:13 -08:00
zhongwuzw 25f7b0e878 Fix SectionList layout of RNTester on iOS (#23119)
Summary:
Changelog:
----------

[iOS] [Fixed] - Fix SectionList layout of RNTester on iOS
Pull Request resolved: https://github.com/facebook/react-native/pull/23119

Differential Revision: D13781561

Pulled By: cpojer

fbshipit-source-id: 9cc89c76a4139fe419c61a55b02a8a2992e76f4e
2019-01-23 03:01:37 -08:00
David Vacca fe6f6cd46f Upgrade Android support library to version 28 in RN
Summary: This diff upgrades the Android Support Library to use version 28.0.0

Reviewed By: cpojer

Differential Revision: D13737512

fbshipit-source-id: 7b3d9c384df0b25e5ce48e769e1ff0ac9be9f104
2019-01-22 10:44:53 -08:00
Jordan Brown 2191c9ed58 remove unused suppressions in xplat
Summary:
Removes unused suppressions before deploying 0.91. See D13708161 for more context on why these couldn't be removed before.

I will follow up with 2 more diffs:
1. A diff that bumps the flow version in xplat and removes unused suppressions
2. A diff that adds new suppressions for 0.91

Reviewed By: samwgoldman

Differential Revision: D13720219

fbshipit-source-id: b07dd163962fed7ff27ce3e0a4a73a71c51965d9
2019-01-18 06:44:05 -08:00
Jeff Held c93edb5ffd Apply thumbTintColor to Sliders on iOS (#22177)
Summary:
Applies the `thumbTintColor` prop to Sliders on iOS (which has been supported since iOS 5.0). Updates other documentation so that it is not labeled as Android-only, including the RNTester app
Pull Request resolved: https://github.com/facebook/react-native/pull/22177

Differential Revision: D13695554

Pulled By: hramos

fbshipit-source-id: 250f6574b193a37b3cd237bcf42612c3e91bf813
2019-01-16 15:13:43 -08:00
Adam Comella 7d881c1d8a RNTester: Add `allowFontScaling` example to Android (#22991)
Summary:
iOS's `allowFontScaling` example was copied to Android. Also, I added a case illustrating that `allowFontScaling` gets inherited in nested `<Text>` scenarios. This tests the bug fix from #22917. This nested case was added to both iOS and Android.

Also, moved the comment in `TextAttributes.java` from the top of the file to the top of the class definition as requested in #22917.
Pull Request resolved: https://github.com/facebook/react-native/pull/22991

Differential Revision: D13671380

Pulled By: cpojer

fbshipit-source-id: a8aae4f051c76391e33bdbd6bdc80aff9b7de5cd
2019-01-16 06:47:02 -08:00
Monte Thakkar 7fbccdea22 Updated RedBox screen (#22242)
Summary:
[Re: RedBox screen is a bit scary - Discussions and Proposals](https://github.com/react-native-community/discussions-and-proposals/issues/42)

Per hramos:
> The RedScreen was inspired by Ruby on Rails's error screen

> I do see the RedBox screen could be made less jarring while still successfully displaying all the information we need.

Hence jamonholmgren came up with the idea that only the header & footer of the RedBox screen could be red. This makes the content a bit more readable as well as makes the screen a little less intimidating.

Also frantic made the suggestion that since the bottom buttons are not as important, they don't need to stand out. Hence only the header of the RedBox screen which displays the error is made red.

Screenshots:
----------

<div style="flex-direction: row">
<img width="325" alt="orginal" src="https://user-images.githubusercontent.com/7840686/48322916-b4958b80-e5de-11e8-9276-33378d1b41c5.png">
<img width="320" alt="redbox_v2_ios" src="https://user-images.githubusercontent.com/7840686/48665300-cce32b80-ea60-11e8-8e8f-88f74bad30ca.png">

</div>

<div style="flex-direction: row">
<img width="300" alt="original_android" src="https://user-images.githubusercontent.com/7840686/48322958-d5f67780-e5de-11e8-891c-1b20bd00e67b.png">
<img width="300" alt="redbox_v2_android" src="https://user-images.githubusercontent.com/7840686/48665312-f13f0800-ea60-11e8-9fb6-47e03c809789.png">

</div>
Pull Request resolved: https://github.com/facebook/react-native/pull/22242

Reviewed By: hramos

Differential Revision: D13564287

Pulled By: cpojer

fbshipit-source-id: fcb6ba5e20d863f4b957d20f3787f5b7a365bfdb
2019-01-15 06:29:49 -08:00
Rick Hanlon 5d1b27b017 Fix RNTester Camera Example
Summary: Fixes a bug introduced with the example filtering in D13561744 causing the Camera Roll example to not show any pictures

Reviewed By: JoshuaGross

Differential Revision: D13622124

fbshipit-source-id: a5863dcdd9f89ae1373910f25b38e4a322796dbe
2019-01-10 15:47:02 -08:00
Peter Argany e6eff1f54f Fix RNTester Snapshot and Integration tests missing polyfills
Summary: Emily removed some magic that required InitializeCore for everything back in Sept/Oct. These tests have been broken for a long time, so it wasn't obvious that they broke.

Reviewed By: ejanzer

Differential Revision: D13601264

fbshipit-source-id: ea6ab7c8891207dad06cd062968d019a236cf8fc
2019-01-09 10:23:50 -08:00
Josh Justice 00905ab8f7 Fix rerender count on RNTester blue tab (#22876)
Summary:
In the RNTester TabBarIOS screen, the content of the blue tab suggested it should be displaying a count for the number of rerenders, but it was not:

![before](https://user-images.githubusercontent.com/15832198/50725270-d122e100-10c0-11e9-88a2-1030f6dc3b9a.jpg)

This PR adds the count onto the blue tab:

![after](https://user-images.githubusercontent.com/15832198/50725275-dbdd7600-10c0-11e9-9f8f-0835fe1ea054.jpg)

The other two tabs already had the counter working correctly.

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

[General] [Fixed] - Fix rerender count on RNTester blue tab
Pull Request resolved: https://github.com/facebook/react-native/pull/22876

Differential Revision: D13593262

Pulled By: PeteTheHeat

fbshipit-source-id: b45a9fcaed0f217054baa0d28fd3a2ff9a846b08
2019-01-07 15:32:01 -08:00
Ullrich Schäfer ac39795948 Fixing ActionSheetIOS position after rotation on tablet (#22738)
Summary:
There's been a bug on iOS and iPad that the position of an action sheet using UIActionController isn't updated if the position of its anchor view changes due to rotating the device. A common scenario would be, presenting an action sheet from a right bar button item. Rotating the device will most likely change the bar button's X coordinate. The action sheets arrow would still point to the old position due to how it has been implemented so far.

I used also reduced some code duplication between `-showActionSheetWithOptions` and `-showShareActionSheetWithOptions:` while at it.

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

[iOS] [Fixed] - Action Sheet position after rotation on tablet
Pull Request resolved: https://github.com/facebook/react-native/pull/22738

Differential Revision: D13582810

Pulled By: PeteTheHeat

fbshipit-source-id: a93065284b02efc41ae7378465521330a828a126
2019-01-04 13:09:00 -08:00
Rick Hanlon bd32234e6e Add flow types RNTester examples (#22829)
Summary:
This PR adds flow types for the RNTester examples, and updates all of the RNTester examples to match the flow type consistently.

Previously, there was a mix of static class definitions and whether or not pages exported examples or a component. Now we will always export the same way, enforced by flow types

Note: I also fixed most of the $FlowFixMe in changed components
Pull Request resolved: https://github.com/facebook/react-native/pull/22829

Reviewed By: cpojer

Differential Revision: D13563191

Pulled By: rickhanlonii

fbshipit-source-id: b697e3346a863d1b130881592b0522a96c202b63
2018-12-31 08:30:54 -08:00
Rick Hanlon 34ee8250b5 Add filtering to e2e tests (#22828)
Summary:
This PR adds filtering for e2e test examples using the new examples filter introduced in https://github.com/facebook/react-native/pull/22777

To do that we:
- Add a `testID` to `RNTesterExampleFilter` to select an example
- Refactor a few examples to export multiple examples for filtering
- Update all tests to filter by example title
Pull Request resolved: https://github.com/facebook/react-native/pull/22828

Reviewed By: TheSavior

Differential Revision: D13562664

Pulled By: rickhanlonii

fbshipit-source-id: efb0ca8050c1ca5c10d96bd77d35dd1143c3a3b3
2018-12-31 04:33:49 -08:00
Josh Justice 386c2ec6f0 Added filtering to RNTester example screens (#22777)
Summary:
This PR adds filtering functionality to individual example screens of RNTester. This is useful for Detox testing of RNTester, since Detox requires elements to be visible on the screen before they can be interacted with. Instead of needing to scroll an arbitrary amount, the test can enter the name of the example to be tested, just as is done on the main screen. This will lead to simpler and more reliable E2E tests for long example screens. This PR doesn't add any automated tests using the filter; those will be added in a separate PR.

This is implemented by extracting the existing filtering functionality out of `RNTesterExampleList` into a shared `RNTesterExampleFilter` component that can be used both within `RNTesterExampleList` (the main screen) and `RNTesterExampleContainer` (the example screen).

![simulator screen shot - iphone 8 - 2018-12-24 at 08 22 46](https://user-images.githubusercontent.com/15832198/50401564-4273a300-0755-11e9-9120-9bf8fbb70261.png)

![simulator screen shot - iphone 8 - 2018-12-24 at 08 22 51](https://user-images.githubusercontent.com/15832198/50401566-44d5fd00-0755-11e9-9637-6e5ddce1c476.png)

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

[General] [Added] - Added filtering to RNTester example screens
Pull Request resolved: https://github.com/facebook/react-native/pull/22777

Reviewed By: TheSavior

Differential Revision: D13561744

Pulled By: rickhanlonii

fbshipit-source-id: cb120626a8e2b8440f88b871557c0b92fbef5edc
2018-12-29 16:05:40 -08:00
Daniel Zlotin f3e5cce474 Use new JavaScriptCore from npm (#22231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/22231

- Use clang instead of the deprecated gcc
- Use libc++ instead of the deprecated gnustl
- Updated gradle and android plugin version
- Fixed missing arch in local-cli template
- `clean` task should now always succeed
- `clean` task deletes build artifacts
- No need to specify buildToolsVersion. It's derived.
- Elvis operator for more readable code
Pull Request resolved: https://github.com/facebook/react-native/pull/22263

Reviewed By: hramos

Differential Revision: D13004499

Pulled By: DanielZlotin

fbshipit-source-id: da54bb744cedb4c6f3bda590f8c25d0ad64086ef
2018-12-27 14:51:03 -08:00
Héctor Ramos 86d0611c5a test_ios → : Update iOS Snapshots, remove tvOS tests, disable failing tests (#22720)
Summary:
The following tests are disabled in this PR:

- testTimersTest is failing due to undefined this.setTimeout, probably introduced back in 61346d3. Tracking a fix in https://github.com/facebook/react-native/issues/22695
- testTheTester_ExpectError is failing as RCTTestRunner is not properly passing through the error. Tracking a fix in https://github.com/facebook/react-native/issues/22697

I've added a comment regarding testWebSocketTest and how to ensure it passes locally.

This PR also fixes all remaining snapshot tests, which were failing due to the use of iPhone XS as a iOS Simulator on Circle CI. We are using iPhone 6s for SST internally, and this allows us to be consistent.
Pull Request resolved: https://github.com/facebook/react-native/pull/22720

Differential Revision: D13532788

Pulled By: hramos

fbshipit-source-id: 75681236032839bf88180611ee68826b53cc96eb
2018-12-20 15:08:47 -08:00
Radek Czemerys d7025d2220 Remove ActivityIndicator from ScrollView snapshot tests (#22729)
Summary:
`ActivityIndicator` was not consistent when running snapshot tests so I removed it.

From diff:
![image](https://user-images.githubusercontent.com/7029942/50274094-9c662700-043c-11e9-9cac-ccc1b69695c1.png)

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

[iOS] [FIXED] - Fixed ScrollViewExample snapshot tests
Pull Request resolved: https://github.com/facebook/react-native/pull/22729

Differential Revision: D13528756

Pulled By: hramos

fbshipit-source-id: 747d91ad6a8fb8f0aa8022496bd8855a90710142
2018-12-20 10:02:34 -08:00