Commit Graph

979 Commits

Author SHA1 Message Date
Alexey Lang 42a5568419 Change API for using custom JSC
Reviewed By: javache

Differential Revision: D3392219

fbshipit-source-id: ae372dfe9ceab7f7c2da69c731515a05eb3b020a
2016-06-06 11:13:22 -07:00
Nick Lockwood 44c9cf3a91 Refactored subview management
Reviewed By: javache

Differential Revision: D3392214

fbshipit-source-id: 6f16841df5cf866dda5ac27dd244e266ec85a86e
2016-06-06 10:28:33 -07:00
Siqi Liu 61046c3195 Fix the bug where key shortcuts are invoked in TextInputs in iOS
Summary:
This is a followup for "Add Shortcut "Double R" to Reload JS in iOS".
Please see the previous two revisions:[[ D3371536 | D3371536 ]], [[ D3343907 | D3343907 ]]

In previous revisions, we only tested with the iOS UIExplorer app, without testing in the iOS Catalyst app, where the key shortcuts we added are always invoked in TextInput components. It's due to a bug with the `UIApplicationDelegate`. Just fix this bug in this revision and successfully tested in the Catalyst app.

Reviewed By: mkonicek

Differential Revision: D3391045

fbshipit-source-id: 8b76fbfe7592218b02dd22502d25eebbc59f3cbc
2016-06-06 09:43:17 -07:00
Nick Lockwood 72b363d7fc Replaced isMainThread checks with a proper test for main queue
Summary:
As per https://twitter.com/olebegemann/status/738656134731599872, our use of "main thread" to mean "main queue" seems to be unsafe.

This diff replaces the `NSThread.isMainQueue` checks with dispatch_get_specific(), which is the recommended approach.

I've also replaced all use of "MainThread" terminology with "MainQueue", and taken the opportunity to deprecate the "sync" param of `RCTExecuteOnMainThread()`, which, while we do still use it in a few places, is incredibly unsafe and shouldn't be encouraged.

Reviewed By: javache

Differential Revision: D3384910

fbshipit-source-id: ea7c216013372267b82eb25a38db5eb4cd46a089
2016-06-06 07:58:36 -07:00
Nick Lockwood 1048e5d344 Fixed removeClippedSubviews
Summary:
The `removeClippedSubviews` feature works by umounting views from the hierarchy if they move outside the bounds of their parent.

This was previously restricted to clipping views which had `overflow: hidden`, since we cannot efficiently check whether the subviews of a view go outside its bounds, and so clipping a view that has potentially overflowing children becomes an expensive recursive operation.

The problem with this is that `overflow: visible` is the default, and it's not well documented nor easy to tell that `removeClippedSubviews` has been set up correctly (i.e. with all children having `overflow: hidden`).

When I checked, I found that `removeClippedSubviews` was not working on any of the examples in UIExplorer, nor in several of our internal apps, because the views inside the ListView has `overflow: visible`. This was probably caused by an infra change at some point, but I'm not sure how long it's been broken.

It's vanishingly unlikely that anyone would ever deliberately want subviews to overflow their bounds in this scenario, so I've updated the logic to simply ignore the `overflow` property and assume that views should be clipped if you are using the `removeClippedSubviews` property on the parent.

Cons / Breaking changes: in some rare circumstances, a view might get clipped prematurely if its parent is outside the scrollview bounds, but it itself is inside. This doesn't occur in practice in any of our products, and could be worked around with additional wrapper views if it did.

Pros: removeClippedSubviews is now much easier to use, and much more likely to work as intended, so most list-based apps should see a performance improvement.

Reviewed By: javache

Differential Revision: D3385316

fbshipit-source-id: 1c0064a4c21340a971ba80d794062a356ae6cfb3
2016-06-06 07:58:35 -07:00
Nick Lockwood 329c716897 Fixed bug where layoutSubviews was called continuously for scrollview
Summary:
RCTScrollView was calling `dockClosestSectionHeader` in `reactBridgeDidFinishTransaction`, which triggers a layout update. The reason for this was in case the `stickyHeaderIndexes` property was updated, which would require the headers to be adjusted.

