Commit Graph

2779 Commits

Author SHA1 Message Date
rh389 7a4166c31d Deal with 0.38 'FlowFixMe's
Summary:
Largely typing fixes to deal with the glut of new `FlowFixMe` suppressions introduced with flow 0.38 in a4bfac907e

Tested with flow itself. CC gabelevi
Closes https://github.com/facebook/react-native/pull/11985

Differential Revision: D4452045

Pulled By: ericvicenti

fbshipit-source-id: acc46c4c406ae706a679e396be1d40ae2f4ce5a1
2017-01-31 13:13:32 -08:00
Paul Mestemaker 8378f0f9f7 Ensure documentation has consistent relative links
Summary:
Explain the **motivation** for making this change. What existing problem does the pull request solve?

I had tried fixing a broken link in a previous commit (#11453). My commit was merged, but it did not resolve the underlying problem. I have looked into how links should be formed for the docs and have fixed the original problem as well as updated all other links to be consistent.

Previous link formats:

- /docs/sample.html <-- broken link
- sample.html <-- broken link
- https://facebook.github.io/react-native/docs/sample.html <-- works
- /react-native/docs/sample.html <-- works
- docs/sample.html <-- works (permalink format)

This PR updates all links to the permalink format.

**Test plan (required)**
I ran the website locally and manually tested half of the links in each category. They all worked.
```
$ cd website
$ npm install && npm start
```
Closes https://github.com/facebook/react-native/pull/12064

Differential Revision: D4489153

Pulled By: mkonicek

fbshipit-source-id: bf0231d941ba147317595c3b3466dc579a887169
2017-01-31 12:13:31 -08:00
Bill 4344e064e7 Update Geolocation.js
Summary:
Clearer wording, on first read it is possible to get the impression that it will return immediately for both cached and on update request.
Closes https://github.com/facebook/react-native/pull/12072

Differential Revision: D4482784

Pulled By: mkonicek

fbshipit-source-id: 9eb9acf946b97b7b2b51f07e6a6572098afe7610
2017-01-31 11:58:30 -08:00
yyoshiki41 914848759a Fix missing RCTBridgeModule.h
Summary:
`<React/RCTBridgeModule.h>`

**motivation**

iOS native headers moved in RN v0.40.0.
link: https://github.com/facebook/react-native/releases/tag/v0.40.0

So, fixed import path in `Libraries/Sample/Sample.h`.

**Test plan (required)**

- [x] Make sure tests pass on both Travis and Circle CI.

Related p-r
https://github.com/facebook/react-native/pull/11576
Closes https://github.com/facebook/react-native/pull/12127

Differential Revision: D4488979

Pulled By: mkonicek

fbshipit-source-id: 75bffb542827d20d53062c54f06aaee0a76398bf
2017-01-31 11:13:50 -08:00
Valentin Shergin a341e9d916 Fixed calling TextInput.onChange() on applying autocorrection (iOS), Second part
Reviewed By: mmmulani

Differential Revision: D4459603

fbshipit-source-id: f1ee25a9068213a54f2c088760297ba9c2838623
2017-01-30 15:43:28 -08:00
Hawken Rives a3f86ae984 Update docs for Text allowFontScaling
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?

The documentation was slightly out of date. Following https://github.com/facebook/react-native/pull/10898, which removed the `platform ios` tag, this updates the inner documentation to remove the reference to iOS.
Closes https://github.com/facebook/react-native/pull/11993

Differential Revision: D4443723

Pulled By: hramos

fbshipit-source-id: b859c9b0fe1f5e564b919663f8c75401a52ffc9f
2017-01-30 12:58:30 -08:00
Martin Konicek ad8cbb6dea Support ScrollView.scrollToEnd on Android natively
Summary:
This is a followup for https://github.com/facebook/react-native/pull/12088 and implements the scrolling to end on Android natively rather than sending a large scroll offset from JS.

This turned out to be an OK amount of code, and some reduction in the amount of JavaScript. The only part I'm not particularly happy about is:

```
// ScrollView always has one child - the scrollable area
int bottom = scrollView.getChildAt(0).getHeight() + scrollView.getPaddingBottom();
```

According to multiple sources (e.g. [this SO answer](http://stackoverflow.com/questions/3609297/android-total-height-of-scrollview)) it is the way to get the total size of the scrollable area, similar to`scrollView.contentSize` on iOS but more ugly and relying on the fact the ScrollView always has a single child (hopefully this won't change in future versions of Android).

An alternative is:

```
View lastChild = scrollLayout.getChildAt(scrollLayout.getChildCount() - 1);
int bottom = lastChild.getBottom() + scrollLayout.getPadd
Closes https://github.com/facebook/react-native/pull/12101

Differential Revision: D4481523

Pulled By: mkonicek

fbshipit-source-id: 8c7967a0b9e06890c1e1ea70ad573c6eceb03daf
2017-01-30 10:28:32 -08:00
Janic Duplessis 850c71c2f3 Remove usages of RecyclerViewBackedScrollView in UIExplorer and NetworkOverlay
Summary:
RecyclerViewBackedScrollView was deprecated, this removes usages in Examples as well as in NetworkOverlay.

**Test plan**
Tested that RecyclerViewBackedScrollView deprecation warning doesn't show up anymore.
Closes https://github.com/facebook/react-native/pull/11999

Differential Revision: D4443707

Pulled By: hramos

fbshipit-source-id: 087afc9f183b3f2087965a2fe84301f422e48e9c
2017-01-28 10:43:35 -08:00
Martin Konicek 9dee696ed8 Add scrollToEnd to ScrollView and ListView
Summary:
**Motivation**

A basic task of making a React Native ScrollView or ListView scroll to the bottom is currently very hard to accomplish:
- https://github.com/facebook/react-native/issues/8003
- https://github.com/facebook/react-native/issues/913
- http://stackoverflow.com/questions/29829375/how-to-scroll-to-bottom-in-react-native-listview

**NOTE:** If you're building something like a chat app where you want a ListView to keep scrolling to the bottom at all times, it's easiest to use the [react-native-invertible-scrollview](https://github.com/exponent/react-native-invertible-scroll-view) component rather calling `scrollToEnd` manually when layout changes. The invertible-scrollview uses a clever trick to invert the direction of the ScrollView.

This pull request adds a `scrollToEnd` method which scrolls to the bottom if the ScrollView is vertical, to the right if the ScrollView is horizontal.

The implementation is based on this SO answer:
http://stackoverflow.com/questions/952412/uiscrollview-scrol
Closes https://github.com/facebook/react-native/pull/12088

Differential Revision: D4474974

Pulled By: mkonicek

fbshipit-source-id: 6ecf8b3435f47dd3a31e2fd5be6859062711c233
2017-01-27 10:13:29 -08:00
Sean Kinsey 2cfb3f1f8f Enable setting custom styles on scenes stack
Summary: There's scenarios where you might want to retain transparency behind the header, but have a solid background for the scene stack and its transitions.

Reviewed By: ericvicenti, dwwoelfel

Differential Revision: D4471681

fbshipit-source-id: 529e999b96b02a00e8d625169989dda49fb3ddaa
2017-01-26 20:43:33 -08:00
Ryan Gomba 7e869b9d0a Drive any numerical prop via NativeAnimated
Summary:
In theory, we should be able to animate any non-layout property, including custom ones. While there is still work to be done on the native side to fully enable this, we should start by dropping the prop whitelist.
Closes https://github.com/facebook/react-native/pull/10658

Differential Revision: D4379031

Pulled By: ericvicenti

fbshipit-source-id: fe9c30ea101e93a8b260d7d09a909fafbb82fee6
2017-01-26 18:28:53 -08:00
Hedger Wang a83af44a59 Fix Navigator scene that is falsely collapsed.
Reviewed By: ericvicenti

Differential Revision: D4472405

fbshipit-source-id: 90022598f0fd8edfddc4460fee2338a7b67538c2
2017-01-26 17:43:28 -08:00
Alex Kotliarskyi 99b81da629 Remove obsolete mocks
Reviewed By: cpojer

Differential Revision: D4466121

fbshipit-source-id: a318deb6485cb3e2e8e7bd52278bce9f9d16fefd
2017-01-26 11:28:33 -08:00
Pieter De Baets 0fc62eebc3 Revert D4450924: Expose StatusBar height on iOS
Differential Revision: D4450924

fbshipit-source-id: a883a7417e85f0a923d5fcc4d5efff75b99c2272
2017-01-25 17:59:30 -08:00
Valentin Shergin 64041669ee The warning 'cannot calculate shadow efficiently' is not a warning anymore
Reviewed By: fkgozali, yungsters

Differential Revision: D4445304

fbshipit-source-id: 3a37150ae2beaf44b505dc36b575b7d44619e071
2017-01-25 12:28:50 -08:00
David Aurelio 517abba6bb Require `fbjs/lib/invariant` instead of `invariant`
Summary: `'invariant'` can only be resolved by chance if node modules have been installed with npm3 or yarn, as it is a transitive dependency of `babel-traverse`. This changes the import to the direct dependency `fbjs/lib/invariant`.

Reviewed By: jeanlauliac, astreet

Differential Revision: D4462471

fbshipit-source-id: 5c841845012ed22a7c6264d46326a47807948513
2017-01-25 10:43:55 -08:00
Valentin Shergin 9a9ecea873 Fixed calling TextInput.onChange() on applying autocorrection (iOS)
Reviewed By: javache

Differential Revision: D4444428

fbshipit-source-id: 1b107e79307dedad43bed4ba6f456b4988904764
2017-01-24 16:58:27 -08:00
Koen Punt 72bafefc31 fix type on => one
Summary:
Just fixed a typo
Closes https://github.com/facebook/react-native/pull/12001

Differential Revision: D4443718

Pulled By: hramos

fbshipit-source-id: 69d194da871491d7243c7cc0d07dff4dfb1db590
2017-01-23 15:13:32 -08:00
Mathieu Acthernoene eebfd33b70 Expose StatusBar height on iOS
Summary:
Following the PR https://github.com/facebook/react-native/pull/6195, this adds a `HEIGHT` constant on `StatusBar` for iOS.

Combined with `statusBarFrameDidChange` and `statusBarFrameWillChange` StatusBar native events, it solves various problems with In-Call cellar bar / Location bar / others 40pt status bars, and offers a correct `keyboardVerticalOffset` value for the KeyboardAvoidingView component.
Closes https://github.com/facebook/react-native/pull/12041

Differential Revision: D4450924

Pulled By: hramos

fbshipit-source-id: 664798260f4226140f3fa3f9222a415a305d0d78
2017-01-23 12:58:34 -08:00
Héctor Ramos 86684a0a29 docs(AppState.js): update example to ES6
Summary:
If this is the way to go, I'll update the rest of the document :)

> Explain the **motivation** for making this change. What existing problem does the pull request solve?

- Update basic usage to latest ES6-7 syntax
- Provide a working simple example of using AppState
Closes https://github.com/facebook/react-native/pull/11879

Differential Revision: D4443891

Pulled By: hramos

fbshipit-source-id: 87433e994ee56050e24a3853f24a94b54f5586d4
2017-01-23 11:58:33 -08:00
Pieter De Baets 7412340175 Fix passThroughTouches
Reviewed By: mmmulani

Differential Revision: D4438390

fbshipit-source-id: 4e1ec4eaf80ffb48ac7b65ed092402c51d9227d3
2017-01-23 11:28:51 -08:00
Brian Vaughn 212d31e322 Updated Systrace and RCTRenderingPerf to sync w/ React changes
Summary:
A temporary React Native compatibility fix was added to React in commit [bba0d99](bba0d992d8) and subsequently removed in commit [e612826](e612826650). I noticed this while testing the React Native fiber renderer and attempting to use `Systrace`.

This commit updates React Native to no longer rely on the deprecated method and module.

PS I'm not sure if I should also update `ReactDebugTool` with this commit or wait for a subsequent sync script to update it. I haven't committed to this repo before. Please advise. 😄
Closes https://github.com/facebook/react-native/pull/11970

Differential Revision: D4446219

Pulled By: bvaughn

fbshipit-source-id: f286b8a4d00cdcbfbb49f52b9f1db5231d453f4c
2017-01-22 09:58:32 -08:00
Philipp von Weitershausen 16bb6e87ba XHR: support typed arrays for request payloads
Summary:
Support `xhr.send(data)` for typed arrays.

**Test plan:** run UIExplorer example on iOS and Android.
Closes https://github.com/facebook/react-native/pull/11904

Differential Revision: D4425551

fbshipit-source-id: 065ab5873407a406ca4a831068ab138606c3361b
2017-01-20 18:43:27 -08:00
Alex Kotliarskyi 5a09b2861a Guard against empy _inputRef in TextInput
Reviewed By: cpojer

Differential Revision: D4420532

fbshipit-source-id: 6912c11b5a6f5d8efaa07dc7a09a9bc1cda0658a
2017-01-20 16:43:42 -08:00
Aaron Chiu 5e9db574ee access view managers as Native Modules
Reviewed By: achen1

Differential Revision: D4338782

fbshipit-source-id: 1573e45ee3af5a44d033a166424e556b2c091fb6
2017-01-20 15:58:27 -08:00
Leon 0426732a08 Fix Scrollblocking on Android
Summary:
Without allowing Native Responder on Android, ListView get's Deadlocked while trying to scroll. This happens as soon as a PanResponder fires.

This Commit prevents this Issue and the iOS Optimization for Locking / Unlocking Listview Scrolls does a good job on Android too. So there's no need to prevent the Native Responder.

**Test plan (required)**

Compile on Android in Production Mode and try to scroll before and after this change.
Closes https://github.com/facebook/react-native/pull/8556

Differential Revision: D4438057

Pulled By: hramos

fbshipit-source-id: 05f3b7e6b4e49f5c941c7e1ce72c8bf6d66a9a28
2017-01-19 14:43:37 -08:00
yueshuaijie 94f71a3884 Add one more parameter(keyboardType) to AlertIOS.promot().
Summary:
Add one more parameter which can specify the keyboard type of first text input(if exists) to AlertIOS.prompt().

Example usage:
`AlertIOS.prompt('Type a phone number', null, null, 'plain-text', undefined, 'phone-pad')`
Closes https://github.com/facebook/react-native/pull/8781

Differential Revision: D4437900

Pulled By: hramos

fbshipit-source-id: 8141cc0d7c70d13603cd5a1d5ea3f1ab1ce437a6
2017-01-19 14:43:37 -08:00
Kevin Gozali 06956e83cd expose IS_TESTING for Platform module
Summary: Introduced IS_TESTING flag on Platform module for android as well. This is useful for testing environment.

Reviewed By: mmmulani

Differential Revision: D4429662

fbshipit-source-id: 33711d7fb5666f0bac8aee444b71261f7f12770f
2017-01-19 14:28:30 -08:00
Max Graey b850af7a39 fix skew transformation
Summary:
Motivation:
fix #11884 issue

I will try in short to explain what was wrong.
Let's look to transformation's matrix for **skewY** for example.
| cos(a) | sin(a) |    0   |   0   |
|:------:|:------:|:------:|:-----:|
|    0   |    1   |    0   |   0   |
|    0   |    0   |   1    |    0  |
|   tx   |   ty   |   tz   |   1   ||

Yes, this visually produce skewing transform but it slightly incorrect. This way affects horizontal scale as well. See [this](https://github.com/facebook/react-native/issues/11884)

|    1   | tan(a) |    0   |   0   |
|:------:|:------:|:------:|:-----:|
|    0   |    1   |    0   |   0   |
|    0   |    0   |   1    |   0   |
|   tx   |   ty   |   tz   |   1   ||

According to [www.w3.org/css-transforms](https://www.w3.org/TR/css-transforms-1/#SkewDefined)

Only one differance React Native use **row major matrix style**, so we change ```m[0][1]``` instead ```m[1][0]```.

sahrens vjeux
Closes https://github.com/facebook/react-native/pull/11992

Differential Revision: D4436470

Pulled By: vjeux

fbshipit-source-id: 1b433f04650bae7e06b5a93f521e49f11c70cce3
2017-01-19 11:28:36 -08:00
Gabe Levi e2ce98b7c6 Fix the suppress comment regex for react_native
Reviewed By: davidaurelio

Differential Revision: D4435640

fbshipit-source-id: c680aee6931979859f04c0dca47037ba6f6cba73
2017-01-19 10:28:28 -08:00
Gabe Levi 6ffdd1678e Fix all the flow errors
Reviewed By: bestander

Differential Revision: D4435405

fbshipit-source-id: 888c94e7984d3ca926a4b08b1e3dafe9a2474491
2017-01-19 04:43:38 -08:00
Satyajit Sahoo 72be2d35cc Add selectionColor prop for Text on Android
Summary:
**Motivation**

Customizing the selection color allows to use brand colors in the app. The PR implements a `selectionColor` prop for `Text` component similar to `TextInput`.

**Test plan (required)**

Run UIExplorer example with the changes and verify everything works fine.

![image](https://cloud.githubusercontent.com/assets/1174278/22023258/70197d84-dceb-11e6-8662-2879d78d14d4.png)

cc brentvatne
Closes https://github.com/facebook/react-native/pull/11947

Differential Revision: D4430265

fbshipit-source-id: 462f16548d93ab03aadb27d6f12acf90842627ab
2017-01-18 12:58:44 -08:00
Mehdi Mulani 81c33b542d Switch out DISABLE_YELLOW_BOX for IS_TESTING
Summary: Switch to using IS_TESTING on the Platform module. While IS_TESTING has to be explicitly set in the test harness, this makes it more usable and stops people from relying on brittle variables in the (larger) environment.

Reviewed By: fkgozali

Differential Revision: D4423661

fbshipit-source-id: 27a80867778b9374bcba67b69f9c93d32c0a74b0
2017-01-18 12:28:42 -08:00
Gabe Levi a4bfac907e Deploy v0.38.0
Reviewed By: jeffmo

Differential Revision: D4428858

fbshipit-source-id: 10dc69349a2b563e1fa444a8b0612e3b2d4ccd1c
2017-01-18 11:13:30 -08:00
Andy Street 963e6e9d36 Improve error messages when nesting View in Text
Summary: Since we don't support this, we should throw early. Also tries to improve the error message when adding a node that doesn't have a YogaNode to a node that can't measure itself.

Reviewed By: andreicoman11

Differential Revision: D4421542

fbshipit-source-id: e0be8cdd763091145e5e6af2db91515f4d236b37
2017-01-18 09:28:26 -08:00
Sokovikov 8159b2cd2a return stacktrace button in yellow box
Summary:
**motivation**

return button which shows stacktrace in yellow box.

**Test plan (required)**

<img src="https://cloud.githubusercontent.com/assets/1488195/21954896/fd3b0078-da77-11e6-8eeb-e6fe16ad9939.png" width="300"/>
Closes https://github.com/facebook/react-native/pull/11908

Differential Revision: D4424824

Pulled By: mmmulani

fbshipit-source-id: db4b33423fd839216286adb40a65417949c0073a
2017-01-17 17:43:28 -08:00
Peter Salanki 52d8851fc8 Cache policy control for image source
Summary:
In the context of an app an image exists in three resolutions on the server: `thumb` (30px) `feed` (300px) `full` (900px). When looking at an individual item a user can come either from the feed, via a permalink or from other parts of the app. This allows a situation where the `feed` image might or might not already be loaded somewhere in the app. In the detail view I want to render `thumb` with a blur (to quickly display something), then the `feed` image if it exists to have something decent to display until `full` loads. However it is quite a waste to load the `feed` image if it isn't already in cache, and will slow down the time until `full` is loaded. It is possible to track the navigation from feed->detail and that the `feed` image has actually completed loading by the feed component however as component hierarchies grow this turns into quite a lot of prop passing and bad separation of concerns.

NSURLRequests accepts a [Cache Policy](https://developer.apple.com/reference/fo
Closes https://github.com/facebook/react-native/pull/10844

Differential Revision: D4425959

Pulled By: lacker

fbshipit-source-id: 679835439c761a2fc894f56eb6d744c036cf0b49
2017-01-17 17:13:31 -08:00
Max Sherman a6844bdf75 Break infinite loop that happens only in debug environments
Reviewed By: javache

Differential Revision: D4411870

fbshipit-source-id: 6b141e42206734368ed50f37c8e7df8e8fd006c0
2017-01-17 16:58:46 -08:00
Seph Soliman 6d2ae35bca Added AnimatedValueXY.removeAllListeners
Summary:
> Explain the **motivation** for making this change. What existing problem does the pull request solve?

`AnimatedValueX` has `removeAllListeners()` which is a convenient way to do cleanup when components unmount, but `AnimatedValueXY` was missing a similar method which doesn't really make sense. This change makes the two classes more similar, less confusing and more convenient.
Closes https://github.com/facebook/react-native/pull/11783

Differential Revision: D4397188

fbshipit-source-id: d10a0c9c7e0a83af015ec04f6facf965d95ea984
2017-01-14 14:43:27 -08:00
Spencer Ahrens c7e3819cf4 Propagate prop type flow through StyleContext.createContainer
Reviewed By: blairvanderhoof

Differential Revision: D4394074

fbshipit-source-id: f9c7f71ba921d345e3313a3a2be16a7f85a2e0af
2017-01-13 19:28:28 -08:00
Mehdi Mulani 49d7c00500 Disable yellow box warnings based on environment variable
Summary:
This adds a hook to let you disable yellow box warnings. It's useful for native engineers who don't want to mess with JS but also for CI/testing, where the app operates mostly as a blackbox.

Depends on D4395091

Reviewed By: achen1

Differential Revision: D4395552

fbshipit-source-id: 4c3a9676caa975c537d1a4711d60aab2f404db15
2017-01-13 12:28:31 -08:00
Kevin Lee 09801aac30 fix direction of VerticalSwipeJump gestures
Summary:
When something comes in from the right, we swipe from left to
right to move back. That means, when something comes in from the bottom,
we should swipe from top to bottom to get rid of it. This diff makes that
behavior occur - right now it's somewhat nonsensical as both jumpBack
and jumpForward are mapped to the same gesture.

thanks to #11192 for making gestures work on VerticalUpSwipeJumps

Reviewed By: ericvicenti, shergin

Differential Revision: D4412129

fbshipit-source-id: 6a3b202b0a90ca459b4ef106ba5bf48d0b1aec9e
2017-01-12 17:43:42 -08:00
Dan Hassin dbe555ba78 Include props in new ListView and ScrollView mocks
Summary:
Hi,

The (as of yet unreleased) commit 5537055bf8 added some ListView and ScrollView mocks, but they leave out the original properties passed into them, which broke some of my tests (e.g. by excluding some properties like `testID`, for example, from the render tree) and I assume might break others' as well.

This PR makes it so the ListView mock directly returns the scroll component (instead of wrapping it in a View), and has ListViewMock and ScrollViewMock pass their given properties through.
Closes https://github.com/facebook/react-native/pull/11847

Differential Revision: D4408497

Pulled By: sahrens

fbshipit-source-id: 7ec01c35d6b8efeb97761cddffdb4075d09c7d70
2017-01-12 10:58:29 -08:00
Albert Brand d2de604721 Android: fix JSC crash in dev
Summary:
On Android with dev mode on, we're seeing a regular SIGSEGV when pushing a lot of animation declarations over the bridge. We tracked this down to being not specific to animations, but the crash is caused in `deepFreezeAndThrowOnMutationInDev`.

Specifically: the provided object to freeze is modified while looping, replacing the current key access to a getter/setter. After the modification, JSC crashes during retrieval of the next key - but only when there are a lot of events passing over the bridge.

We have a hunch that this is due to a bug in JSC object enumeration but did we not look into it further yet. Any help here is welcome. The JS code seems all right at first sight and shouldn't cause a segmentation crash.

The workaround in this PR is to retrieve the keys first from the object and then looping over that array. In our app and in a reduced app test case this fixes the crash.

If needed I can provide the reduced app test case. It's really tricky to make a test for this as it requires to be run
Closes https://github.com/facebook/react-native/pull/11804

Differential Revision: D4403483

Pulled By: davidaurelio

fbshipit-source-id: a31e5cff734e96bfec56e4a39dc1c6854798e245
2017-01-11 08:58:30 -08:00
Emil Sjolander 3f49e743be Add percentage support to react native
Summary:
Adds support for percentage value in react native.

syntax: property: 100 | property | '100%'

supported properties:
padding
margin
width
height
minWidth
minHeight
maxWidth
maxHeight
flexBasis

```
class Playground extends React.Component {
  render() {
    return (
      <View style={{backgroundColor: 'white', padding: 10, paddingTop: 30, height: '100%'}}>
        <Text>
          If you want to quickly test out something,
          open the Playground.js file and start coding.
        </Text>
        <View style={{backgroundColor: 'red', height: 50, width: 50}}/>
        <View style={{backgroundColor: 'blue', height: '50%', width: '50%'}}/>
      </View>
    );
  }
}
```

Reviewed By: astreet

Differential Revision: D4376549

fbshipit-source-id: c41d68a7555396f95d063a7527ee081773ac56dc
2017-01-11 03:58:37 -08:00
Paul Mestemaker fa3c06d637 Update AlertIOS.js
Summary:
This fixes a broken link in the docs.
Closes https://github.com/facebook/react-native/pull/11453

Differential Revision: D4394773

Pulled By: lacker

fbshipit-source-id: 07b3aaa25017912063ac9e65f336c56a902d7144
2017-01-09 15:28:31 -08:00
Matt Oakes 55427566b6 Add a prop to toggle ListView sticky section headers
Summary:
Hello,

This PR adds a property to the `ListView` to enable and disable to sticky sections headers behaviour. Current this is enabled by default and there is no way to disable it. It has been previously discussed in #1974 where there was a suggestion to add the `ListView` inside `ScrollView`. This is bad for performance, but some people were using that as a workaround. satya164 suggested someone submitting a PR, which is why I'm here 😉

I have tested the property manually by adding `stickySectionHeaders={false}` to the `<ListView> Paging` example in `UIExplorer`. I have also tested that the current behaviour still stands, so this is a non-breaking change.

I have also checked that the website displays the new documentation.

I couldn't see anywhere to add automated tests to this, but if there is feel free to point it out and I'll update this PR.

I tried running `npm run lint` to check the code style, but it spat out loads and loads of errors. I presume I have something set up incorrectly. Feel
Closes https://github.com/facebook/react-native/pull/11700

Differential Revision: D4380916

fbshipit-source-id: 7782043afc9f0108c81f97952fed60b153479cac
2017-01-09 03:13:28 -08:00
Gabriel Reis 5fdd6b33fa Add testID prop to Button component
Summary:
This PR adds the `testID` prop to the `Button` component in order to allow end-to-end tests.
Closes https://github.com/facebook/react-native/pull/11526

Differential Revision: D4392137

Pulled By: ericvicenti

fbshipit-source-id: d3f864aacee319e520af226cd063edef452f6fc8
2017-01-09 02:43:35 -08:00
alekhurst 55ce19d84e Change gesture direction strings in NavigatorSceneConfigs
Summary:
I see there is a string matching inconsistency in  `Libraries/CustomComponents/Navigator/Navigator.js` and `Libraries/CustomComponents/Navigator/NavigatorSceneConfigs.js`, which caused a bug resulting in gestures not working for vertical SceneConfigs. This PR fixes the inconsistency, and the bug.

**Motivation for making this change**
When working with the navigator, I was using the `VerticalUpSwipeJump` Navigator SceneConfig. The gesture to pop to the previous scene (in this case `jumpBack`) was not working.

**How I tested?**
I changed these strings (as shown in this PR) and swiped down. After these changes, everything worked as expected.

**Example**
In `Libraries/CustomComponents/Navigator/Navigator.js`, we check for gesture direction strings `bottom-to-top` and `top-to-bottom` in multiple places, but nowhere do we ever check for `up-to-down` and `down-to-up`.

```
var isTravelVertical = gesture.direction === 'top-to-bottom' || gesture.direction === 'bottom-to-top';
var isTravelInverted =
Closes https://github.com/facebook/react-native/pull/11192

Differential Revision: D4392103

Pulled By: ericvicenti

fbshipit-source-id: fd80578031f94b1b409815481c82e481c7ff2f13
2017-01-09 01:43:33 -08:00
Peter Juras 9338fbd781 Update PermissionsAndroid docs to use new APIs
Summary:
It seems that the `requestPermission` and `checkPermission` APIs from PermissionsAndroid have been deprecated in react-native 0.40.0., but they are still used in the description and example.

This commit updates the description and the example to use the new APIs.
Closes https://github.com/facebook/react-native/pull/11722

Differential Revision: D4392031

Pulled By: ericvicenti

fbshipit-source-id: e3ceebb1ef557e05dab40bb883013be4ec80bed6
2017-01-09 00:43:31 -08:00