Commit Graph

821 Commits

Author SHA1 Message Date
Siqi Liu ee0333c65d Enable Logging information from redboxes in Android Ads Manager to Scuba
Reviewed By: mkonicek

Differential Revision: D3433990

fbshipit-source-id: 54fa60fa746c9d0d834f86b7dd2e3ef18a694a32
2016-06-18 12:58:29 -07:00
Tim Yung a2f78825f2 RN: Increase Time Drift Threshold
Summary: Increases time drift threshold to reduce chance of false positives. Also, tweaked the error message to contain slightly more information.

Reviewed By: frantic

Differential Revision: D3450852

fbshipit-source-id: 7fbf3eb25543977f9767c7a57277db336006bd12
2016-06-17 16:28:27 -07:00
Ahmed El-Helw 99e2a67b39 Don't close reference to image in getSize
Summary:
ImageLoader improperly closes both the image reference
(which is shared) and the DataSource (which is shared, and should only be
handled by BaseDataSubscriber when it is correct).

Reviewed By: plamenko

Differential Revision: D3441752

fbshipit-source-id: bfb3d0281cd9ae789cba4079978ef46d295ac8f5
2016-06-17 11:58:38 -07:00
Felix Oghina bf79352e4f fix dialogmodule crashing with no fragment manager in onHostResume
Summary: This can happen now, we shouldn't crash. `showAlert` will crash instead if JS tries to call it.

Reviewed By: lexs

Differential Revision: D3450018

fbshipit-source-id: bbc062b357315f26ee98ed3b3a59db71dc5fc74a
2016-06-17 07:58:24 -07:00
Felix Oghina 49f20f4154 Add ReactInstanceHolder
Reviewed By: astreet

Differential Revision: D3328342

fbshipit-source-id: af4e825d0b7c2d3d4490094a939e97cc527dd242
2016-06-17 04:13:29 -07:00
Felix Oghina d78602b8cd show soft errors as redboxes in dev
Summary: These are generally things sent to console.error

Reviewed By: lexs

Differential Revision: D3445393

fbshipit-source-id: e76e82dbaa32dc71100ae6b1d721f80007d8cd3a
2016-06-17 03:28:39 -07:00
Andrei Coman 477cc52945 Use fresco cache to show low res image if available
Summary:
ImageView will now interrogate fresco cache for images that can be shown before
the one with the best fitting size is downloaded. Cache interrogation does not
take into account that the images from cache are smaller or bigger than the best
fit. Most of the cases, the smaller one will be displayed. It is also possible
that a bigger image is available for being displayed, but ideally we'd still
want the best fit to be shown, so as to not decode and resize images that are
too big.
I've added a ImageSource class to simplify things. This makes it easier to
lazy-parse the Uri's when necessary, and cache data related to that uri
and wether the image is local. This also gets rid of the Map, which makes
parsing the source a bit more elegant.

Reviewed By: foghina

Differential Revision: D3392751

fbshipit-source-id: f6b803fb7ae2aa1c787aa51f66297a14903e4040
2016-06-17 03:28:38 -07:00
Andrei Coman 675c55e8ad Update fresco from 0.10.0 to 0.11.0
Summary: Updating to new release from 16.06.2016.

Reviewed By: bestander

Differential Revision: D3444598

fbshipit-source-id: d8c14b3d088bab6c08effcdacde9bf2eccb20d68
2016-06-17 02:58:24 -07:00
Dave Miller 1f8cd9ddbc Add support placeholder in AdsManager for proper deep linking
Reviewed By: foghina

Differential Revision: D3444315

fbshipit-source-id: 894b7e7899bd59ac87b175cd2767afe5a741487f
2016-06-16 09:43:35 -07:00
Konstantin Raev 192f6ddf82 another fix to OSS tests
Summary: Closes https://github.com/facebook/react-native/pull/8151

Differential Revision: D3444091

fbshipit-source-id: a8a43a56332c66b0af84695aa54fb1e4c5d659f6
2016-06-16 04:14:28 -07:00
Konstantin Raev e514ff5ad4 Fixes Buck file in trunk
Summary: Closes https://github.com/facebook/react-native/pull/8150

Differential Revision: D3443995

fbshipit-source-id: 328cb9f9ef84dd2ddc0460940f54af2dbd807523
2016-06-16 02:43:51 -07:00
Krishna Monian 12a87b6674 Fix lost callbacks due to time drift between server and emulator
Reviewed By: yungsters

