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
Summary:
What existing problem does the pull request solve?
It fixes some formatting issues that appear in the React Native documentation.
**Test plan**
Run the documentation extraction and verify the content appears correctly as `code` formatted sections.
Closes https://github.com/facebook/react-native/pull/12346
Differential Revision: D4553340
Pulled By: hramos
fbshipit-source-id: b8307b3c3e1c3451f740c46222e10ec3c45e3008
Summary:
cc astreet
The goal of this PR is to enable the buck module `uimanager` to depend on `modules/core` without introducing any dependency cycles.
PR #11008 relies on this PR. PR #11008 needs `uimanager` to depend on `modules/core` so that `uimanager` can fire events using `RCTDeviceEventEmitter` which is in `modules/core`.
This PR moved a number of classes and interfaces:
- `com.facebook.react.modules.debug.DeveloperSettings` -> `com.facebook.react.modules.debug.interfaces.DeveloperSettings`
- `com.facebook.react.devsupport.DevOptionHandler` -> `com.facebook.react.devsupport.interfaces.DevOptionHandler `
- `com.facebook.react.devsupport.DevSupportManager` -> `com.facebook.react.devsupport.interfaces.DevSupportManager`
- `com.facebook.react.devsupport.DevServerHelper.PackagerStatusCallback` -> `com.facebook.react.devsupport.interfaces.PackagerStatusCallback`
- The class `com.facebook.react.devsupport.StackTraceHelper.StackFrame` was renamed to `StackFram
Closes https://github.com/facebook/react-native/pull/12329
Differential Revision: D4551160
Pulled By: astreet
fbshipit-source-id: 3a78443c4f30469b13ddfbdcc9bbef6af9e8381a
Summary:
Fixes ```align-content:strech``` on nodes without specified cross dimension, if there are multiple lines. Currently it uses the full height of the parent, but it has to use the line height. As we don't know the number of lines until here, we need to realign the relevant children.
Closes https://github.com/facebook/yoga/pull/368
Reviewed By: gkassabli
Differential Revision: D4528559
Pulled By: emilsjolander
fbshipit-source-id: 019e6f85fa452d0c3412f711e3886f0c4452da47
Summary:
Due to the changes in 46817a38. We have a bug if the layout changes.
This PR fixes this bug and adds a test for it.
Additionally it correctly marks negative percentage values as undefined dim.
It also changes the ```resolvedDimensions``` to use a reference instead of the full value in order to minimize the memory requirement of a ```YGNode``` and reduces the copying of the ```YGValue```.
Closes https://github.com/facebook/yoga/pull/379
Reviewed By: gkassabli
Differential Revision: D4528552
Pulled By: emilsjolander
fbshipit-source-id: c024fe3a009c3788af319b689858ea3374c46477
Summary:
Adds the two missing alignments ```space-between``` and ```space-around``` for ```align-content``` . Those values are a noop on ```align-items``` in order to prevent a breaking changes for an additional enum.
Fix#229
Closes https://github.com/facebook/yoga/pull/364
Reviewed By: gkassabli
Differential Revision: D4528561
Pulled By: emilsjolander
fbshipit-source-id: ea6291b6dd22cef05d9eec03893250d50371236e
Summary:
We should unmock React just because we do that elsewhere and tests work better
that way. I was trying to get React tests working in this repo but because
we do so many special things in the React Core repo I gave up.
These test run in the React Core repo already.
Reviewed By: spicyj, bvaughn
Differential Revision: D4541126
fbshipit-source-id: ffbb1b76aac910a976222db91b80b8839fcecc60
Summary:
This is simply so I will start receiving Travis CI build notifications so I can keep an eye on the CocoaPods podspecs, as discussed with mkonicek.
Closes https://github.com/facebook/react-native/pull/12318
Differential Revision: D4543194
Pulled By: mkonicek
fbshipit-source-id: 95d3bf9d6d5aea97cfdb919ff67be92ad51b08bf
Summary:
Simple cleanup for AppRegistry.
Also added `registerSection()` helper to mark registered components as app-specific sections. Sections can be treated in many custom ways, e.g. they could just indicate the top level tabs, or something else. A bunch of helpers are also added.
Reviewed By: yungsters
Differential Revision: D4542788
fbshipit-source-id: 07addecb78a7514e973335bca24414fd8db40997
Summary:
`react-native-git-upgrade` doesn't handle the binary files. An error is thrown if the user has changed the default Android icons. See #11402
With this PR, the upgrader would also be ready for the assets optimization: #10408 by GantMan
- Publish `react-native-git-upgrade` to sinopia
- `npm install -g react-native-git-upgrade`
- Init a new project with an old version: `react-native init MyApp --version=0.40.0`
- Replace an Android icon (i.e. `MyApp/android/app/src/main/res/mipmap-hdpi/ic_launcher.png`) by any other image file.
- Change the content of a text file.
- Run `react-native-git-upgrade`
👉 The project is upgraded successfully.
👉 The replaced image file is still here.
👉 The text change is still here.
- Replace an Android icon in the RN sources (i.e. https://github.com/facebook/react-native/blob/master/local-cli/templates/HelloWorld/android/app/src/mai
Closes https://github.com/facebook/react-native/pull/12201
Differential Revision: D4543190
Pulled By: mkonicek
fbshipit-source-id: f1df32ee064557220deed717a129c3e175a6e9e2
Summary:
If we throw an exception from a UIOperation, the UI is likely in a bad state and we shouldn't execute any other operations on it. In non-dev mode, this would mean we've crashed and don't have to worry about that. But in dev mode, we may have shown a redbox and the instance is still active. This means doing something like reloading, which will trigger onPause and thus flush more UI operations, can crash the app while its sitting on a red box.
This diff aims to prevent that by no longer executing UI operations after one has thrown an exception.
Reviewed By: AaaChiuuu
Differential Revision: D4536925
fbshipit-source-id: 15c21bb76ad3419a54d9d5de94b6bd1f70a3e4a4
Summary: Activity lifecycle events in native modules can cause exceptions: we should redbox them like we do all other application-logic triggered exceptions.
Reviewed By: AaaChiuuu
Differential Revision: D4537111
fbshipit-source-id: 71abf8696173a3d647e858c4ea316a169ad2d8ef
Summary:
Don't call OnBatchComplete on NativeModules that have'nt been initialized.
Also a follow up to D4479604. This also removes the extra allocation of OnBatchCompleteListener per NativeModule that implements OnBatchCompleteListener.
This means NativeModules which implement OnBatchCompleteListener will have to be explicitly initialized or called into before the OnBatchCompleteListener of that NativeModule will be triggered.
Reviewed By: javache
Differential Revision: D4483682
fbshipit-source-id: 6a9431c82f72d17605d1c1e0ee9194f8d8fc2ddc