Commit Graph

791 Commits

Author SHA1 Message Date
Olivier Notteghem bb9ed2d24c Fix potential NPE is layout animation deletion code
Reviewed By: dmmiller

Differential Revision: D3403930

fbshipit-source-id: 20067542d06396997719bbe963ce87403fae5ac3
2016-06-08 08:13:32 -07:00
Olivier Notteghem c0ac0d5071 Fix missing check causing layout some animation code to be executed when it shouldn't
Reviewed By: dmmiller

Differential Revision: D3404149

fbshipit-source-id: 8663325fd3a4b9257d84075e22bd9cc59d6414ac
2016-06-08 08:13:32 -07:00
Konstantin Raev 525d35ba67 Reverted commit D3400379
Reviewed By: mhorowitz

Differential Revision: D3400379

fbshipit-source-id: b7e733e74bb0f4fbd597fd073826c399ece2c47f
2016-06-08 02:58:36 -07:00
Kyle Corbitt 7357ccc370 Allow CameraRoll to export videos
Summary:
This PR adds the ability to export videos to the CameraRoll on both Android and iOS (previously only photos were possible, at least on iOS). The API has changed as follows:

```
// old
saveImageWithTag(tag: string): Promise<string>

// new
saveToCameraRoll(tag: string, type?: 'photo' | 'video'): Promise<string>
```

if no `type` parameter is passed, `video` is inferred if the tag ends with ".mov" or ".mp4", otherwise `photo` is assumed.

I've left in the `saveImageWithTag` method for now with a deprecation warning.

**Test plan (required)**

I created the following very simple app to test exporting photos and videos to the CameraRoll, and ran it on both iOS and Android. The functionality works as intended on both platforms.