However, doing this in `reactBridgeDidFinishTransaction` had the affect of causing `layoutSubviews` to be called repeatedly every frame even if nothing had changed and the scrollview wasn't moving, which was especially expensive when combined with the `removeClippedSubviews` logic, that loops through every view to calculate if it needs to be clipped.

This fix moves the `dockClosestSectionHeader` call into `didUpdateProps`, and checks that the stickyHeaderIndexes have actually changed before calling it.

Reviewed By: javache

Differential Revision: D3387607

fbshipit-source-id: c71e00c6fac48337a63d7fee7c7c23e016acf24e
2016-06-06 05:28:31 -07:00
Gerald Monaco 5961764668 Recenter RCTScrollView when width or height are equal
Reviewed By: sahrens

Differential Revision: D3375944

fbshipit-source-id: 74f1c1f98364604a9be786ff233f230799d9b75d
2016-06-03 16:58:26 -07:00
Nathan Azaria 724134746b Changed RCTTextView to check for failed focus
Reviewed By: nicklockwood

Differential Revision: D3378236

fbshipit-source-id: b4a33f7808ffe116b51631cde35f5cd0042caee9
2016-06-03 16:13:19 -07:00
Adam Comella ee8496f364 iOS: Support HTTP headers for source prop on <Image> components
Summary:
Allows developers to specify headers to include in the HTTP request
when fetching a remote image. For example, one might leverage this
when fetching an image from an endpoint that requires authentication:

```
<Image
  style={styles.logo}
  source={{
    uri: 'http://facebook.github.io/react/img/logo_og.png',
    headers: {
      Authorization: 'someAuthToken'
    }
  }}
/>
```

Note that the header values must be strings.

Works on iOS and Android.

**Test plan (required)**

- Ran a small example like the one above on iOS and Android and ensured the headers were sent to the server.
- Ran a small example to ensure that \<Image\> components without headers still work.
- Currently using this code in our app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/7338

Reviewed By: javache

Differential Revision: D3371458

Pulled By: nicklockwood

fbshipit-source-id: cdb24fe2572c3ae3ba82c86ad383af6d85157e20
2016-06-01 10:43:28 -07:00
Siqi Liu 0cc0aaecbb Followup for Add Shortcut "Double R" to Reload JS in iOS
Summary: Change nit codes in comments.

Reviewed By: mkonicek

Differential Revision: D3371536

fbshipit-source-id: 4133af88568f15410ff90c945695f82ffd94eb95
2016-06-01 08:43:29 -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 2d32a6df27 Add Shortcut "Double R" to Reload JS in iOS
Summary:
Enable double tap R on iOS, consistent with Android.
Keep the existing Cmd+R on iOS because people are already used to it.
Make Cmd+Key and Double Key both invalid when focus is in textview or textfield.
Also try to add Cmd+R in Android, but seems no good.

Reviewed By: nicklockwood

Differential Revision: D3343907

fbshipit-source-id: 68f7e3b0393711c137e1d932db33e1b6a2a19e09
2016-06-01 03:43:27 -07:00
Alexey Lang 6321ad486b Fix OSS tests
Reviewed By: bestander

Differential Revision: D3368572

fbshipit-source-id: 11326c21767bf7851d06f019c6aa2f8c16408d74
2016-05-31 16:43:27 -07:00
Alexey Lang abe0b349bc Implement RCTJSCWrapper
Reviewed By: tadeuzagallo

Differential Revision: D3258713

fbshipit-source-id: 418eb9d350bf3541c976b631bd9799a1c578f5e5
2016-05-31 12:58:25 -07:00
Adam Comella 486dbe4e8f iOS: Enable views to be nested within <Text>
Summary:
Previously, only Text and Image could be nested within Text. Now, any
view can be nested within Text. One restriction of this feature is
that developers must give inline views a width and a height via
the style prop.

Previously, inline Images were supported by using iOS's built-in support
for rendering images with an NSAttributedString via NSTextAttachment.
However, NSAttributedString doesn't support rendering arbitrary views.

This change adds support for nesting views within Text by creating one
NSTextAttachment per inline view. The NSTextAttachments act as placeholders.
They are set to be the size of the corresponding view. After the text is
laid out, we query the text system to find out where it has positioned each
NSTextAttachment. We then position the views to be at those locations.

