Commit Graph

645 Commits

Author SHA1 Message Date
Krzysztof Magiera ec5dfbf8c7 Support for Animated.multiply node
Summary:This change adds native animated support for Animated.multiply nodes.

Animated.multiply allows for defining nodes that would output a product of values of the input nodes.

**Test Plan**
Run JS tests: `npm test Libraries/Animated/src/__tests__/AnimatedNative-test.js`
Run java tests: `buck test ReactAndroid/src/test/java/com/facebook/react/animated`
Closes https://github.com/facebook/react-native/pull/7071

Differential Revision: D3197663

fb-gh-sync-id: 35f64244a2482c487a81e5e7cd08f3c0e56d9b78
fbshipit-source-id: 35f64244a2482c487a81e5e7cd08f3c0e56d9b78
2016-04-19 13:20:20 -07:00
Krzysztof Magiera b5375bdc09 Support for Animated.add
Summary:This change adds suport native animated support for Animated.add.

Animated.add lets you declare node that outputs a sum of it input nodes.

**Test Plan**
Play with the following playground app: https://gist.github.com/39de37faf07480fcd7d1
Run JS tests: `npm test Libraries/Animated/src/__tests__/AnimatedNative-test.js`
Run java tests: `buck test ReactAndroid/src/test/java/com/facebook/react/animated`
Closes https://github.com/facebook/react-native/pull/6641

Differential Revision: D3195963

fb-gh-sync-id: bb1e1a36821a0e071ad0e7d0fa99ce0d6b088b0a
fbshipit-source-id: bb1e1a36821a0e071ad0e7d0fa99ce0d6b088b0a
2016-04-19 02:58:21 -07:00
TETRA2000 978fa488ec add space between words
Summary: Closes https://github.com/facebook/react-native/pull/7045

Differential Revision: D3194558

fb-gh-sync-id: 57691d4d54bbe2bdce6abf885b6aa0f341f12644
fbshipit-source-id: 57691d4d54bbe2bdce6abf885b6aa0f341f12644
2016-04-18 18:29:23 -07:00
Micha? Gregorczyk fd35ddcc65 Store lock file in persistent directory.
Reviewed By: tadeuzagallo

Differential Revision: D3190827

fb-gh-sync-id: 42dd65bccd7c248989475f68c81061079e3601a4
fbshipit-source-id: 42dd65bccd7c248989475f68c81061079e3601a4
2016-04-18 11:45:39 -07:00
Philipp von Weitershausen 20cae51a8f Add support for receiving binary type data (ArrayBuffer)
Summary:This brings the same functionality that's already present on iOS, introduced in #4483, to Android: convert binary payloads to base64 strings and send them to JS land that way, where they'll be turned into an ArrayBuffer.

**Test Plan:** Used test server from #6889 (in `--binary` mode) to send some binary data to the Android UIExplorer example (also from #6889). Verified it's received correctly as `ArrayBuffer`.
Closes https://github.com/facebook/react-native/pull/6868

Differential Revision: D3184797

Pulled By: mkonicek

fb-gh-sync-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
fbshipit-source-id: e78c640c43b3e41a75ddba79acc04e5eaab5667d
2016-04-18 11:12:28 -07:00
Felix Oghina a3ef44b4ba throw IllegalArgumentException instead of AssertionError when JS module is not found
Reviewed By: astreet

Differential Revision: D3190875

fb-gh-sync-id: ac34872d8d36247a8bb28bdfbf985ebcdadd4e33
fbshipit-source-id: ac34872d8d36247a8bb28bdfbf985ebcdadd4e33
2016-04-18 10:01:19 -07:00
hi大头鬼hi 42cfba558f fix typo
Summary:Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

(You can skip this if you're fixing a typo or adding an app to the Showcase.)

Explain the **motivation** for making this change. What existing problem does the pull request solve?

Prefer **small pull requests**. These are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).

fix typo in comment
Closes https://github.com/facebook/react-native/pull/7027

Differential Revision: D3190693

Pulled By: dmmiller