```js
// index.js

/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  CameraRoll,
} from 'react-native';
import FS fro
Closes https://github.com/facebook/react-native/pull/7988

Differential Revision: D3401251

Pulled By: nicklockwood

fbshipit-source-id: af3fc24e6fa5b84ac377e9173f3709c6f9795f20
2016-06-07 16:43:42 -07:00
Janic Duplessis d4e7c8a055 Properly validate layout animation config
Summary:
The type key for a layout animation config must be supplied otherwise the app crashes (on Android). I added a isRequired check in JS as well as an explicit exception in java otherwise it crashed at a very hard to debug place. The crash happens when passing null to `Animation.setInterpolator` so this makes sure it never happens.

**Test plan (required)**

Tested that the error is caught properly in JS when passing an invalid animation config like

```
LayoutAnimation.configureNext({
  duration: 250,
   update: { type: undefined }, // or LayoutAnimation.Types.easeInEastOut in my case haha :)
});
```

Also tested the java exception.
Closes https://github.com/facebook/react-native/pull/7958

Differential Revision: D3401760

Pulled By: nicklockwood

fbshipit-source-id: 83c019d863c2b2294405b60e87297c562add0f49
2016-06-07 16:28:29 -07:00
Chris Hopman 0e50373b60 Invert native dependency of new bridge -> old bridge
Reviewed By: mhorowitz

Differential Revision: D3400379

fbshipit-source-id: d641846261977b4f77c2d215bef94e8e676e2c02
2016-06-07 16:28:29 -07:00
Chris Hopman 5b871ad9d7 Begin inverting dependency between new+old bridge
Reviewed By: mhorowitz

Differential Revision: D3306510

fbshipit-source-id: 312a498a4461e980f1f749fe7858a13be14dfa2f
2016-06-07 13:28:21 -07:00
Olivier Notteghem 837aafde72 Fix touch handling crash that can when Modal is displayed as a result of touch handling code
Reviewed By: dmmiller

Differential Revision: D3399325

fbshipit-source-id: 0a0bb179ef524bf35cc137d94ea3d5680a68aab2
2016-06-07 11:58:38 -07:00
Alex Kotliarskyi f3fab5184e Remove SourceCode.getScriptText
Summary:
After cleaning up JS SourceMap code, these native methods are not needed anymore.

On iOS it saves another 30+ Mb during development.

Reviewed By: javache, astreet

Differential Revision: D3348975

fbshipit-source-id: a68ae9b00b4dbaa374b421029ae676fc69ae5a75
2016-06-07 11:13:32 -07:00
Siqi Liu a7404713a4 Followup for Intercepting all redboxes in Android Ads Manager
Reviewed By: mkonicek

Differential Revision: D3398979

fbshipit-source-id: 9ea9ba6d45daf01284717a9eb889c16607109683
2016-06-07 10:58:23 -07:00
Siqi Liu 4b19db3159 Remove the Profiler Option in RN Android Dev Menu
Summary:
Remove the "Start/Stop" option in RN Android dev menu.

mkonicek talked to Mike Armstrong who originally added this option and he said Traceview didn't end up being used much and Systrace was the preferred way to do profiling, which is used from the command line.

Haven't removed all the codes behind because there are some codes in JNI, including native methods in C++ through the ReactBridge.

Dev menu before:
{F61306550}

Dev menu after:
{F61306553}

Reviewed By: mkonicek

Differential Revision: D3391092

fbshipit-source-id: c400d8bb3c196afa9ef53cda13476e1fec6c2384
2016-06-07 09:58:22 -07:00
Saurabh Aggarwal 7e7abff55a 4.5 / N [RNFeed] Isolate reusable util methods out of NetworkingModule
Reviewed By: lexs

Differential Revision: D3394808

fbshipit-source-id: 19c916be693377651f2c8e21eb3dd490ec68f74c
2016-06-07 09:43:31 -07:00
Andy Street 49a5fe493e Fix deletion layout animations to work with custom view managers
Summary: D3352450 didn't handle the case where removeClippedSubviews is on and the indices within the parent view don't match the indices JS is working on

Differential Revision: D3398675

fbshipit-source-id: 0a1b9cf41b02f71f6585db92474e4699b944d273
2016-06-07 09:43:31 -07:00
Siqi Liu 4959b21290 Enable Double R shortcut to reload JS when redbox is shown on Android
Summary: Make "double tap R" shortcut enabled when redbox is shown in RN Android, consistent with that in iOS.

Reviewed By: mkonicek

Differential Revision: D3390132

fbshipit-source-id: 48fc40c2ba371a34abcac42a077359d11e907dfc
2016-06-07 06:58:29 -07:00
Konstantin Raev d836e8c0ef Reverted commit D3374937
Reviewed By: mhorowitz

Differential Revision: D3374937

fbshipit-source-id: e794fb9b8cb1194133da64dcb38861477406c307
2016-06-07 02:58:33 -07:00
Sreejumon 7742900931 Fix the WebSocket sendBinary error
Summary:
Fixing the WebSocket SendBinary method error. This is a regression caused during recent change.
Closes https://github.com/facebook/react-native/pull/7956

Differential Revision: D3398065

fbshipit-source-id: 5d56eba807b59d1f3265cba5d5f501d610afebf2
2016-06-07 01:58:24 -07:00
Chris Hopman bf010a4c17 Invert native dependency of new bridge -> old bridge
Reviewed By: mhorowitz

Differential Revision: D3374937

fbshipit-source-id: 58b082bba727e33a3b08361be3630d669fc8dc5b
2016-06-06 16:13:41 -07:00
Dave Miller f3507f99f1 Remove support for password property and only use secureTextEntry
Summary:
Reduce the public surface area of TextInput.  It only exposes a secureTextEntry property, but on Android was also accepting password as a prop.
This removes that.

Reviewed By: javache

Differential Revision: D3392223

fbshipit-source-id: 67c36fbe16fe493e2841d5d9deb78e3be2209ebd
2016-06-06 10:13:28 -07:00
Konstantin Raev 2aad61650e Open sourced more instrumentation tests #1
Reviewed By: avaly

Differential Revision: D3366104

fbshipit-source-id: 1c77b29e28726a6a105317d9f6944bbf78b707d7
2016-06-06 04:28:44 -07:00
Andrei Coman 4acf009284 Pass resource drawable id to constructor directly
Summary:
Instead of passing the helper to each method that uses it, just pass it
to the image constructor.

Reviewed By: dmmiller

Differential Revision: D3364532

fbshipit-source-id: 949bdbf951875c9b8cd05d028a2c329e12d72042
2016-06-06 04:28:43 -07:00
Ricky Reusser c36430a0d6 Hook up Android intent to Linking.js #7079
Summary:
Fixed #7118 by rreusser
Closes https://github.com/facebook/react-native/pull/7940

Differential Revision: D3391586

fbshipit-source-id: f7e572a91347fb0629602374cb6944eabf5b0e8f
2016-06-05 18:58:24 -07:00
tantan e63ea3acc4 add progressListener for android when using FormData to upload files
Summary:
When using FormData upload images or files, in Android version, network module cannot send an event for showing progress.
This PR will solve this issue.
I changed example in XHRExample for Android, you can see uploading progress in warning yellow bar.
Closes https://github.com/facebook/react-native/pull/7256

Differential Revision: D3390087

fbshipit-source-id: 7f3e53c80072fff397afd6f5fe17bf0f2ecd83b2
2016-06-04 08:43:21 -07:00
Siqi Liu 5aa0e098b4 Intercepting all redboxes in Android Ads Manager
Summary:
Implement a handler to allow intercepting all RN redboxes in Android, including exceptions in both JS and Java.

The handler is not open sourced, so there is only an open-source interface called **RedBoxHandler** in //fbandroid/java/com/facebook/catalyst/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/devsupport//, meantime there is an internal class called **FBRedBoxHandler**, which implements **RedBoxHandler** and is located in //fbandroid/java/com/facebook/fbreact/redboxhandler//, actually handles the exception information.

The code structure is as follows:
  - **AdsManagerActivity** has a member variable of **FBRedBoxHandler**.
  - **AdsManagerActivity** passes this handler all the way down to the **DevSupportManagerImpl**, through** ReactInstanceManager**, **ReactInstanceManagerImpl**, **DevSupportManagerFactory**.
  - **DevSupportManagerImpl** intercepts the exceptions just before showing the redboxes, like this:

              mRedBoxDialog.setExceptionDetails(message, stack);
              mRedBoxDialog.setErrorCookie(errorCookie);
              if (mRedBoxHandler != null) {
                mRedBoxHandler.handleRedbox(message, stack);
              }
              mRedBoxDialog.show();

By now, the internal class just prints information for each redbox to logcat, including exception message and stack trace.

Reviewed By: mkonicek

Differential Revision: D3369064

fbshipit-source-id: 199012c4b6ecf4b3d3aff51a26c9c9901847b6fc
2016-06-03 17:13:23 -07:00
Andrei Coman 5de1151bdd Fix NPE in cancelling network calls
Summary:
Issue reported here
https://github.com/facebook/react-native/issues/7755#issuecomment-222950463

Converting int to Integer explicitly and not cancelling the call more than once
should fix it.

Reviewed By: bestander

Differential Revision: D3371238

fbshipit-source-id: cb00663b4ca19a788bd27b971b6447cc0788a818
2016-06-03 03:13:30 -07:00
Ahmed El-Helw 68c11e55ee Promote grandchildren of certain views are Views
Reviewed By: astreet

Differential Revision: D3161232

fbshipit-source-id: ea313d513bd7567e32f18765d479ba0538f2efbf
2016-06-02 14:13:28 -07:00
Chris Hopman 9a6e61426d Fixes to NativeMap/Array
Reviewed By: mhorowitz

Differential Revision: D3376409

fbshipit-source-id: 4efd1a8567358baf2634008af77f7e743ace849e
2016-06-02 13:43:47 -07:00
Konstantin Raev 75c6bf5723 Open sourced more instrumentation tests
Reviewed By: avaly

Differential Revision: D3373926

fbshipit-source-id: da520b61c5e74d515b853cf1d9548ed3e671aa50
2016-06-02 07:13:38 -07:00
Chris Hopman 886a558f75 Extract all NativeArray/NativeMap from OnLoad.cpp
Summary: These will, eventually, need to be moved to the new bridge and so must become standalone things. For *NativeArray, this is almost just moving them out into their own .h/.cpp files. The *NativeMaps are updated to be hybrids instead of countables (in addition to getting their own .h/.cpp).

Reviewed By: mhorowitz

Differential Revision: D3325169

fbshipit-source-id: 40cfcab92b3fb2310bcd4de8f39e82f85d404abd
2016-06-01 16:28:32 -07:00
Konstantin Raev 88190f7e9d A few instrumentation tests were fixed and are supposed to be more stable
Reviewed By: avaly

Differential Revision: D3354433

fbshipit-source-id: 4e3f00fae94e5cb910e188b0e3fbe204361a4d01
2016-06-01 08:13:27 -07:00
Martin Konicek 4391ef218b Tweak dev menu label: Stop Remote JS Debugging
Summary:
"Stop" is a bit clearer - the debugger is started and stopped, rather than enabled / disabled. Small difference :)

In contrast, live reloading and hot reloading are enabled and disabled.

satya164 pointed it out in [this comment](31eea8eee3 (commitcomment-17682563)) and I agree.

**Test Plan**

Ran the UIExplorer:

<img width="432" alt="screen shot 2016-05-31 at 11 11 28 pm" src="https://cloud.githubusercontent.com/assets/346214/15692439/473c26b6-2786-11e6-969a-d494067cbc3b.png">

On Android the change is kind of obvious :)
Closes https://github.com/facebook/react-native/pull/7861

Differential Revision: D3371207

Pulled By: mkonicek

fbshipit-source-id: 769288f687a98d62cf5c1a22cbc857b7dc4acf00
2016-06-01 04:13:35 -07:00
Siqi Liu 31eea8eee3 Android Dev Menu Options Reorder and Relabel
Summary:
Just rename and rearrange the dev menu options in Android, so as to be consistent with those in iOS.

{F61192593}                          {F61192595}

{F61192594}                          {F61192597}

There are other issues to solve on the inspector and profiling in Android, so I just ignore them for now.

Reviewed By: mkonicek

Differential Revision: D3361415

fbshipit-source-id: ffa823a0c54a27f7918e4e43ecea3c845d2a2f90
2016-05-31 07:58:28 -07:00
Emil Sjolander c2c370c886 import css-layout-185
Reviewed By: lucasr

Differential Revision: D3312496

fbshipit-source-id: 259b6db2fc0166696eb171dc6e2974c81ec2133f
2016-05-31 04:13:32 -07:00
Andrei Coman 7914d3334d Correctly cancel network calls in catalyst instance destroy
Reviewed By: bestander

Differential Revision: D3358458

fbshipit-source-id: 69ee83ba33b02d21310030a457c6378f67e168f9
2016-05-30 05:58:23 -07:00
Chris Hopman 5e8f1716fc Build new bridge with gradle
Reviewed By: bestander

Differential Revision: D3324351

fbshipit-source-id: 41fa18a23c8661440a7deff244c93278f418e1d9
2016-05-27 16:13:37 -07:00
Siqi Liu 60e0d2c676 Make "Debug JS" dev menu option persist across app restarts on RN Android
Summary:
1. Make "Remote JS Debug" and "Start/Stop Profile" options persist across app restarts.
2. Check and confirm:
       - All options in the Android dev menu are persisted now.
       - The behavior is the same on Android and iOS now.

Reviewed By: mkonicek

Differential Revision: D3340097

fbshipit-source-id: 4087b6605031c650e164282244cedb006f8f6fd3
2016-05-27 09:58:27 -07:00
Siqi Liu 26d3af3421 Redbox: skip column number if it is 0 in Android.
Summary:
As for symbolicated stack trace in the red box in Android, make column number not shown if it's zero.

Format Before:
{F61180667}

Format After:
{F61180666}

Reviewed By: mkonicek

Differential Revision: D3358317

fbshipit-source-id: 87981e678e22ab9f483727002175c8835941ceee
2016-05-27 07:58:22 -07:00
Aaron Chiu c82856fb7a unbreak RN startup
Reviewed By: lexs

Differential Revision: D3352709

fbshipit-source-id: 56cdec2dee46ab1f011bed9aadd14ea464ec4163
2016-05-27 05:13:23 -07:00
Dave Miller a0562c7ccf Fix Modal when the Activity is paused or resumed
Summary:
When the activity hosting a Modal goes away, we should dismiss the dialog from the stack and then reconstitute it when the activity comes back.  This means that if an activity is paused because another activity is placed on top of it but our ui operation was delayed, it will not blow up finding no window since it is gone.

Also fixes a place where we should remove a listener for lifecycle events which we were not doing.

Reviewed By: halfjuice

Differential Revision: D3357286

fbshipit-source-id: c5c6dd8e5ef299762ed9aa15a6910ce9c0b111dc
2016-05-26 20:13:33 -07:00
Janic Duplessis 26e8426248 Cross platform ActivityIndicator
Summary:
The API for `ActivityIndiatorIOS` and `ProgressBarAndroid` is very similar and can be merged in a cross platform component that displays a circular indeterminate loading indicator.

This deprecates `ActivityIndiatorIOS` and non-horizontal `ProgressBarAndroid` in favor of this new component.

**Test plan (required)**

Tested with the ActivityIndicator example in UIExplorer on android and ios. Also made sure that `ActivityIndicatorIOS` still works and displays a deprecation warning. Also tested that `ProgressBarAndroid` with `indeterminate == true` and `styleAttr != 'Horizontal'` displays a deprecation warning.
Closes https://github.com/facebook/react-native/pull/6897

Differential Revision: D3351607

Pulled By: dmmiller

fbshipit-source-id: b107ce99d966359003e8b3118cd97b90fa1d3d7d
2016-05-26 13:58:17 -07:00
Konstantin Raev 7ca8e0e8b1 Stabilized TestIdTestApp integration test
Summary:
- TestIdTestModule instrumentation tests is responsible for too many occasional crashes, e.g. https://circleci.com/gh/facebook/react-native/7054.
This should fix the problem (will monitor over next week)

- Made file naming more consistent

- 5 retries don't make e2e tests more stable, reduced back to 3 but I need to investigate how to make it more reliable
Closes https://github.com/facebook/react-native/pull/7784

Differential Revision: D3354444

fbshipit-source-id: d058362edbec09522a4828998e01988a82a74487
2016-05-26 13:43:29 -07:00
Charles Dick f948662013 Drop JSC code on background
Reviewed By: lexs

Differential Revision: D3311037

fbshipit-source-id: e46559108c51f1cd163ed5c557d23c21f696ef88
2016-05-26 11:13:42 -07:00
Emil Sjolander 0bbfe79623 Set a size of the root view before running test
Reviewed By: astreet

Differential Revision: D3352500

fbshipit-source-id: e6bb81601448a08fa216865b5b92f8739646fc05
2016-05-26 06:58:24 -07:00
Alexander Blom 45636ed7f4 Add more tracing to startup
Reviewed By: astreet

Differential Revision: D3352462

fbshipit-source-id: 9f10bb40eef9a262ae3ea6f8b2cd27b5774fc4da
2016-05-26 06:28:25 -07:00
Janic Duplessis 0fb5ccf6af Add support for delete animation in LayoutAnimation on Android
Summary:
Android follow up to #6779

**Test plan**
Tested add/removing views in the UIExample explorer with and without setting a LayoutAnimation. Tested that user interation during the animation is properly disabled.

![layout-anim-2](https://cloud.githubusercontent.com/assets/2677334/14760549/d60ebe2a-0914-11e6-8f17-ea04d8bf813b.gif)
Closes https://github.com/facebook/react-native/pull/7171

Differential Revision: D3352450

Pulled By: astreet

fbshipit-source-id: 233efa041626eb26d99511d12a924e54a10f96cc
2016-05-26 05:28:26 -07:00
Chris Hopman 3b3b46d86e Move new bridge java stuff to OSS
Reviewed By: mhorowitz

Differential Revision: D3300152

fbshipit-source-id: 9a76b10579bbfc5bde3a5094b99b64c38f4c1da9
2016-05-25 17:58:43 -07:00
Olivier Notteghem 80741a170a Prevent race condition leading to deadlock when destroying activity w/ catalyst instance.
Reviewed By: astreet

Differential Revision: D3345567

fbshipit-source-id: 8ac550456c99549a6c4bc2d2cdb19334f9e85c71
2016-05-25 11:13:19 -07:00
Chris Hopman a8acf8a5ce Move cxx module support into oss
Reviewed By: mhorowitz

Differential Revision: D3319751

fbshipit-source-id: 87f91a541cfbbe45bd8561d94f269ba976a9f702
2016-05-24 19:28:59 -07:00
Ahmed El-Helw caa2baee9d Fix leak in Nodes due to removeClippedSubviews
Reviewed By: astreet

Differential Revision: D3337513

fbshipit-source-id: b7b798f024488cd19cdcf93aee7f99eed512dd6a
2016-05-24 14:58:23 -07:00
Andrei Coman 1926fdf156 Inline images package name fix
Summary: Renaming package name from textfrescosupport to text.frescosupport

Reviewed By: dmmiller

Differential Revision: D3340363

fbshipit-source-id: 6c73d9e05751ccba299489fbc13447dc85a9c0df
2016-05-24 12:43:30 -07:00
Janic Duplessis a71a9efe96 Remove deprecated PullToRefreshViewAndroid and onRefreshStart / endRefreshing
Summary:
Removes the deprecated APIs that were replaced by `RefreshControl`. Those API have been deprecated for a while already so I think it's fine to remove them at this point. Also ported the `SwipeRefreshLayoutTestModule` test to use `RefreshControl` instead of `PullToRefreshViewAndroid`.

**Test plan (required)**

Made sure no references are left in the codebase to `PullToRefreshViewAndroid`, `onRefreshStart` and `endRefreshing`.
Tested that `ScrollView` examples in UIExplorer still work properly.
Check that the `SwipeRefreshLayoutTestModule` passes on CI.
Closes https://github.com/facebook/react-native/pull/7447

Reviewed By: mkonicek

Differential Revision: D3292391

Pulled By: bestander

fbshipit-source-id: 27eb2443861e04a9f7319586ce2ada381b714d47
2016-05-24 03:28:25 -07:00