This commit also contains a change in `RCTShadowText.m`
`_setParagraphStyleOnAttributedString:heightOfTallestSubview:`. It now only sets
`lineHeight`, `textAlign`, and `writingDirection` when they've actua
Closes https://github.com/facebook/react-native/pull/7304

Reviewed By: javache

Differential Revision: D3365373

Pulled By: nicklockwood

fbshipit-source-id: 66d149eb80c5c6725311e1e46d7323eec086ce64
2016-05-31 10:28:25 -07:00
Nick Lockwood 5136d95f2c Reduce boxing overhead of arrays in uiBlockWithLayoutUpdateForRootView
Summary: The view update cycle in UIManager was relying on a bunch of boolean values boxes as NSNumbers in parallel arrays. This diff packs those values into a struct, which is more efficient and easier to maintain.

Reviewed By: javache

Differential Revision: D3365346

fbshipit-source-id: d9cbf2865421f76772c1761b13992d40ec3675f0
2016-05-31 08:43:24 -07:00
Li Jie eb69d036d5 Log image url when image size doesn't match.
Summary:
Sometimes I got error message about image size doesn't match, but I don't know which image is wrong.

Before:
<img width="376" alt="2016-05-31 11 03 58" src="https://cloud.githubusercontent.com/assets/8459/15662148/aa4e1d7e-2720-11e6-863a-aa7dd662460b.png">

After this PR:
<img width="377" alt="2016-05-31 10 59 21" src="https://cloud.githubusercontent.com/assets/8459/15662153/b5b1fd2a-2720-11e6-9807-c7e4aa314c4b.png">

**Test plan (required)**

```
<Image source={require('image!test')} />
```
And don't add this image into project, it would report errors when run it.
Closes https://github.com/facebook/react-native/pull/7840

Differential Revision: D3365467

Pulled By: nicklockwood

fbshipit-source-id: de3d5989ef0a3c443cce557901486c4770d4e906
2016-05-31 05:28:31 -07:00
Nathan Azaria 3ccd99fb53 Added RCTBundleURLProvider
Reviewed By: javache

Differential Revision: D3352568

fbshipit-source-id: fbba6771a1c581e2676bd0f81d3da62dbf21916b
2016-05-31 04:59:56 -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
Blair Vanderhoof 573dc858ad Reverted commit D3253073
Summary: The view update cycle in UIManager was relying on a bunch of boolean values boxes as NSNumbers in parallel arrays. This diff packs those values into a struct, which is more efficient and easier to maintain.

Reviewed By: javache

Differential Revision: D3253073

fbshipit-source-id: abbf2a910aeb536050c3a83513fb542962ce71a5
2016-05-28 12:13:28 -07:00
Alex Kotliarskyi 0656b96354 Redbox: skip column number if it is 0
Summary:
Format before:
```
methodName
file_name.js @ 42:0
```

Format after
```
methodName
file_name.js:42
```

Reviewed By: javache

Differential Revision: D3350320

fbshipit-source-id: 456deb66bd34deb24bf8b8aa958883bdf4f99129
2016-05-27 11:43:34 -07:00
Nick Lockwood a4b5f1bf10 Test perf effect of reverting D3269333
Reviewed By: javache

Differential Revision: D3346235

fbshipit-source-id: 2008f8fb9df5d61da59bb0067b25acd5a71f256f
2016-05-27 09:58:28 -07:00
Nick Lockwood fc14f85f73 Reduce boxing overhead of arrays in uiBlockWithLayoutUpdateForRootView
Summary: The view update cycle in UIManager was relying on a bunch of boolean values boxes as NSNumbers in parallel arrays. This diff packs those values into a struct, which is more efficient and easier to maintain.

Reviewed By: javache

Differential Revision: D3253073

fbshipit-source-id: 3e1520c27b88bc1b44ddffcaae3218d7681b2cd2
2016-05-27 04:58:29 -07:00
Pieter De Baets 4b0f0881eb Make RCTTiming module lazy
Reviewed By: nicklockwood

Differential Revision: D3346796

