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
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
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
Summary: These are generally things sent to console.error
Reviewed By: lexs
Differential Revision: D3445393
fbshipit-source-id: e76e82dbaa32dc71100ae6b1d721f80007d8cd3a
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
Summary: Updating to new release from 16.06.2016.
Reviewed By: bestander
Differential Revision: D3444598
fbshipit-source-id: d8c14b3d088bab6c08effcdacde9bf2eccb20d68
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
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
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
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
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
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
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
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
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
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
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
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
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