Differential Revision: D3434921

fbshipit-source-id: ec82374a8ed322d99beadac78a415f952ceb3ec8
2016-06-15 13:28:29 -07:00
Ahmed El-Helw f236667a17 Fix touch inspector when using Nodes
Reviewed By: astreet

Differential Revision: D3433927

fbshipit-source-id: 5b17a16191f167db8f4491da37a1735e725e99b8
2016-06-15 12:28:28 -07:00
Pieter De Baets 1579a72ca6 Implement {min,max}{Width,Height} in ReactAndroid
Reviewed By: astreet

Differential Revision: D3424294

fbshipit-source-id: 03ae663927600bff025cd953a9b6b221c8dd9f23
2016-06-15 09:58:53 -07:00
Pieter De Baets 0a9cc99a4f Update css-layout sync scripts
Reviewed By: emilsjolander

Differential Revision: D3424265

fbshipit-source-id: b1a765bbe11f776e418ae8b01c5c2a292f590a6b
2016-06-15 09:58:52 -07:00
Andrei Coman b7352b4667 Open source permissions
Summary:
This moves into open source the PermissionsModule and the activity and listener interfaces
necessary to make permissions work.
It also moves the PermissionsExample into the UIExplorer. In order to make this
work, the device has to be Android M and above, and the target sdk of the app has to be 23+, so I changed the uiexplorer manifest to
target that API. This has the unfortunate consequence that people testing on
devices with API 23+ will have to enable the `draw over other apps` setting that
react needs for RedBoxing. The app will automatically send the user to that screen,
so enabling the setting and resuming the app should be trivial.
For testing, try requesting permission for a permission that is currently
revoked. If a permission is granted, it can be revoked via adb (`adb shell pm
revoke com.your.app android.permission.PERMISSION_NAME`), and then requested.

Reviewed By: bestander

Differential Revision: D3431324

fbshipit-source-id: 8cbaea676d2b5727cb5191cdb77a02e213bf9ba3
2016-06-15 09:43:58 -07:00
Konstantin Raev 58881fc57f <Replace this line with a title. Use 1 line only, 67 chars or less>
Reviewed By: matryoshcow

Differential Revision: D3432084

fbshipit-source-id: fa94b1aca40c931cc273a5561adf37f458aaa0ff
2016-06-15 03:14:20 -07:00
Chris Hopman d344963123 Invert native dependency of new bridge -> old bridge
Reviewed By: mhorowitz

Differential Revision: D3409230

fbshipit-source-id: 541309ec953843477197e5a2b13730b8a38f608d
2016-06-13 18:43:42 -07:00
Andrei Coman 617a38d984 Support multi sources for images
Summary:
This adds support for specifying multiple sources for an image component, so that native can choose the best one based on the flexbox-computed size of the image.
The API is as follows: the image component receives in the `source` prop an array of objects of the type `{uri, width, height}`. On the native side, the native component will wait for the layout pass to receive the width and height of the image, and then parse the array to find the best fitting one. For now, this does not support local resources, but it will be added soon.
To see how this works and play with it, there's an example called `MultipleSourcesExample` under `ImageExample` In UIExplorer.

Reviewed By: foghina

Differential Revision: D3364550

fbshipit-source-id: 66c5aeb2794f2ffeff8da39a9c0b95155fb2d41f
2016-06-13 14:13:25 -07:00
Emil Sjolander 8afcaa36e6 Import latest css-layout
Summary:
Import latest master from css-layout.

This includes the following pull requests:
https://github.com/facebook/css-layout/pull/192
https://github.com/facebook/css-layout/pull/193
https://github.com/facebook/css-layout/pull/195
https://github.com/facebook/css-layout/pull/196

Reviewed By: javache

Differential Revision: D3411535

fbshipit-source-id: 95bee9bd0282f98f6fafa15335b910b644395ad3
2016-06-13 07:58:35 -07:00
Alexander Blom 933e17949b Run init on normal thread priority
Summary:
The default priority for AsyncTask is THREAD_PRIORITY_BACKGROUND which puts the thread in a limited cgroup that can utilize ~10% CPU time. Because the whole TTI depends on this task we should run it on a normal priority.

The priority will be reset for the nest task and this has been true since donut: https://github.com/android/platform_frameworks_base/blob/donut-release/core/java/android/os/AsyncTask.java

Reviewed By: astreet