fb-gh-sync-id: fe1eddaeb13deac6f93da7ec600c267df2599586
fbshipit-source-id: fe1eddaeb13deac6f93da7ec600c267df2599586
2016-04-18 03:55:19 -07:00
grgmo d09cd62011 Add support for ontimeout and onerror handler when using XMLHttpRequest for Android and iOS
Summary:Currently React-Native does not have `ontimeout` and `onerror` handlers for [XMLHttpRequest](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest). This is an extension to [No timeout on XMLHttpRequest](https://github.com/facebook/react-native/issues/4648).

With addition to two handlers, both Android and iOS can now handle `ontimeout` if request times out and `onerror` when there is general network error.

**Test plan**

Code has been tested on both Android and iOS with [Charles](https://www.charlesproxy.com/) by setting a breakpoint on the request which fires `ontimeout` when the request waits beyond `timeout` time and `onerror` when there is network error.

**Usage**

JavaScript -

```
var request = new XMLHttpRequest();

function onLoad() {
    console.log(request.status);
};

function onTimeout() {
    console.log('Timeout');
};

function onError() {
    console.log('General network error');
};

request.onload = onLoad;
request.ontimeout = onTimeout;
request.onerr
Closes https://github.com/facebook/react-native/pull/6841

Differential Revision: D3178859

Pulled By: lexs

fb-gh-sync-id: 30674570653e92ab5f7e74bd925dd5640fc862b6
fbshipit-source-id: 30674570653e92ab5f7e74bd925dd5640fc862b6
2016-04-15 05:17:21 -07:00
Gaëtan Renaudeau fffcb9c88a Fix ImageEditingManager when no external cache
Summary:`externalCacheDir == null && externalCacheDir == null` is obviously a typo in existing code.
Closes https://github.com/facebook/react-native/pull/6429

Differential Revision: D3184362

fb-gh-sync-id: 1cd966ed96414348c4319d44679d2c912df6cc93
fbshipit-source-id: 1cd966ed96414348c4319d44679d2c912df6cc93
2016-04-15 04:51:25 -07:00
Konstantin Raev b2ecc83ead fixed test dependency broken in D3168150
Summary:fixes Circle
Closes https://github.com/facebook/react-native/pull/6978

Differential Revision: D3179133

fb-gh-sync-id: 6558168735b4097a68bf7423a7c249a45cc2684a
fbshipit-source-id: 6558168735b4097a68bf7423a7c249a45cc2684a
2016-04-14 07:50:22 -07:00
Marcelo Gomez Rivera 865aed31e7 Introducing Espresso 2.2
Reviewed By: tdrhq

Differential Revision: D3168150

fb-gh-sync-id: e78eb8d46623ee72bb5852b8e0c4d1a53efd35e0
fbshipit-source-id: e78eb8d46623ee72bb5852b8e0c4d1a53efd35e0
2016-04-14 04:42:27 -07:00
Felix Oghina 4ddb7c59d0 move more bugreporting logic to bugreporting module
Reviewed By: astreet

Differential Revision: D3168205

fb-gh-sync-id: 3cf5691acb258f9741c61005bbec0a8507bc8162
fbshipit-source-id: 3cf5691acb258f9741c61005bbec0a8507bc8162
2016-04-14 03:18:37 -07:00
Dave Miller 89340f1620 Fix an issue with removeClippedSubviews and TextInput
Summary:This issue was found by brentvatne in https://github.com/facebook/react-native/issues/6805

The problem is an ordering issue.  The internal state of the TextView (Editor) is updated when we set the text value for a ReactTextInput. When removeClippedSubviews is false, we addView the view which attaches it to the window, and then set the text. When removeClippedSubviews is false, we defer adding the view (caching it in mAllChildren in ReactViewGroup) until we know whether the view is actually going to show.  This means when we set the initial text, that there is no window attached.  Not having a window attached means that the Editor can't display the popup for PASTE and thinks that the text is not selectable and won't respond to the long press.  To fix this we explicitly call setTextIsSelectable in onAttachedToWindow.  This will cause the underlying TextView to have the Editor update and all will be in agreement.

Note:
This also makes it really easy to expose a selectable property on both Text and TextInput at the js level now.

Reviewed By: andreicoman11

Differential Revision: D3173631

fb-gh-sync-id: a208214474a92ecc1277b3be0d38e2ef9327ea2e
fbshipit-source-id: a208214474a92ecc1277b3be0d38e2ef9327ea2e
2016-04-14 03:18:36 -07:00
Konstantin Raev f9bd789206 E2e android
Summary:- converted shell script `scripts/e2e-test.sh` into JS script to have more programming flexibility
- using appium execute 2 tests after a fresh React Native app installation: check HMR and that debugging mode does not crash the app
- made sure tests can be stable on limited CI systems and added ways to debug any problems in the future

Using appium we can now interact with Android app and test its state.
As a follow up i am planning to write a blog post on how to use appium with android and ios for e2e testing.
Closes https://github.com/facebook/react-native/pull/6840

Differential Revision: D3173635

Pulled By: mkonicek

fb-gh-sync-id: 3cf044bc9f64d1a842ae4589dd1bcab76de3d66a
fbshipit-source-id: 3cf044bc9f64d1a842ae4589dd1bcab76de3d66a
2016-04-13 08:20:05 -07:00
mattds 69534a3373 Added support for Image corner radii in Android
Summary:Split out from PR #4252 - kmagiera I've made the changes to how the radii arrays are allocated, is the approach I've taken correct? also it looks like ImageStylePropTypes are needed so I left them in for the moment. I suppose this pull request will only be valid if iOS supports image corner radii, but at least it's here if/when needed. Attached an image of how it handles the existing case:
![screen shot 2016-01-08 at 4 21 25 pm](https://cloud.githubusercontent.com/assets/1407729/12200126/d3caceac-b625-11e5-8281-06274732a281.png)
Closes https://github.com/facebook/react-native/pull/5197

Differential Revision: D3138725

Pulled By: mkonicek

fb-gh-sync-id: df772fd07fe85386ae4c681f9e79a19d2316d38b
fbshipit-source-id: df772fd07fe85386ae4c681f9e79a19d2316d38b
2016-04-13 07:42:20 -07:00
James Ide f7bcb3e98d Add a way to prefetch remote images to cache with Image.prefetch
Summary:Adds `Image.prefetch` to prefetch remote images before they are used in an actual `Image` component. This is based off of #4420 by sospartan and skevy's work.
Closes https://github.com/facebook/react-native/pull/6774

Differential Revision: D3153729

Pulled By: bestander

fb-gh-sync-id: ef61412e051a49b42ae885edce7905a8ca0da23f
fbshipit-source-id: ef61412e051a49b42ae885edce7905a8ca0da23f
2016-04-13 07:30:28 -07:00
Janic Duplessis c596f8d0ef Allow building UIExplorer with Buck
Summary:This adds a BUCK file to UIExplorer to allow building it with buck. It is based on the one in the movies app but I removed the extra deps that were not needed in both files.

Also add build version number and target sdk version in the Android manifest so Buck can use it since it was only specified in the gradle build and caused the app to run on a super old target sdk.

bestander mkonicek Would it be simple to also build the ndk part with Buck? Right now it is built with gradle and packaged after. I suppose it is already being done internally at facebook. The BUCK files for building the cpp code are already there but I couldn't figure out what was missing to make it work :(

That is pretty much the only missing part to have first class support for building RN apps with Buck in OSS. We could eventually include BUCK files with the generated project.

**Test plan (required)**
Build and run UIExplorer and Movies examples using Buck.

Edited:
```
./gradlew ReactAndroid:packageReactNdkLibsForBuck
Closes https://github.com/facebook/react-native/pull/6399

Reviewed By: mkonicek

Differential Revision: D3042355

Pulled By: bestander

fb-gh-sync-id: 74760c7ba12d35b1853d2e3706c2ba130f9eef1c
fbshipit-source-id: 74760c7ba12d35b1853d2e3706c2ba130f9eef1c
2016-04-12 13:05:24 -07:00
Felix Oghina d403ac6a31 add PhotoViewer component
Reviewed By: devknoll

Differential Revision: D3122312

fb-gh-sync-id: 2646cf79205637e347f2062c1b3639a242cded0d
fbshipit-source-id: 2646cf79205637e347f2062c1b3639a242cded0d
2016-04-12 10:38:21 -07:00
Krzysztof Magiera 21b3180a4c Java unit tests for native animated module.
Summary:This change adds some basic unit tests for native animated traversal algorithm. The following tests are added:
1) Build simple animated nodes graph, verify that frame-based animation execute updates and when it runs out of the frames we no longer schedule updates for the native view
2) Build simple animated nodes graph and start short timing animation, verify that animation JS callback gets called.

