Summary:Helps for suckers like me, who copy and paste example code ;)
Closes https://github.com/facebook/react-native/pull/5133
Differential Revision: D3074849
Pulled By: mkonicek
fb-gh-sync-id: 8311dc26b173e341433866f66db374464c3c9f63
shipit-source-id: 8311dc26b173e341433866f66db374464c3c9f63
Summary:The docs indicated that a higher number was more accurate, however based on the implementation:
```
/**
* TODO: this logic looks wrong, and it may be because it is. Currently, if _scrollEventThrottle
* is set to zero (the default), the "didScroll" event is only sent once per scroll, instead of repeatedly
* while scrolling as expected. However, if you "fix" that bug, ScrollView will generate repeated
* warnings, and behave strangely (ListView works fine however), so don't fix it unless you fix that too!
*/
if (_allowNextScrollNoMatterWhat ||
(_scrollEventThrottle > 0 && _scrollEventThrottle < (now - _lastScrollDispatchTime)))
```
https://github.com/facebook/react-native/blob/master/React/Views/RCTScrollView.m#L564
It appears that only 0 is a special case here, and perhaps a known issue ;)
Closes https://github.com/facebook/react-native/pull/3729
Differential Revision: D3074801
Pulled By: mkonicek
fb-gh-sync-id: f63b00755f7565165cc628085efa5ed96badcfe1
shipit-source-id: f63b00755f7565165cc628085efa5ed96badcfe1
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:Explain the **motivation** for making this change. What existing problem does the pull request solve?
> When vjeux [asked me how the documentation changes looked](https://github.com/facebook/react-native/pull/6423#issuecomment-195608638), it wasn't obvious to me how to build and view them locally. So, I thought it might be a good idea to add instructions to the contributing document.
I was able to run the website locally when working on PR #6423 but am no longer able to now. I have since updated my local repo with a `git pull`. I've deleted the node_modules directories in both the root and website folders, rebuilding both. Still, I get the following error when I run `npm start` within the website directory (problem with the ES2015 compiling?)...
```bash
**/react-native/website/server/convert.js:134
.filter(key => key.startsWith('RN_'))
^^
SyntaxError: Unexpected token =>
at exports.runInThisContext (vm.js:73:16)
at Module._compile (
Closes https://github.com/facebook/react-native/pull/6510
Differential Revision: D3070560
Pulled By: vjeux
fb-gh-sync-id: 6d200bb545d0ce357500cd666dd400ec82fafa92
shipit-source-id: 6d200bb545d0ce357500cd666dd400ec82fafa92
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.)
Updating Show Case
Closes https://github.com/facebook/react-native/pull/6526
Differential Revision: D3070014
fb-gh-sync-id: b3357fac9d810a095e8da5180dd2b387253fa1c9
shipit-source-id: b3357fac9d810a095e8da5180dd2b387253fa1c9
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:- lint bot is now managed by Circle CI
- checked that flow and lint errors are caught both by bot and CI
- flow fix for npm 3
- Travis is now using npm 2 and Circle CI npm 3
- Refactored Travis script to be able to be able to fail on multiple lines
Closes https://github.com/facebook/react-native/pull/6508
Differential Revision: D3069500
Pulled By: davidaurelio
fb-gh-sync-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb
shipit-source-id: 02772bf1eae5f2c44489c2e3a01899428a9640cb
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?
Example: When "Adding a function to do X", explain why it is necessary to have a way to do X.
**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).
Closes https://github.com/facebook/react-native/pull/6497
Differential Revision: D3063800
fb-gh-sync-id: b91d99e4fcac2278aadd4fd17c38995df42720a2
shipit-source-id: b91d99e4fcac2278aadd4fd17c38995df42720a2
Summary:Just adding a new app to the showcase
Closes https://github.com/facebook/react-native/pull/6500
Differential Revision: D3064129
fb-gh-sync-id: 9845c2862caa94f343e8d8767d3e1d4c92dd2029
shipit-source-id: 9845c2862caa94f343e8d8767d3e1d4c92dd2029
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:Changing the order of transformation and extraction of dependencies made the order of modules dependent on the time when the worker pool returns a result.
node-haste v2.9.1 addresses this issue and makes the order of dependencies deterministic.
This also bumps the packager versions to enforce cache invalidation.
Reviewed By: martinbigio
Differential Revision: D3065063
fb-gh-sync-id: 1d45b066e45c3f64092f779c3fce3becf6739409
shipit-source-id: 1d45b066e45c3f64092f779c3fce3becf6739409
Summary: This diff introduces a blur radius property to the Image component on ios. If the radius specified is greater then 0 then native will apply a blur filter to the image
Reviewed By: nicklockwood
Differential Revision: D3054671
fb-gh-sync-id: d7a81ce5a08a3a2091c583f5053c6a86638b21b2
shipit-source-id: d7a81ce5a08a3a2091c583f5053c6a86638b21b2
Summary: Port the legendary props `onWillFocus` and `onDidFocus` from `Navigator` to `NavigationLegacyNavigatorRouteStack`.
Reviewed By: fkgozali
Differential Revision: D3063530
fb-gh-sync-id: 89583b8c80ee6ed0ef844a56b942a2d74b98717f
shipit-source-id: 89583b8c80ee6ed0ef844a56b942a2d74b98717f
Summary: For RAM bundling we don't want to hold the entire bundle in memory as that approach doesn't scale. Instead we want to seek and read individual sections as they're required. This rev does that by detecting the type of bundle we're dealing with by reading the first 4 bytes of it. If we're dealing with a RAM Bundle we bail loading.
Reviewed By: javache
Differential Revision: D3026205
fb-gh-sync-id: dc4c745d6f00aa7241203899e5ba136915efa6fe
shipit-source-id: dc4c745d6f00aa7241203899e5ba136915efa6fe
Summary:Because the source of truth for backgroundColor is the shadow view, it's possible for the default RCTView backgroundColor to get overwritten by the current shadowView backgroundColor when the view is first created. This overridden value will then be used as the default whenever the background color is reset, which may not be be appropriate for other components that use RCTView.
This diff fixes the bug by ensuring that the view props (and therefore the default color) are set *before* the background color is propagated from the shadowView.
Reviewed By: furdei
Differential Revision: D3064128
fb-gh-sync-id: ac36007c094c7201a5c4fd93399dee4d3eb9a043
shipit-source-id: ac36007c094c7201a5c4fd93399dee4d3eb9a043
Summary:This adds support for Modal.js on Android.
I added the ModalExample to UIExplorer to demonstrate the usage.
Reviewed By: andreicoman11
Differential Revision: D3053732
fb-gh-sync-id: 292173bdd5cb518e87cbb1d622af436704bb6329
shipit-source-id: 292173bdd5cb518e87cbb1d622af436704bb6329
Summary:At least for me I needed to press F2 in Genymotion.
Closes https://github.com/facebook/react-native/pull/6491
Differential Revision: D3064240
fb-gh-sync-id: 577409371532dadc1341ca388005a54cf3de59f4
shipit-source-id: 577409371532dadc1341ca388005a54cf3de59f4
Summary:- Move the logics that manage the routes stack into `NavigationLegacyNavigatorRouteStack`
- Add more unit tests for NavigationLegacyNavigatorRouteStack.
- Keep NavigationLegacyNavigator as a pure view as possible as we could.
Reviewed By: fkgozali
Differential Revision: D3060459
fb-gh-sync-id: 2c6802115c3f6ca5e396903f0d314ff54129524c
shipit-source-id: 2c6802115c3f6ca5e396903f0d314ff54129524c
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: This is causing issues for some internal layouts. Will fix upstream and then pull this in again.
Reviewed By: majak
Differential Revision: D3058597
fb-gh-sync-id: 2e9499d2fd0322ddd87b11f285eeb08fd51977b7
shipit-source-id: 2e9499d2fd0322ddd87b11f285eeb08fd51977b7
Summary: In my recent refactor to remove defaultViews, I added a check for null json values to determine if defaultView needed to be created. Unfortunately this was checking for nil instead of NSNull.
Reviewed By: javache
Differential Revision: D3058383
fb-gh-sync-id: 2a21dd0beb0302a94ed5379d39a102cde1316a9d
shipit-source-id: 2a21dd0beb0302a94ed5379d39a102cde1316a9d
Summary:Added a note in the Animation documentation to let people know that they need to enable `LayoutAnimation` with `UIMananger` for Android.
Resolves#5267.
Closes https://github.com/facebook/react-native/pull/6482
Differential Revision: D3058305
fb-gh-sync-id: 3527236a015c91973ab6237c3495983f407a53db
shipit-source-id: 3527236a015c91973ab6237c3495983f407a53db
Summary:Forgot to fix the description of the example in #6435
`UIProp` -> `ReactProp`
Closes https://github.com/facebook/react-native/pull/6442
Differential Revision: D3056520
fb-gh-sync-id: 0995ba66d550279bb75daa733673c68d37c5c793
shipit-source-id: 0995ba66d550279bb75daa733673c68d37c5c793