Differential Revision: D3417232

fbshipit-source-id: e1e35f82b35b31ff7ebf4fc59509ca2df21e2bdd
2016-06-13 05:58:22 -07:00
Guillermo Orellana 87d65847e3 Typo in ReactContext.java
Summary:
Just a tiny typo
Closes https://github.com/facebook/react-native/pull/8066

Differential Revision: D3422819

fbshipit-source-id: f992054e712d081b1cd48c4db0d38cf6517043a7
2016-06-11 16:43:24 -07:00
Jing Chen 31e090c9ab Change loading dialog for JS in Android to use AlertDialog instead
Reviewed By: yungsters

Differential Revision: D3418605

fbshipit-source-id: 202b4872c6636a51c615ad82b444261acf83f396
2016-06-10 12:28:26 -07:00
Sokovikov c03b166854 line break mode for ios
Summary:
What do you think is ```lineBreakMode``` a good name? For android it is called ```ellipsize```.

<img src="https://cloud.githubusercontent.com/assets/1488195/15628555/7372f8d0-250c-11e6-8919-722f28a38d60.png"" width="300" />
Closes https://github.com/facebook/react-native/pull/7819

Differential Revision: D3417256

fbshipit-source-id: 189441a23ff554bf7f6d67fa8510959351e9e5cc
2016-06-10 04:28:37 -07:00
Fabian Eichinger d43e0db81e Add support for reverse flex directions on Android and iOS
Summary:
This PR adds support for both 'row-reverse' and 'column-reverse' for Android and iOS and is based on the changes in #6683 that looked like it's all but abandoned.
It also adds examples for the new directions to the "Layout - Flexbox" section of UIExplorer as well as some rad new colors to the section to make the difference between "row-reverse" and "flex-end" more apparent.

**Test plan (required)**
Tested inside of UIExplorer

Android
<img width="571" alt="screen shot 2016-06-05 at 7 42 14 pm" src="https://cloud.githubusercontent.com/assets/4332237/15807140/cf8e05de-2b55-11e6-9366-a2e3194cabf8.png">

iOS
<img width="578" alt="screen shot 2016-06-05 at 7 41 35 pm" src="https://cloud.githubusercontent.com/assets/4332237/15807143/dee8e9b8-2b55-11e6-8777-c30329fa54e8.png">
Closes https://github.com/facebook/react-native/pull/7938

Differential Revision: D3417182

fbshipit-source-id: e8c9f5976ca95b2d2069a5b31a20f6d6309eb3cc
2016-06-10 03:28:45 -07:00
Dave Miller b457af625a Add custom error reporter in Groups
Differential Revision: D3413351

fbshipit-source-id: 580782aac2966a07a3dbce9e9268392739e4803b
2016-06-09 14:13:27 -07:00
Ovidiu Viorel Iepure 7a635b2cd2 Open sourced CatalystTouchBubblingTestCase test for RN Android
Reviewed By: bestander

Differential Revision: D3411681

fbshipit-source-id: 7b511a0447c61d94cbd43b7983fb3f96c2fcbddf
2016-06-09 11:29:12 -07:00
Ovidiu Viorel Iepure a7e6eea919 Open sourced CatalystSubviewsClippingTestCase test for RN Android
Reviewed By: bestander

Differential Revision: D3411402

fbshipit-source-id: c4f51f0366c30815a3a409ee13b61900d882fcc9
2016-06-09 11:29:12 -07:00
Dave Miller 9bdb63c234 Add ability to dump a Native View Hierarchy
Differential Revision: D3411095

fbshipit-source-id: cc7e26eea63b0146250177c2e1b780ecc03da02f
2016-06-09 10:14:06 -07:00
Andy Street eef03fd552 Fix bug where UIOperations aren't executed after hosting Activity is paused.
Summary:
When we hit the back button and unmount the ReactRootView, we tell JS to unmount the application root node, which causes JS to asynchronously come back and tell the UIManager to drop the corresponding root view.

This issue was that by the time JS gets back to us, we likely will have already paused the UIManager frame callback which means the view unmounting never actually happens: it just gets stuck in the queue.

The solution is to immediately execute batches when they are enqueued when the frame callback isn't running.

Reviewed By: lexs

Differential Revision: D3398958

fbshipit-source-id: 0de81061a97a119be4cb0b12d6f01c1cec8e8171
2016-06-09 08:43:47 -07:00
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