Summary:
This adds the `didUpdateDimensions` event that already exists on iOS, and
updates the internal native dimensions data that needs repopulation after
orientation change.
Reviewed By: foghina
Differential Revision: D3819364
fbshipit-source-id: fc2b3b4d1991d101e5de4439ccef2189bc65fd58
Summary:
At the moment the run-ios command from the react-native cli does only work for simulators.
The pull request adds a new option to the existing command: **"--device 'device-name'" which installs and launches an iOS application on a connected device.**
This makes it easier to build a test environment using react-native for connected devices.
I've tested my code with the following commands:
react-native run-ios --device "Not existing device"
react-native run-ios --device
react-native run-ios --device "name-of-a-simulator"
react-native run-ios --device "name-of-connected-device"
Output of the first three commands:
![example_error_output](https://cloud.githubusercontent.com/assets/9102810/17669443/f53d5948-630d-11e6-9a80-7df2f352c6a3.png)
Additional to the manual command tests i've added a test file 'parseIOSDevicesList-test.js'.
I used **ios-deploy** In order to launch and install the .app-bundle on a connected device.
ios-deploy on github:
Closes https://github.com/facebook/react-native/pull/9414
Differential Revision: D3821638
Pulled By: javache
fbshipit-source-id: c07b7bf25283a966e45613a22ed3184bb1aac714
Summary:
Currently, when reloading uiexplorer, it does not go back to the last visited
component. This fixes it, by only storing the state (which contains the last
visited component), after it has been set.
Reviewed By: bestander
Differential Revision: D3821288
fbshipit-source-id: 5b9ba10765ce402c20016519a3b7f6b5211cc623
Summary:
First of all,please forgive my poor english. LOL
When I use Promises as callBack,
I followed the guide to make a (RCTPromiseRejectBlock),in this RCTPromiseRejectBlock,
from the guide I should add a (NSString)code a (NSString)message and an (NSError) to a RCTPromiseRejectBlock.
As what did guide said I just make a NSError with
```
NSError *error=[NSError errorWithDomain:@"native stroage error" code:402 userInfo:@{@"data":key}];
```
As you can see, I want to transfer some data in this callback.But I just found the (userInfo) of NSError didn't composed to a RCTPromiseRejectBlock.
So I check out the source code of RCTUtil ,I found this
```
// TODO: Can we just replace RCTMakeError with this function instead?
NSDictionary<NSString *, id> *RCTJSErrorFromCodeMessageAndNSError(NSString *code,
NSString *message,
NSError *__nullable error)
{
NSString *errorMessage;
Closes https://github.com/facebook/react-native/pull/9519
Differential Revision: D3821334
Pulled By: javache
fbshipit-source-id: 0fa40dd93932af70123b8f8a20a5c7dc5afdd6ac
Summary:
When I use local static files as Image resources, it will occur a 404 error if the image file's name contains some non-latin letters.
The reason is that the request's url will be encoded if it contains some non-latin letters.
Closes https://github.com/facebook/react-native/pull/9604
Differential Revision: D3821328
Pulled By: javache
fbshipit-source-id: bfdc7f71517b5d4ba9e0a013979e5dcf6c31a237
Summary:
Landing D3528215 again, now that D3593884 has landed and makes that easier.
Copy-paste summary from previous diff:
So PanReponder.onPanResponderRelease/onPanResponderTerminate receive a
gestureState object containing a onPanResponderTerminate.vx/vy property. On
Android and iOS, they appear to be orders of magnitude different, which appear
to be due to the different scale of timestamps that are used when generating
touch events.
This pull request fixes the timestamps to be milliseconds on both platforms
(since I assume iOS is the more authoritative one, and is the one that
react-native-viewpager's vx thresholds written written to compare against.)
As far as I can tell, the RN code doesn't use the vx/vy properties, so they
should be okay. And looks like the RN code only cares about relative values of
startTimestamp/currentTimestamp/previousTimestamp though, so should be fine too.
it's quite possible there will be downstream android breakage with this change,
particularly for those who are already compensating for the RN discrepancy.
Reviewed By: foghina
Differential Revision: D3819761
fbshipit-source-id: fd2d85748ae6a9cde6af715aabb620f340c2220c
Summary:
Currently, when sharing local files, the file contents are being sent as NSData causing the file to never be attached when sharing via Email or via Airdrop, being renamed to something obscure such as (null)-257D026032E9-1.data
Simply passing the Local File URL to UIActivityViewController instead of the file contents resolves this issue.
More info on this issue: https://github.com/facebook/react-native/issues/8442
Closes https://github.com/facebook/react-native/pull/9693
Differential Revision: D3821142
Pulled By: javache
fbshipit-source-id: a06128db88d24cf5565169f321365ace43ab89fe
Summary:
Similar to iOS, send device orientation changes events. This does not have the
`getCurrentOrientation` method, because it's not used. If necessary, we'll
add it separately.
This also adds a simple example for testing.
We listen to orientation changes in `onGlobalLayout`, and check if the rotation of the device has changed. If it has, we emit the event.
But:
- `onGlobalLayout` (and `onConfigurationChanged` - which is the method usually used for checking for device orientation changes) is *not* called when the device goes from landscape
to reverse landscape (same with portrait), as that is not a relayout / configuration change. We could detect if this happens with the help of an `OrientationEventListener`. However, this listener notifies you if the degree
of the phone changes by a single degree, which means that you need to know by how many degrees the phone needs to change in order for the orientation to change. I haven't looked into how accurate this could be, but I suspect that in practice it would cause a lot of bugs. A simple `abgs` and google search reveals that everybody uses a different margin for detecting a rotation change (from 30 to 45 degrees), so I suspect that this won't work
as expected in practice. Therefore, we're not using this here, and we're sticking to what android provides via `onConfigurationChanged`. If we find that we have issues because users need to know when the user goes
from landscape to reverse landscape, then we'll have to revisit this.
Reviewed By: foghina
Differential Revision: D3797521
fbshipit-source-id: 62508efd342a9a4b41b42b6138c73553cfdefebc
Summary:
This fixes some inaccuracies in our reporting of textinput's contentsize.
First, we were not using the correct padding info. Then, we are converting the
contentSize width and height to ints right before sending
them over to JS. This adds some inaccuracy with the textinput behaviour,
especially in the case of auto expending text inputs, since those same sizes are
then sent right back.
Reviewed By: astreet
Differential Revision: D3806008
fbshipit-source-id: 7e32f91fde50099fd8a122833fd0042683e68df1
Summary:
Currently when doing a file upload, the Content-Type header gets set to whatever MIME type iOS computed for the file. The Content-Type header the developer provided never takes precedence.
For example, when uploading an image, iOS might determine that the MIME type is "image/jpeg" and so this would be the Content-Type of the HTTP request. But the developer might need the Content-Type to be "application/octet-stream". With this change, if the developer provides a Content-Type header, it will not be overriden.
There is only one exception to this rule which is for "multipart" requests. In this case, the developer's Content-Type header is always ignored. This is because the Content-Type header needs to contain the boundary string and that information is not available to the developer in JavaScript.
This change makes iOS's behavior more consistent with Android's.
**Test plan (required)**
In a small test app, verified that the developer's Content-Type header takes precedence when it's provided. Verif
Closes https://github.com/facebook/react-native/pull/9651
Differential Revision: D3820001
Pulled By: mkonicek
fbshipit-source-id: fdb8871f88a0d0db1ae59f75bb62b896fe69542d
Summary:
This fixes an issue that would have arised once our number of blog posts passed 10, as the prev/next links in the footer were using the wrong path ("jest/", instead of "react-native/").
I also capped the number of recent blog posts to 10 in the sidebar.
Closes https://github.com/facebook/react-native/pull/9670
Differential Revision: D3819973
Pulled By: mkonicek
fbshipit-source-id: 321fe99654e10a4ad3e0815540518c8e9202385f
Summary:
Should help people with less xcode experience.
Closes https://github.com/facebook/react-native/pull/9748
Differential Revision: D3819960
Pulled By: mkonicek
fbshipit-source-id: 2d73611a5ed7261c95eded2f3e20eeb660527cdc
Summary:
Update documentation for Switch as it's not a background color that is displayed when the switch off, but juste the border (the background remains transparent)
Closes https://github.com/facebook/react-native/pull/9707
Differential Revision: D3819887
Pulled By: mkonicek
fbshipit-source-id: 218fd20deaded5260cc51e815b559f3cbbb3f752
Summary:
There's no codementor app, neither Android nor iOS, so I believe it should not exist in the showcase. Furthermore, the article linked doesn't even mention react native. Not sure how this got added, but I think it should be removed as it undermines the credibility of the showcase page by being there.
Closes https://github.com/facebook/react-native/pull/9744
Differential Revision: D3819328
Pulled By: mkonicek
fbshipit-source-id: d76fdb0fd3b644e25313b32d030d85071f88e276
Summary:
Android PR for TextInput selection, based on the iOS implementation in #8958.
** Test plan **
Tested using the text selection example in UIExplorer.
Closes https://github.com/facebook/react-native/pull/8962
Differential Revision: D3819285
Pulled By: andreicoman11
fbshipit-source-id: 9a2408af2a8b694258c88ab5c46322830c71452a
Summary: Activity events now have a `silent` boolean option that specifies whether or not the event phases are to be logged to the console. Defaults to `false`, preserving current behaviour for events that do not explicitly have this option set.
Reviewed By: davidaurelio
Differential Revision: D3810802
fbshipit-source-id: 38d14b9e6c6502fbc73eece9466f20b60d19965e
Summary:
Refresh bug #7976
This bug has persisted for 3 versions of React Native. Currently everyone is having to do a silly fix, documented in the bug. I spent an hour trying to find the source of the bug. Failing to find the issue quickly, I've just decided to make this simple bugfix.
According to janicduplessis #7976 we will likely be re-writing this control in iOS 10.
Closes https://github.com/facebook/react-native/pull/9249
Differential Revision: D3817227
fbshipit-source-id: f98282aadeca3e85239836f589eda901d454f2ce
Summary:
When bringing back `node-haste` to React Native, I left an `fdescribe` in a test that led to ~70 tests being skipped.
This re-enables these tests, and fixes test failures
Reviewed By: cpojer
Differential Revision: D3811225
fbshipit-source-id: 67a16f385759bb829f1f3f559862eab7e78f2097
Summary:
There are a couple of buggy behaviors in the current implementation of the `ellipsizeMode` prop on Android:
- Setting the `numberOfLines` prop stomps on whatever value you provided for `ellipsizeMode` earlier.
- The value you've provided for `ellipsizeMode` is used even if you've configured your view to have an unlimited size (i.e. `numberOfLines` is 0 or unspecified).
This change fixes these issues which makes Android's `ellipsizeMode` prop more consistent with iOS's. Additionally, it renames LineBreakMode to EllipsizeMode in a couple of places.
**Test plan (required)**
Verified that the `numberOfLines` and `ellipsizeMode` props work correctly in an Android test app.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9594
Differential Revision: D3810166
Pulled By: foghina
fbshipit-source-id: 229c9bfc3ef10670a1090311ea9d095cb2c1121a
Summary:
It's very confusing that this modules doesn't work like most others. I believe it would be beneficial to state that upfront. When you know that you *have* to link the CameraRoll library then the resources help you know how to link are pretty straightforward.
Closes https://github.com/facebook/react-native/pull/9708
Differential Revision: D3809715
fbshipit-source-id: b100874426146d38251c52fde29502e4dda74d40
Summary: Updating an existing bundle is now logged as a telemetric event.
Reviewed By: davidaurelio
Differential Revision: D3804754
fbshipit-source-id: adab3b054a161bd9535ad01d52573fb7bb177d43
Summary:
I was following the Native Modules guide for iOS, when I noticed this error in the example code:
> Argument 2 (NSNumber) of CalendarManager.addEvent has unspecified nullability but React requires that all NSNumber arguments are explicitly marked as `nonnull` to ensure compatibility with Android.
Marking the parameter NSNumber type as `nonnull` fixes the error in the example.
Closes https://github.com/facebook/react-native/pull/9705
Differential Revision: D3804661
Pulled By: JoelMarcey
fbshipit-source-id: 92ec8a08ff2a179e4a8935de4cecd7b8d993469b
Summary:
This is similar to the iOS feature that was implemented by 84f68c338a.
**Test plan (required)**
Verified that the image dimensions are included in the `onLoad` callback in a test app. Also, this change is used in my team's app.
Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/9608
Differential Revision: D3797659
Pulled By: foghina
fbshipit-source-id: ea83a907bf6b0b61d9bc1e90fc7c64b7132db81f
Summary: Modified logic and constants to make the swipable row animations feel more natural and smooth.
Reviewed By: fred2028
Differential Revision: D3801391
fbshipit-source-id: d4301fe01a190803b5bc27373a9755086b6c431d