fbshipit-source-id: e7fa02f47bfca44272857864472c3f8ef59f56e5
2016-05-25 10:43:27 -07:00
Anoop Chaurasiya 1586a32fa7 add support to provide fallback-sourceURL: in case primary-sourceURL fails to load
Reviewed By: javache

Differential Revision: D3339692

fbshipit-source-id: 93fa1821bf4abca878832d4f75c6b9968d8d0460
2016-05-25 10:28:27 -07:00
Nick Lockwood b71db11554 Update RCTNetworking, RCTNetInfo and RCTLocationManager to use new events system
Summary: Updated networking and geolocation to use the new events system.

Reviewed By: bestander

Differential Revision: D3346129

fbshipit-source-id: 957716e54d7af8c4a6783f684098e92e92f19654
2016-05-25 04:28:36 -07:00
Konstantin Raev 2de0323182 Reverted commit D3339945
Summary: Updated networking and geolocation to use the new events system.

Reviewed By: javache

Differential Revision: D3339945

fbshipit-source-id: 01d307cf8a0aea3a404c87c6205132c42290abb1
2016-05-24 12:43:30 -07:00
Nick Lockwood 3f08fe4b7f Update RCTNetworking, RCTNetInfo and RCTLocationManager to use new events system
Summary: Updated networking and geolocation to use the new events system.

Reviewed By: javache

Differential Revision: D3339945

fbshipit-source-id: f1332fb2aab8560e4783739e223c1f31d583cfcf
2016-05-24 10:29:00 -07:00
Martin Kralik 2c8abebccc improved description for RCTTouchEvent
Summary: This will make error messages more helpful.

Reviewed By: javache

Differential Revision: D3292400

fbshipit-source-id: d1e0bb24593058b75422824c0d351ede1320029e
2016-05-24 05:13:27 -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
Urban Cvek ddc374fac8 Add renderAsOriginal to selectedIcon
Summary:
Hey,
I've created a PR a few weeks ago #7264. It got merged in and then I received some emails and got mentioned in a few issues that it doesn't use renderAsOriginal prop on selectedIcon. Instead the app would use tint color.

The problem can be seen here #7467.

I've now added a method in TabBarItem that sets selectedIcon to renderAsOriginal if the prop is set.
I added a "relay" icon to UIExplorer TabBarIOS example so you can see the item is now rendered in color as the image supplied.

Oh and also should this PR be made from master. Had to work on this issue from 0.27 because the master was broken for me.
Closes https://github.com/facebook/react-native/pull/7709

Differential Revision: D3339795

fbshipit-source-id: d8d4699bb617ecae8996a6627f3774c6473c19e0
2016-05-24 01:58:23 -07:00
Anoop Chaurasiya be38ae1169 provide verbose error-message on bundle-load-failure
Reviewed By: fkgozali

Differential Revision: D3329107

fbshipit-source-id: 33c02ff066ec9ad415a5cc4639347ebdef67c604
2016-05-23 11:13:24 -07:00
Nick Lockwood d9737571c4 Updated AppState module to use new emitter system
Summary: AppState now subclasses NativeEventEmitter instead of using global RCTDeviceEventEmitter.

Reviewed By: javache

Differential Revision: D3310488

fbshipit-source-id: f0116599223f4411307385c0dab683659d8d63b6
2016-05-23 09:13:37 -07:00
Nick Lockwood c87b737ca1 Fixed tests
Reviewed By: bestander

Differential Revision: D3334669

fbshipit-source-id: ba0ae2ec5ea06c27d40ceed3ca8bf7a9da27dda9
2016-05-23 08:28:28 -07:00
David Aurelio 4c76e5476c remove premature optimizations
Reviewed By: javache

Differential Revision: D3325805

fbshipit-source-id: cdf8f4f3744d70fd37e8fa35c44ca8110ea4395a
2016-05-23 07:28:25 -07:00
Mike Grabowski a45d025385 TabBarIOS itemPositioning - Fixes #4136
Summary:
The default itemPositioning is `automatic` (referred to `auto` in this pull request) - you can check its behaviour in the docs attached.

Sometimes that value has to be modified to have more predictable appearance as described in #4136.
Closes https://github.com/facebook/react-native/pull/7217

Differential Revision: D3220958

Pulled By: mkonicek

