Summary: The computation for calculateClippingRect didn't work if you had a horizontal scroll nested in a vertical scroll view. The fix is to simplify the logic to first intersect the inner view within its parent and then apply transforms (translation by top/left and scroll offset). That now provides the correct clipping rectangle for nested views.
Reviewed By: astreet
Differential Revision: D3087367
fb-gh-sync-id: efdd430e024c4599189ddb8dbb258fd2b118690f
shipit-source-id: efdd430e024c4599189ddb8dbb258fd2b118690f
Summary: Adds support to generate stack traces that can be used with source maps that have a `x_facebook_offsets` field. If a file name of a stack frame contains only digits and ends with “.js”, it is included in the trace format generated by `ExceptionsManagerModule`
Reviewed By: martinbigio
Differential Revision: D3072953
fb-gh-sync-id: 69a57e3e2c758034939e5264008871f38f48a78f
shipit-source-id: 69a57e3e2c758034939e5264008871f38f48a78f
Summary:Run `Toast.makeText` other than UI Thread will cause bug #5599 : toast doesn't disappear after app exited.
use `UiThreadUtil.runOnUiThread` to fix this.
Closes https://github.com/facebook/react-native/pull/6443
Differential Revision: D3047261
fb-gh-sync-id: 0096879f2a4b4d76bda996a32089f068ae68e3f3
shipit-source-id: 0096879f2a4b4d76bda996a32089f068ae68e3f3
Summary: When I first did Modal on Android, I incorrectly set the styleWidth and styleHeight on the ModalHostShadowNode. This corresponded to RCTModalHostView in Modal.js. This node is actually really just a dummy node in the tree. The proper node to set the width and height on is the inner <View/> that has top and left position set on it. This updates the code to set the width and height on that inner node.
Reviewed By: mkonicek
Differential Revision: D3077415
fb-gh-sync-id: e9aee0a21333ed0b5bdde11f453381b0a13470c9
shipit-source-id: e9aee0a21333ed0b5bdde11f453381b0a13470c9
Summary:It didn't work for a few reason. First, the drawer view NEEDS to have a background color or no shadow will ever render. Second, we need to use the `setDrawerElevation` method instead of `setElevation` for DrawerLayout. Finally we need to actually pass the style value (maybe we could just pass elevation but I don't really think it can cause any issues) down to the native component as it is not the case at the moment.
I also added a default style to elevation of 16 which is the standard for material design according to https://www.google.com/design/spec/patterns/navigation-drawer.html#navigation-drawer-specs. I could also default it to 0 so it keeps the same appearance as before but I think it looks better this way.
Closes#6022
**Test plan**
Tested using the DrawerLayout in the UIExplorer app.
Before, elevation 0
<img width="420" alt="screen shot 2016-02-23 at 1 55 42 am" src="https://cloud.githubusercontent.com/assets/2677334/13244000/008afdb2-d9d1-11e5-95b8-9c345ea0ea8d.png">
After, elevation
Closes https://github.com/facebook/react-native/pull/6100
Reviewed By: bestander
Differential Revision: D3012242
Pulled By: lexs
fb-gh-sync-id: 4967d7ec920f0229d823032ba95c8a3cace329c6
shipit-source-id: 4967d7ec920f0229d823032ba95c8a3cace329c6
Summary:Adds a `center` option to `Image`'s `resizeMode` prop, which doesn't enlarge images.
This is how it looks in UIExplorer:
{F60386921}
Reviewed By: dmmiller
Differential Revision: D3064284
fb-gh-sync-id: 79cd2da8f44c5b3da2e42d3bebf3131335f53c28
shipit-source-id: 79cd2da8f44c5b3da2e42d3bebf3131335f53c28
Summary: Folly deprecated the brace initialization for dynamic::array, so point to a more recent tarball and fix it.
Reviewed By: bestander
Differential Revision: D3066402
fb-gh-sync-id: aaf70423886cb0cbc14aba7878a1d4e32bce82b1
shipit-source-id: aaf70423886cb0cbc14aba7878a1d4e32bce82b1
Summary:Changed the implementation of `setTranslucent` because the old one used the view flag SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN which has the sad side effect of making the ScrollViews not adjust properly when the keyboard is opened. Instead I use `setOnApplyWindowInsetsListener` to hook in the insets calculation process and consume the top offset so the decor view doesn't add top padding for the status bar.
I also limited the translucent prop to API 21+ because `setOnApplyWindowInsetsListener` is not available before that and anyway the translucent prop is only useful with a semi-transparent status bar color which only works on API 21+.
**Test plan**
Reproduced the bug using this code in UIExplorer.
https://gist.github.com/janicduplessis/217b9994e35f960a1793
Tapping a text field that would be hidden by the soft keyboard should scroll the view so it is not hidden.
Also tested that setting the translucent prop on and off still works as before.
Fixes#6455
Closes https://github.com/facebook/react-native/pull/6481
Differential Revision: D3067199
Pulled By: mkonicek
fb-gh-sync-id: aa115f8688ac7e461e62c18ebb8ab77350d000f8
shipit-source-id: aa115f8688ac7e461e62c18ebb8ab77350d000f8
Summary:This adds a `HEIGHT` constant on `StatusBar` on Android. I needed only this for now but I will work on a better status bar dimensions API later (see TODO).
It also improves the implementation to fix a bug that happened when multiple `StatusBar` components get updated in the same frame as well as remove useless calls to the `StatusBarModule` when values did not change.
Instead of calling the `StatusBarManager` immediately when the component gets updated and relying on the order of the calls that get dispatched to native we now wait at the end of the frame to send the calls to the `StatusBarManager` using `setImmediate`. To make this work properly we need to change the data structure of the props stack a little bit to store the desired transition/animation too for each value.
Finally this updates the example to only show the ones that work for the current platform.
**Test plan**
In the UIExplorer Example, in the 'StatusBar dimensions' section it should show 25 for the height of the status bar.
A
Closes https://github.com/facebook/react-native/pull/6195
Differential Revision: D3017559
fb-gh-sync-id: d6f4c6a72a2dfde83496ecc0f56dca4abaf3055e
shipit-source-id: d6f4c6a72a2dfde83496ecc0f56dca4abaf3055e
Summary:Just added a pass through to the `WebView` for `mediaPlaybackRequiresUserAction` and `setMediaPlaybackRequiresUserGesture` to allow auto-playing audio and video elements
Closes https://github.com/facebook/react-native/pull/5956
Differential Revision: D3053554
Pulled By: mkonicek
fb-gh-sync-id: a1f362c1551de1a0218f5d23c70668e4c8078993
shipit-source-id: a1f362c1551de1a0218f5d23c70668e4c8078993
Summary:Don't add systems current time to the `timeout` option. This is already correct on iOS.
Closes https://github.com/facebook/react-native/pull/6376
Differential Revision: D3053728
Pulled By: mkonicek
fb-gh-sync-id: 919068659d0d23906d8a6d85df7819296460b719
shipit-source-id: 919068659d0d23906d8a6d85df7819296460b719
Summary: D2922108 / PR #5814 broke the “Unbundle” loader by prepending the file path to the entry file with "file://". This converts it back.
Reviewed By: lexs
Differential Revision: D3052749
fb-gh-sync-id: 0b241c50e25f1a1c85265915bee01582d0ba7ac6
shipit-source-id: 0b241c50e25f1a1c85265915bee01582d0ba7ac6
Summary:This is a follow up of 9b87e6c860.
- Allows custom headers on connection request
- Adds a default `origin` header to Android, just like iOS
**Introduces no breaking changes.**
I was working on something similar and would like to propose a few changes that make the API more consistent across both iOS and Android platforms and brings this closer to [spec](https://tools.ietf.org/html/rfc6455).
I believe aprock first implementation of adding custom `headers` was correct. It makes sense naming this argument `headers` since we have no other general options available, and the current `options` field is being used to pass in a header anyway.
My use case for custom headers was attaching a token to the `Authorization` header on the connection request. I have been testing this by passing a JWT inside the `Authorization` header and verifying it on the server before establishing a connection.
Closes https://github.com/facebook/react-native/pull/6016
Differential Revision: D3040735
fb-gh-sync-id: 183744d2415b895f9d9fd8ecf6023a546e18a546
shipit-source-id: 183744d2415b895f9d9fd8ecf6023a546e18a546
Summary:This is a follow up of 9b87e6c860.
- Allows custom headers on connection request
- Adds a default `origin` header to Android, just like iOS
**Introduces no breaking changes.**
I was working on something similar and would like to propose a few changes that make the API more consistent across both iOS and Android platforms and brings this closer to [spec](https://tools.ietf.org/html/rfc6455).
I believe aprock first implementation of adding custom `headers` was correct. It makes sense naming this argument `headers` since we have no other general options available, and the current `options` field is being used to pass in a header anyway.
My use case for custom headers was attaching a token to the `Authorization` header on the connection request. I have been testing this by passing a JWT inside the `Authorization` header and verifying it on the server before establishing a connection.
Closes https://github.com/facebook/react-native/pull/6016
Differential Revision: D3040735
Pulled By: nicklockwood
fb-gh-sync-id: f81bd14ccbdba36309b9d4b4850fb66fe4deae11
shipit-source-id: f81bd14ccbdba36309b9d4b4850fb66fe4deae11
Summary:Turns out even using nanoseconds as timestamps will not guarantee that events
won't happen at the same time. This fixes sorting for event comparison.
Differential Revision: D3030540
fb-gh-sync-id: 2630c50ea60a792ea07b1bf1c6cd46a6d9859268
shipit-source-id: 2630c50ea60a792ea07b1bf1c6cd46a6d9859268
Summary: ReactAndroid will need to use the deprecated version of folly::dynamic for the time being.
Reviewed By: bestander
Differential Revision: D3025433
fb-gh-sync-id: fee6beb65d5d0c449f1a08a0d3c593b788905001
shipit-source-id: fee6beb65d5d0c449f1a08a0d3c593b788905001
Summary: In React, ReactCompoundView is supposed to be implemented by a View, but there is no ViewGroup counterpart that allows mixing virual nodes and non-virtual ones (Views) in the same parent. This is needed because TouchTargetHelper always considers child Views when looking for touch target before falling back to View/ReactCompoundView. This works incorrectly for e.g. layout-only / flattened nodes. ReactCompoundViewGroup allow intercepting touch event before it is dispatched to its children. In that sense, ReactCompoundView.reactTagForTouch() is like View.onTouchEvent() whereas ReactCompoundViewGroup.interceptsTouchEvent() is like ViewGroup.onInterceptTouchEvent().
Differential Revision: D3018028
fb-gh-sync-id: d2c70a55afb9ce9823275e7483d72e0ebedf52e4
shipit-source-id: d2c70a55afb9ce9823275e7483d72e0ebedf52e4