Summary:
This matches the behavior on iOS, there was no way before to change the cursor color per input, it was only possible to change it globally via the theme. Ideally cursor color and selection color would be 2 different props but I think this is better than what we have (and matches iOS).
Sadly there is no api to change it pragmatically (only possible via xml) so this uses reflection and can easily break so it is wrapped in a try catch to avoid crashes. I think it is better to just silently fail in this case. Definetly not super happy about the solution but I think it's worth adding since it is possible to do it natively using xml so it would suck not to be able to do it in RN.
**Test plan**
Tested that the cursor has the same color as before the change when not setting the prop and that it gets the selectionColor color when set.
Closes https://github.com/facebook/react-native/pull/12280
Differential Revision: D4571858
Pulled By: astreet
fbshipit-source-id: 7dca2db33a0a4eecb6115b45155549b1265ffbed
Summary:
We used to not send events to JS when there was a native Animated.event but we do now so we can easily enable the listener property.
**Test plan**
Tested that the listener gets called when using native Animated.event.
Closes https://github.com/facebook/react-native/pull/12323
Differential Revision: D4556407
fbshipit-source-id: 0b17f331a352d03a47f1611c667433fd5a58696c
Summary:
I was reading the documentation and noticed a few typos and grammar mistakes.
- rely -> relies
- Adding 'a' and 'its' and 'the' where appropriate
- Minor simplifications
Closes https://github.com/facebook/react-native/pull/12385
Differential Revision: D4570713
Pulled By: hramos
fbshipit-source-id: dbf0506306fd16b3454a2ec96792bda2c7bcaa70
Summary:
allow-large-files
By using async/await the code is (1) less nested, (2) more compact and (3) more robust (no exceptions running away, and much less risks of forgetting to call the callback/resolve, or mistakenly calling it twice). I now tend to think we could switch to it for all the callsites that are not in a perf-critical path.
I switched from 'request' to 'node-fetch' because 'request' has an annoying callback with 2 arguments. So it's simpler to use an interface that's (1) already returning a Promise and (2) that is becoming standard.
This changeset was a way for me to start experiment with introducing async/await in packager codebase, and it looks pretty good so far.
Reviewed By: cpojer
Differential Revision: D4559167
fbshipit-source-id: 89a328c5766c2ba890e9d0e67a81a38dac6cfc73
Summary:
I couldn't resist to do this 😄#394
This adds ```flex-wrap: wrap-reverse```
I think we hit a edge case here:
https://stackoverflow.com/questions/33891709/when-flexbox-items-wrap-in-column-mode-container-does-not-grow-its-width
as is differs here from chrome, but I think that yoga is here more correct.
So I haven't added this test yet as this would fail against chrome, as chrome outputs a width of 30 for root, whereas yoga gets a width of 60 here, which I think is correct. Strangely the output of ```flex-wrap:wrap``` is in jsfiddle also only with a (visual) width of 30 on chrome, while the tests gets generated with 60.
```html
<div id="wrap_reverse_column" style="height: 100px; flex-wrap: wrap-reverse">
<div style="height: 30px; width: 30px;"></div>
<div style="height: 30px; width: 30px;"></div>
<div style="height: 30px; width: 30px;"></div>
<div style="height: 30px; width: 30px;"></div>
</div>
```
Looking forward what you think here emilsjolander
Closes https://github.com/facebook/yoga/pull/398
Reviewed By: astreet
Differential Revision: D4564711
Pulled By: emilsjolander
fbshipit-source-id: 33dc055abd8444b2aa7796ef90bd7ec99e961bb8
Summary:
In order for `CxxModule` modules to be able to do things like emit events, we need to expose the bridge instance.
To allow classes derived from `CxxModule` in other projects to include `<cxxreact/Instance.h> I also needed to convert all the header includes to non-relative ones.
Reviewed By: javache
Differential Revision: D4564145
fbshipit-source-id: a5bc28dd9b40e2b141af9e867105c56083fbdcdc
Summary: This method was defined in the .m file already, so we can just expose it to the header for other usages.
Reviewed By: mmmulani, shergin
Differential Revision: D4557942
fbshipit-source-id: a1be8af8e31b88a152cabfab6d4cf82316088572
Summary:
Syncs the latest changes from the React GitHub repo and takes a dependency on React 16 alpha.
I had to hide the type checker stuff behind `__DEV__` because they now throw in production.
Also disabled flow for findNodeHandle for now since we have some further clean up to do.
Reviewed By: spicyj
Differential Revision: D4526535
fbshipit-source-id: af5d282e75afbb293560b62fc72657461c24bdd1
Summary: This test is failing there, so let's disable it for now.
Reviewed By: shergin
Differential Revision: D4562533
fbshipit-source-id: bf7e871bc227f870d4b7c228b41e65e725f54255
Summary:
**Test plan**
1. Add fonts using `react-native link` and a `"rnpm"` config in package.json
2. Manually delete one or more fonts from Xcode's Resources folder using Remove References option
3. Run `react-native link` again
With the patch in this PR, the plist will not accidentally get populated with duplicate entries.
Closes https://github.com/facebook/react-native/pull/12048
Differential Revision: D4560432
fbshipit-source-id: aba3733acfd5373f8d654406b06b8338b137bc07
Summary: Add simple `getRegistry()` so that add can do some custom handling of the registered components, if appropriate.
Reviewed By: shergin
Differential Revision: D4550600
fbshipit-source-id: 367c66b9fddfe4cc81cbc32a7a6043215e0df666
Summary:
...to reflect the modern world we live in with dynamic DPI platforms :)
Closes https://github.com/facebook/yoga/pull/375
Reviewed By: dshahidehpour
Differential Revision: D4528518
Pulled By: emilsjolander
fbshipit-source-id: e422bd4ae148e02c598a7b484a6adfa8c0e1e0c9
Summary:
Even so I know there are some opinions against ```margin: 0 auto``` it's still part of the spec: https://www.w3.org/TR/css-flexbox-1/#auto-margins and pretty usefull if you have to position via ```justify-content```.
This PR adds an implementation for that.
It adds an additonal ```YGUnitAuto``` and margins got ```YGNodeStyleSetMarginAuto``` functions as well.
Closes https://github.com/facebook/yoga/pull/357
Reviewed By: astreet
Differential Revision: D4501142
Pulled By: emilsjolander
fbshipit-source-id: 86519f8632496f46e78a7c9dbc5b21e212e3e0c7
Summary: Makes it easy to render separators between sections, as opposed to between items.
Reviewed By: yungsters
Differential Revision: D4555707
fbshipit-source-id: 34572ab4b2c5b47db640543149fe2551c34ccf7b
Summary:
The PR description has been updated to reflect the new approach.
**Breaking Change Summary**
On Android, the following properties now return a different number:
- `Dimensions.get('window').fontScale`
- `Dimensions.get('screen').fontScale`
- `PixelRatio.getFontScale()`
This is a breaking change to anyone who was using these properties because the meaning of these properties has now changed.
These properties used to return a value representing font scale times density ([`DisplayMetrics.scaledDensity`](https://developer.android.com/reference/android/util/DisplayMetrics.html#scaledDensity)). Now they return a value representing just font scale ([`Configuration.fontScale`](https://developer.android.com/reference/android/content/res/Configuration.html#fontScale)).
**PR Description**
This PR changes a few things:
- Correctly exposes the font scale to JavaScript as `Dimensions.get('screen').fontScale`. UIManager was exporting `DisplayMetrics.scaledDensity` under the name `fontScale`. How
Closes https://github.com/facebook/react-native/pull/11008
Differential Revision: D4558207
Pulled By: astreet
fbshipit-source-id: 096ce7b28051325dfd45fdb2a14b5e9b7d3bc46f
Summary:
Didn't notice when testing initially but the lists didn't show up properly without the extra new line before it.
Closes https://github.com/facebook/react-native/pull/12373
Differential Revision: D4557642
fbshipit-source-id: 874a7163a9b6b5492f3374b32aa0f9b7d48ffb0b
Summary:
The index is used to make sure the layout corresponds to the correct index, which can get
out of sync if cell layout is cached and then cells are re-ordered.
Reviewed By: bvaughn
Differential Revision: D4554721
fbshipit-source-id: 9acb37f390a6e40ad89f813b78f81b399ec11e9a
Summary:
Simple API takes structured `sections` prop instead of `data` array. `sections` is an array of
`Section` objects, each of which has a `key` and an `itemData` array which is analogous to a
`FlatList` `data` prop, plus optional props like `ItemComponent` that can be overridden on a
per-section level, allowing heterogeneous section item rendering via clean composition.
Flattens the sections data and renders with VirtualizedList under the hood. Doesn't support
sticky headers yet.
Reviewed By: yungsters
Differential Revision: D4519354
fbshipit-source-id: 58de959dadb6f55f681245ecd99a5dc356a48f36
Summary:
Blog post I promised about native animated :)
There's a few placeholders, one could be for a little graphic that to represent the node graph (would appreciate if someone with good design skills would make one for me hehe) and the other one for other resources about native Animated if you know of any other.
Closes https://github.com/facebook/react-native/pull/12202
Differential Revision: D4554402
Pulled By: hramos
fbshipit-source-id: db56d841c5c21cd9b7af00d020d576cd243b2778