fbshipit-source-id: d4bf648b16e71825cd31c06d6b6396479767d19f
2016-05-20 17:28:50 -07:00
Mike Grabowski 4446e31b5d ActionSheetIOS - support share sheet on modals
Summary:
Fixes #6913 - follow up to this commit 43dcdaffe2 to support this in the 2nd method as well.
Closes https://github.com/facebook/react-native/pull/7244

Differential Revision: D3330843

fbshipit-source-id: 0923440550a7635202158b4afaba87e12f1c1d54
2016-05-20 17:13:21 -07:00
Chris Evans 5047f6f54c Add Copy Stack button to Red Box (iOS)
Summary:
Added a button to the iOS Red Box to enable copying of the error and stack trace to the clipboard to make it easier to paste the error and stack into bug reports or other text windows. Clicking the Copy button on the bottom of the RedBox screen or pressing Cmd-Option-C keyboard shortcut in the simulator will copy the full stack trace as text to the iOS pasteboard and when in the simulator you can then hit Command-C to get the text to the Mac's pasteboard for pasting in your favorite reporting/tracking app.

No tests for this change - I don't see any tests to extend for the RCTRedBoxWindow class. No impact on APIs or core React Native functionality. I validated it by running test React Native apps with red box errors and both hitting the copy button or using the command key shortcut in the emulator to get the text of the stack to the iOS pasteboard.
![redboxcopybutton](https://cloud.githubusercontent.com/assets/7173455/15258992/7b1e849c-1903-11e6-8813-6e853db5db54.png)
Closes https://github.com/facebook/react-native/pull/7557

Differential Revision: D3311743

Pulled By: javache

fbshipit-source-id: 76d1ac8ab93f40696c6a2369dae2245194db095a
2016-05-17 12:28:21 -07:00
Adam Comella fe5c0d2d06 iOS: Enable views to be nested within <Text>
Summary:
Previously, only Text and Image could be nested within Text. Now, any
view can be nested within Text. One restriction of this feature is
that developers must give inline views a width and a height via
the style prop.

Previously, inline Images were supported by using iOS's built-in support
for rendering images with an NSAttributedString via NSTextAttachment.
However, NSAttributedString doesn't support rendering arbitrary views.

This change adds support for nesting views within Text by creating one
NSTextAttachment per inline view. The NSTextAttachments act as placeholders.
They are set to be the size of the corresponding view. After the text is
laid out, we query the text system to find out where it has positioned each
NSTextAttachment. We then position the views to be at those locations.

This commit also contains a change in `RCTShadowText.m`
`_setParagraphStyleOnAttributedString:heightOfTallestSubview:`. It now only sets
`lineHeight`, `textAlign`, and `writingDirection` when they've actua
Closes https://github.com/facebook/react-native/pull/7304

Differential Revision: D3269333

Pulled By: nicklockwood

fbshipit-source-id: 2b59f1c5445a4012f9c29df9f10f5010060ea517
2016-05-17 10:43:30 -07:00
Nick Lockwood d2934e58b3 Expose UIManager queue via a static function to prevent race conditions
Summary: Having UI modules access the shadowQueue via UIManager.methodQueue is fragile and leads to race conditions in startup, sometimes resulting in an error where the methodQueue is set twice, or not at all.

Reviewed By: javache

Differential Revision: D3304890

fbshipit-source-id: 7198d28314dbec798877fcaaf17ae017d50157e9
2016-05-16 08:13:21 -07:00
David Aurelio 2f41c56f59 change to fixed size offset table + indexed lookup
Reviewed By: javache

Differential Revision: D3281989

fbshipit-source-id: 52db9f441dd46024eafac46ae8d32b26640cad71
2016-05-16 04:43:24 -07:00
Nick Lockwood 516bf7bd94 Fixed NativeEventListener deregistration
Summary:
The `EmitterSubscription.remove()` method was previously calling `this.subscriber.removeSubscription(this)` directly, bypassing the mechanism in `NativeEventEmitter` that keeps track of the number of subscriptions.

This meant that native event modules (subclasses of `RCTEventEmitter`) would keep sending events even after all the listeners had been removed. This wasn't a huge overhead, since these modules are singletons and only send one message over the bridge per event, regardless of the number of listeners, but it's still undesirable.

This fixes the problem by routing the `EmitterSubscription.remove()` method through the `EventEmitter` so that `NativeEventEmitter` can apply the additional native calls.

I've also improved the architecture so that each `NativeEventEmitter` uses its own `EventEmitter`, but they currently all still share the same `EventSubscriptionVendor` so that legacy code which registers events via `RCTDeviceEventEmitter` still works.

Reviewed By: vjeux

Differential Revision: D3292361

fbshipit-source-id: d60e881d50351523d2112473703bea826641cdef
2016-05-16 04:13:56 -07:00
Marc Horowitz 3a2d024514 avoid waiting on the main thread just to send a notification
Reviewed By: nicklockwood

Differential Revision: D3234837

fbshipit-source-id: 587a68df7d08999d4357583ba3160b315bd85239
2016-05-13 17:29:00 -07:00
Marc Horowitz 267264f1ec Add a bunch more systrace logging
Reviewed By: tadeuzagallo

Differential Revision: D3234831

fbshipit-source-id: 177f9b987e938c59d50fc07bce01fb5c912652e7
2016-05-13 17:29:00 -07:00
Marc Horowitz 86e18ace94 make RCTFBSystrace actually work
Reviewed By: tadeuzagallo

Differential Revision: D3234824

fbshipit-source-id: 9f2f7efd6877fe7b9096dedecb311d226eae7bc8
2016-05-13 17:29:00 -07:00
Marc Horowitz 418e16f711 Support flow events in RCTProfile
Summary: Add begin/end async flow to the callbacks for external profiling

Reviewed By: tadeuzagallo

Differential Revision: D3234812

fbshipit-source-id: cdbe46883fd566d50a04de9ad67f947876a78a0c
2016-05-13 17:29:00 -07:00
Adam Comella 03edc75b56 iOS: Provide correct animation function for hiding keyboard
Summary:
Currently, `7 << 16` is used as the animation easing function for both the showing and hiding of the keyboard.

Instead, `7 << 16` should be used for showing the keyboard and `6 << 16` for hiding the keyboard.

For details, see: http://stackoverflow.com/questions/18870447/how-to-use-the-default-ios7-uianimation-curve/19439283#19439283

**Test plan (required)**

Testing animating the position of a view to coordinate with the keyboard hiding and showing and it looks good.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/7372

Differential Revision: D3300464

Pulled By: nicklockwood

fbshipit-source-id: 3fdc161f709de11deb7de511aad28767f5d80bd6
2016-05-13 15:43:22 -07:00
Arno Fortelny cac5ce3b93 RefreshControl on initial render will not beginRefresh when refreshing state is false
Summary:
There's an edge case in the `RefreshControl` which causes it to show as refreshing when the state is set to false. When the component is initialized with `refreshing` set to `true` on initial render but set to `false` before `layoutSubviews` is called, it will call `beginRefresh` and ignore its state. That's because `layoutSubviews` never checks if `_currentRefreshingState` is in fact still `true`, it merely assumes it is.

This is fixed by simply doing a check for `_currentRefreshingState` before entering `beginRefresh` from `layoutSubviews`.
Closes https://github.com/facebook/react-native/pull/7556

Differential Revision: D3300124

fbshipit-source-id: d1dce8612e2c03b1f14284d513803d00af4b5c8a
2016-05-13 14:43:26 -07:00
Reem Helou a53d0f99dd Add an array of scrollviewlisteners in RCTScrollableProtocol
Summary: We are deprecating nativeScrollDelegate property in RCTScrollableProtocol in favor of a scrollListener api. To register/unregister from scroll events use the addScrollListener/removeScrollListener methods

Reviewed By: javache

Differential Revision: D3278218

fbshipit-source-id: 54373cae8e9f8efa7cdbd40c51bcf21d368acf75
2016-05-12 12:17:20 -07:00
Nick Lockwood 2525feb37f Updated Websocket to use new event system
Reviewed By: javache

Differential Revision: D3292473

fbshipit-source-id: f9a9e0a1b5a12f7fa8b36ebdba88405370f91c54
2016-05-12 08:30:24 -07:00