As a part of this change I'm fixing an issue that tests allowed me to discover, where I forgot to clear updates queue at the end of `runUpdates` method. It was causing the view to be updated even if there was no active animation for it (actually it was mitigated by another bug in `hasActiveAnimations` I'm fixing here too).

I'm also adding Nullable annotation in a bunch of places. To lazy to send it as a separate change - sorry.

Going forward I'm planning on adding more tests. Currently the number of nodes is pretty limited so it's difficult to construct more complex graphs, but once I land Add/Multiply
Closes https://github.com/facebook/react-native/pull/6858

Differential Revision: D3168549

Pulled By: astreet

fb-gh-sync-id: 5295c75f3c7817775b5154bb808888650ff74e12
fbshipit-source-id: 5295c75f3c7817775b5154bb808888650ff74e12
2016-04-12 10:09:30 -07:00
Micha? Gregorczyk a7c82f4564 Kick out preparsing and add a way to configure jsc context
Reviewed By: tadeuzagallo

Differential Revision: D3114935

fb-gh-sync-id: 4182d18014ea91f44679682d3b24be4a8165dc76
fbshipit-source-id: 4182d18014ea91f44679682d3b24be4a8165dc76
2016-04-12 08:02:25 -07:00
Emil Sjolander 303428ea28 Import css-layout measure mode changes from pull request #163
Reviewed By: lucasr

Differential Revision: D3167760

fb-gh-sync-id: f4f13bcb09a2d8b2db2764bd31fa8cbd8edb484b
fbshipit-source-id: f4f13bcb09a2d8b2db2764bd31fa8cbd8edb484b
2016-04-12 07:02:29 -07:00
Maxi Ferreira 2039be9d32 Added support for textDecorationLine style prop on Android
Summary:As suggested by kmagiera in #3819, I've implemented `textDecorationLine` style for Android in `ReactTextShadowNode` using span operations so we can support nested Text components.

![Demo](http://c.hlp.sc/022k2l033p0n/Image%202016-01-03%20at%2011.17.15%20PM.png)
Closes https://github.com/facebook/react-native/pull/5105

Differential Revision: D3167756

Pulled By: andreicoman11

fb-gh-sync-id: 122701a53d50f47f89b49e1f343c97db5fa2323d
fbshipit-source-id: 122701a53d50f47f89b49e1f343c97db5fa2323d
2016-04-12 03:37:34 -07:00
Scott Foggo 24f03af0c3 Implement clipping rectangle for ReactNativeART
Reviewed By: sebmarkbage, taomin

Differential Revision: D3140869

fb-gh-sync-id: 0da27705c4cfca7a1fcae12eed11a7335a62631f
fbshipit-source-id: 0da27705c4cfca7a1fcae12eed11a7335a62631f
2016-04-11 19:19:17 -07:00
Steven Luscher c18210ba74 Use Android's default network throttling algorithm when streaming responses (or flush when chunks crest 8K).
Reviewed By: lexs

Differential Revision: D3157879

fb-gh-sync-id: ab5fe320288af01fc789ba26db6fd3b7c58fb31d
fbshipit-source-id: ab5fe320288af01fc789ba26db6fd3b7c58fb31d
2016-04-11 16:44:20 -07:00
Andy Street c24fae9544 Cache batched bridge methods and provide better error messages when calling functions without bridge config
Summary: Maybe a slight perf improvement. Also helps get rid of the 'ReferenceError: __fbBatchedBridge' error in favor of a more explicit "you're calling JS functions before the bundle is loaded"

Differential Revision: D3142966

fb-gh-sync-id: 6a50efe7d1634248107c8c95a3e014cb263a9ca5
fbshipit-source-id: 6a50efe7d1634248107c8c95a3e014cb263a9ca5
2016-04-11 15:05:21 -07:00
Emil Sjolander 8ef551174b backout update of css-layout. breaks ios <9
Reviewed By: javache

Differential Revision: D3164127

fb-gh-sync-id: 3926430f365711466ba93cd2eb7c91f31ef0c7f8
fbshipit-source-id: 3926430f365711466ba93cd2eb7c91f31ef0c7f8
2016-04-11 14:56:21 -07:00
Ahmed El-Helw c91591b987 Cleanup React comments and unused imports
Summary: Fix some typos in comments.

Reviewed By: astreet

Differential Revision: D3161278

fb-gh-sync-id: 11612487aa5fee5463942d3467f46633ccd9db15
fbshipit-source-id: 11612487aa5fee5463942d3467f46633ccd9db15
2016-04-11 14:11:50 -07:00
zxcpoiu 914f33c53a make protocols argument work fixes #5810 fix #6137
Summary:Hey there and thanks for submitting a pull request! Please have a look at the following checklist so that others have enough information to review your pull request:

**motivation**

WebSocket spec supports [Sec-WebSocket-Protocol](https://tools.ietf.org/html/rfc6455#section-11.3.4) as a standard way for negotiate a sub protocol between client and server.

* ios WebSocket implementation supports it.
* android WebSocket implementation ignores this header, leave a comment syas: "OkHttp will overrides it", so it did not implement.
* after some test, OkHttp doesn't override the header we add.

**Test plan (required)**

1. run and react-native app on android
2. at the main page, invoke: `var ws = new WebSocket('ws://example.ws-service.fakedomain.com', 'my-sub-protocol');`
3. see the header if it send the correct header, ex, use ngrep: `sudo ngrep -t -Wbyline -deth0 host example.ws-service.fakedomain.com and port 80`

you should see the WebSocket initial GET handshake includes header:
`Sec-WebSocke
Closes https://github.com/facebook/react-native/pull/6223

Differential Revision: D3162822

fb-gh-sync-id: a00f1c0f3e1c24ad6aa234329cbb2abad7664264
fbshipit-source-id: a00f1c0f3e1c24ad6aa234329cbb2abad7664264
2016-04-11 09:32:28 -07:00
Lucas Feliciano f94abd3c01 Set WebChromeClient to the android's WebView during instantiation
Summary:Motivation: #6405

Follow up of: #6603

satya164
Closes https://github.com/facebook/react-native/pull/6880

Differential Revision: D3162425

fb-gh-sync-id: 1a91893c66da5550f47e8b801b3bd6079b4f5861
fbshipit-source-id: 1a91893c66da5550f47e8b801b3bd6079b4f5861
2016-04-11 06:04:26 -07:00
Alexander Blom 2c0f345cb8 treact-native] Export signature of methods
Summary: Creates a signature of the method that can be used for efficiently doing things based on the argument types.

Reviewed By: astreet

Differential Revision: D3147620

fb-gh-sync-id: da1419b96d61f5fc40861625d816c18b3c19b425
fbshipit-source-id: da1419b96d61f5fc40861625d816c18b3c19b425
2016-04-08 17:40:35 -07:00
Alexander Blom 9ad88c868f Enable creating ReadableNativeMap outside of OnLoad
Reviewed By: mhorowitz

Differential Revision: D3147576

fb-gh-sync-id: ddf3a4332cca69838d7bcce82b71bea5591b6395
fbshipit-source-id: ddf3a4332cca69838d7bcce82b71bea5591b6395
2016-04-08 17:40:35 -07:00
Micha? Gregorczyk 7b3a371ef1 Using folly object in configureForAndroid()'
Reviewed By: mhahnenberg, dcaspi

Differential Revision: D3006980

fb-gh-sync-id: ad97fa2b7c122f48dc4d72068df84cfa63f8dbd9
fbshipit-source-id: ad97fa2b7c122f48dc4d72068df84cfa63f8dbd9
2016-04-08 06:20:34 -07:00
Felix Oghina 6038040f8e expose pageMargin prop on ViewPagerAndroid
Reviewed By: sahrens

Differential Revision: D3145366

fb-gh-sync-id: 6412d51a698b2c932c915e405e4bbc35e96060dc
fbshipit-source-id: 6412d51a698b2c932c915e405e4bbc35e96060dc
2016-04-07 18:09:29 -07:00
digeff 4c8a9f0d00 Added support for JavaScript third-party debuggers
Summary:* Add ability to configure the app that should open when starting debugging

axemclion discussed this feature with tadeuzagallo and martinbigio on: https://github.com/facebook/react-native/issues/5051
Closes https://github.com/facebook/react-native/pull/5683

Reviewed By: martinbigio

Differential Revision: D2971497

Pulled By: mkonicek

fb-gh-sync-id: 91c3ce68feed989658124bb96cb61d03dd032599
fbshipit-source-id: 91c3ce68feed989658124bb96cb61d03dd032599
2016-04-07 13:15:58 -07:00
Andy Street b9396cd744 Synchronize ProgressBar constructors
Summary: If a ProgressBar is created on the shadow thread (for measurement) at the same time one is created on the UI thread, we hit a race condition which sometimes results in a crash (##java.lang.NullPointerException: Null pointer exception during instruction 'invoke-static {v5}, android.animation.AnimatorSet$Node android.animation.AnimatorSet$Node.access$200(android.animation.AnimatorSet$Node) // method@153'##). This diff synchronizes the ctors.

Reviewed By: foghina

Differential Revision: D3151037

fb-gh-sync-id: 8ed96d6debdc1a5fa2f9bd037bfb75def25be3e8
fbshipit-source-id: 8ed96d6debdc1a5fa2f9bd037bfb75def25be3e8
2016-04-07 13:12:21 -07:00
Martin Konicek e4865a5609 Clean up after removing the Stetho dependency from open source React Native
Summary:We've removed the Stetho dependency from open source React Native, removing stuff that's not needed anymore.
Closes https://github.com/facebook/react-native/pull/6864

Differential Revision: D3150758

Pulled By: mkonicek

fb-gh-sync-id: fad4408df16f52914357dc474eb1d8d965cfac60
fbshipit-source-id: fad4408df16f52914357dc474eb1d8d965cfac60
2016-04-07 10:18:22 -07:00
Emil Sjolander 3b5a49bfb6 Import css-layout measure mode changes from pull request #163
Reviewed By: astreet

Differential Revision: D3059432

fb-gh-sync-id: 56cc13ffbc4805aa0789df62a04e19f23a438bd3
fbshipit-source-id: 56cc13ffbc4805aa0789df62a04e19f23a438bd3
2016-04-07 10:16:30 -07:00
Andrei Coman 2d0051f213 Fix logging reported by RUN_JS_BUNDLE
Reviewed By: mhorowitz

Differential Revision: D3144775

fb-gh-sync-id: 9d6aa66a74437c90faa09dc53d8772be79a4c65e
fbshipit-source-id: 9d6aa66a74437c90faa09dc53d8772be79a4c65e
2016-04-07 04:22:19 -07:00
Nick 2a03182b1c CHORE - Remove Trailing Spaces
Summary:Remove Trailing Spaces.

Why:
Sometimes there are conflicts with trailing spaces
Saves space
Those whose tools automatically delete them will have their pr watered down with trailing space removal
Closes https://github.com/facebook/react-native/pull/6787

Differential Revision: D3144704

fb-gh-sync-id: d8a62f115a3f8a8a49d5b07f56c540a02af38cf8
fbshipit-source-id: d8a62f115a3f8a8a49d5b07f56c540a02af38cf8
2016-04-06 09:21:53 -07:00
Martin Konicek a461d25601 Open source Android slider
Reviewed By: bestander

Differential Revision: D3127200

fb-gh-sync-id: d3d51b312c2e32cc7a0f4c0bc084139343e97c3e
fbshipit-source-id: d3d51b312c2e32cc7a0f4c0bc084139343e97c3e
2016-04-06 04:50:57 -07:00
Adam Miskiewicz e27a27b517 Fix Promise argument assertion to take into account executorTokenOffset.
Summary:In the code that extracts and validates arguments from a `ReactMethod`, there is verification that if a method contains a Promise in it's list of arguments that it must come last. This fix makes sure that the `executorTokenOffset` is taken into account when asserting that condition.
Closes https://github.com/facebook/react-native/pull/6633

Differential Revision: D3143207

fb-gh-sync-id: ae9ebd9d829f88993f9951c4cb2452b3f7618476
fbshipit-source-id: ae9ebd9d829f88993f9951c4cb2452b3f7618476
2016-04-05 19:57:28 -07:00
Andy Street c0108a269d Use an atomic bool to track bridge destruction
Summary: We're seeing intermittent crashes in ~Bridge() where m_destroyed isn't set. This could be because the value of m_destroyed is cached for the destructing thread and doesn't see that the value got updated. Using an atomic boolean should fix this.

Reviewed By: mhorowitz

Differential Revision: D3126701

fb-gh-sync-id: 5887edef748cc05971765943de80187ab7fd8ede
fbshipit-source-id: 5887edef748cc05971765943de80187ab7fd8ede
2016-04-05 13:24:31 -07:00
Janic Duplessis 114dde99ce Fix TouchableNativeFeedback state propagating to children
Summary:For some reason Android propagates the the pressed state to all of the ViewGroup's children when calling `setPressed`. This caused the issue described in #3952. Luckily we can override the `dispatchSetPressed` method of ViewGroup to prevent it from doing so.

Had to dig in the Android source a bit to find this one, here's the relevant pieces :
https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/View.java#L7883
https://github.com/android/platform_frameworks_base/blob/master/core/java/android/view/ViewGroup.java#L3722

**Test plan (required)**
Reproduced the bug using [this gist](https://gist.github.com/janicduplessis/9f1d42c670aefd660afb4c96e8bb6a4f) in UIExplorer. Touching the parent should not trigger the ripple on the children.

I also made sure all the touchable still work properly.

Fixes #3952
Closes https://github.com/facebook/react-native/pull/6783

Differential Revision: D3133407

fb-gh-sync-id: 317e55de2652ea185a1082cd96b8fe3a8b807962
fbshipit-source-id: 317e55de2652ea185a1082cd96b8fe3a8b807962
2016-04-04 08:48:22 -07:00
Pieter De Baets d95757037a Update css-layout from github
Summary:Update to latest master version of css-layout. Update integration in RCTShadow(Root)View to match.

This solves the issue with items not strechting vertically in column layouts (https://github.com/facebook/css-layout/issues/127)

Reviewed By: vjeux

Differential Revision: D3120699

fb-gh-sync-id: beba162e1255d3527e1160e9bd414a712cb10713
fbshipit-source-id: beba162e1255d3527e1160e9bd414a712cb10713
2016-04-04 04:10:24 -07:00
VonD 351c97ec37 adding missing string case in ReadableNativeMap to HashMap
Summary:about #6639
Closes https://github.com/facebook/react-native/pull/6762

Differential Revision: D3126541

fb-gh-sync-id: f895e6d3b4c0abec41b56a031828763a4e8e210f
fbshipit-source-id: f895e6d3b4c0abec41b56a031828763a4e8e210f
2016-04-01 09:12:20 -07:00
Dmitry Gladkov b5106a8fca Implement TextInput.selectTextOnFocus for Android
Summary:Uses native Android `TextView.setSelectAllOnFocus` method. Triggers TextInput's `onSelectionChanged` event on focus as expected.
Closes https://github.com/facebook/react-native/pull/6654

Differential Revision: D3126354

Pulled By: mkonicek

fb-gh-sync-id: faa64314c0ddc87296277ccd707f18effef8f407
fbshipit-source-id: faa64314c0ddc87296277ccd707f18effef8f407
2016-04-01 07:16:20 -07:00
Atticus White dc3836a9d3 Add toArrayList and toHashMap methods for ReadableArray and ReadableMap. Fixes #4655
Summary:Context #4658

I kept the original commit and author.

cc mkonicek
Closes https://github.com/facebook/react-native/pull/6639

Differential Revision: D3126336

Pulled By: mkonicek

fb-gh-sync-id: 5ae7b37f0eb1db355bb87076d621a405ff9c23c5
fbshipit-source-id: 5ae7b37f0eb1db355bb87076d621a405ff9c23c5
2016-04-01 07:02:25 -07:00
Andy Street 6a3b334139 Start creating views before end of batch
Summary:Creating views shouldn't have side effects so we can start doing them before the end of a batch. In order to limit the effect on framerate, we stop executing these create view operations after we've passed halfway through the frame.

Note, this doesn't seem to work yet for nodes: I'll address that in a followup diff.

Reviewed By: lexs

Differential Revision: D3120631

fb-gh-sync-id: 981540fac5a7499158146adb72c1be21fd0b5702
fbshipit-source-id: 981540fac5a7499158146adb72c1be21fd0b5702
2016-03-31 09:21:25 -07:00
Martin Konicek ae3dad86c5 Revert "Android support for perspective transform"
Summary:This reverts "Android support for perspective transform": 3e760f48c5, PR https://github.com/facebook/react-native/pull/6159, D3053532.

It broke negative scale transforms: https://github.com/facebook/react-native/issues/6622

Reviewed By: bestander

Differential Revision: D3120627

fb-gh-sync-id: 727528d39c049180fe4862d006f2089c997afd45
fbshipit-source-id: 727528d39c049180fe4862d006f2089c997afd45
2016-03-31 06:41:30 -07:00
Nathan Spaun 4498bc8197 Add prop to FbReactScrollView to fill the rest of the background to avoid overdraw
Reviewed By: foghina

Differential Revision: D3079290

fb-gh-sync-id: b824d235ca34f8e0408f5f40e6b73e028006ac9f
fbshipit-source-id: b824d235ca34f8e0408f5f40e6b73e028006ac9f
2016-03-30 18:06:19 -07:00