Commit Graph

550 Commits

Author SHA1 Message Date
Janic Duplessis edbe6a2b24 Add imperative API to StatusBar
Reviewed By: svcscm

Differential Revision: D2938743

fb-gh-sync-id: 30af304efd5b089854d9a8defc1b77fd8e817d13
shipit-source-id: 30af304efd5b089854d9a8defc1b77fd8e817d13
2016-02-16 03:04:49 -08:00
trave7er 4237a27ec9 pick up some easy-to-fix lint warnings
Reviewed By: svcscm

Differential Revision: D2938097

fb-gh-sync-id: e3373bd44267251d8351d5203be1c88676aa8685
shipit-source-id: e3373bd44267251d8351d5203be1c88676aa8685
2016-02-16 02:00:57 -08:00
Satyajit Sahoo 46a8f1d8e0 Annotate Clipboard module
Reviewed By: svcscm

Differential Revision: D2866837

fb-gh-sync-id: 0f7da139e1296aec6a518d52056a6d0a1b9c07ca
shipit-source-id: 0f7da139e1296aec6a518d52056a6d0a1b9c07ca
2016-02-15 10:05:34 -08:00
Emily Janzer e93afad284 Don't show underlay if no press handlers
Reviewed By: sahrens

Differential Revision: D2915003

fb-gh-sync-id: 56ba942ed464e393ea43229b1fa9ef6936a24ecc
shipit-source-id: 56ba942ed464e393ea43229b1fa9ef6936a24ecc
2016-02-12 11:32:30 -08:00
Konstantin Raev 6f1417c849 CI now builds docs website and deploys it to /%version% path
Summary:
Copy of #5760 reverted merge.

We need to preserve history of docs changes on the webserver.
The goal is to allow users to browse outdated versions of docs.
To make things simple all websites will be released to https://facebook.github.io/react-native/releases/version/XX folder when there is a branch cut.

I switched from Travis CI to Cirle CI because it works faster and I am more familiar with it.

How it works:

1. If code is pushed to `master` branch then CI will build a fresh version of docs and put it in https://github.com/facebook/react-native/tree/gh-pages/releases/next folder.
Github will serve this website from https://facebook.github.io/react-native/releases/version/next URL.
All relative URLs will work within that website

2. If code is pushed to `0.20-stable` branch then CI will build a fresh version of docs and put it in https://github.com/facebook/react-native/tree/gh-pages/releases/0.20 folder.
Github will serve this website from https://facebook.github.io/react-native/releases/v
Closes https://github.com/facebook/react-native/pull/5873

Reviewed By: svcscm

Differential Revision: D2926901

Pulled By: androidtrunkagent

fb-gh-sync-id: 16aea430bac815933d9c603f03921cc6353906f1
shipit-source-id: 16aea430bac815933d9c603f03921cc6353906f1
2016-02-11 06:17:42 -08:00
Austin Kuo 1e58a4287c Emend the comment
Summary:
Emend the comment error
Closes https://github.com/facebook/react-native/pull/5795

Reviewed By: svcscm

Differential Revision: D2910532

Pulled By: vjeux

fb-gh-sync-id: 9f8fe026e57e049db5a0f6d4e3ee4a752457c4a5
2016-02-07 07:13:32 -08:00
Keith Norman 98797177ab fix issue that breaks scroll views w/ RefreshControl on Android
Summary:
Fixes the issue I mentioned here https://github.com/facebook/react-native/pull/5623#issuecomment-180583142
Closes https://github.com/facebook/react-native/pull/5784

Reviewed By: svcscm

Differential Revision: D2908112

Pulled By: nicklockwood

fb-gh-sync-id: 8a2f053de3f7dc19807ee21dd969c53a57b71345
2016-02-05 16:25:35 -08:00
fangmobile 33d8db599e added accessibility props for touchables
Summary:
accessibilityLabels are missing in these touchable*.js files.
for #5322
ide This is not tested yet. I will update with test.
Closes https://github.com/facebook/react-native/pull/5346

Reviewed By: svcscm

Differential Revision: D2882061

Pulled By: gkassabli

fb-gh-sync-id: dff0ef373e5f5895027cb1cc08c8887a6ace8eee
2016-02-04 05:13:32 -08:00
Nick Lockwood 81fb985335 Support non-image assets in packager
Summary:
public
The packager currently assumes that all assets that are not JSON or JS files must be images. Although it is possible to add other extension types, they crash the packager if you try to require them, because it attempts to get their dimensions, assuming that they are an image.

This is a crude workaround for that problem, which skips the image-specific processing for non-image assets, but really it would be better if the packager was properly aware of different asset types and treated them differently (e.g. for sounds it could include the duration, for HTML pages it could parse and include linked CSS files, etc).

I've also added an example of using `require('...')` to load a packager-managed HTML page in the UIExplorer WebView example. In future I anticipate that all static asset types (sounds, fonts, etc.) could be handled in this way, which allows them to be edited or added/removed on the fly instead of needing to restart the app.

Reviewed By: martinbigio

Differential Revision: D2895619

fb-gh-sync-id: cd93794ca66bad838621cd7df3ff3c62b5645e85
2016-02-03 17:30:39 -08:00
Brent Vatne 82b0df9d2a Add scrollEnabled prop to Android ScrollView
Summary:
Perhaps there is a better way to do this, curious to hear it!

- If momentum scroll is active when `scrollEnabled` is toggled, the momentum scroll continues and the onMomentumScrollEnd event fires, which is the same as on iOS.
Closes https://github.com/facebook/react-native/pull/5656

Reviewed By: svcscm

Differential Revision: D2889897

Pulled By: dmmiller

fb-gh-sync-id: b2f44d2bcb48373f9945f6afd966447a118df717
2016-02-03 13:39:33 -08:00
Janic Duplessis db74e713fe Fix scrollTo when using RefreshControl on Android
Summary:
The issue is that the ScrollResponder mixin assumes that the native scrollable node is the top level element and gets it using `React.findNodeHandle(this)` but since Android wraps the native `ScrollView` component with the `RefreshControl`, it finds the native `RefreshControl` node instead and the scroll command gets ignored because it doesn't exists.

This adds a hook to ScrollResponder mixin to allow specifying what is the native scrollable node.

The bug can be reproduced using this https://gist.github.com/janicduplessis/871c0b6d3ad0acaacba9 in UIExplorer.

Fixes #5725
Closes https://github.com/facebook/react-native/pull/5736

Reviewed By: svcscm

Differential Revision: D2896125

Pulled By: nicklockwood

fb-gh-sync-id: 0a00a20551421982c5bc519c542774877ba15c9b
2016-02-03 11:13:33 -08:00
Janic Duplessis b979128c54 Cross platform status bar API
Summary:
I started working on improving the `StatusBar` API and make it work on Android. I added support for `setColor`, `setTranslucent` (the status bar is still visible but the app can draw under) and `setHidden` on Android. Looking for feedback on how to improve the API before I put more time on this :).

Right now I went for a cross platform API and functions that don't exist on a platform are just a no-op but I'm not sure it is the best choice since at the moment what is supported is very different between both platforms. I was wondering what you guys think and if it would be better off as 2 different modules.

It is also possible to port some of the features I added for Android to iOS even if there is no 'standard' way to do it. Like `setColor` could be implemented by drawing a colored view under the status bar and translucent by adding/removing some padding.
Closes https://github.com/facebook/react-native/pull/5360

Reviewed By: svcscm

Differential Revision: D2840417

Pulled By: nicklockwood

fb-gh-sync-id: 5c8d988bccf8035341f0efe27e54dd8402c18d24
2016-02-03 06:41:35 -08:00
Dave Miller 0c91931adf Add support for selectionColor on Android TextInput
Summary:
public
This adds support to set the highlight color on TextInput on Android.  See https://github.com/facebook/react-native/pull/5678 for the iOS implementation.

Note : We will merge these two properties with one name 'selectionColor' in a follow on diff, and may move it to a style.

Reviewed By: nicklockwood

Differential Revision: D2895253

fb-gh-sync-id: 6f2c08c812ff0028973185356a8af285f7dd7969
2016-02-03 05:49:32 -08:00
Nick Lockwood 6941c4e027 Replace `ScrollView.scrollTo()` API with something less ambiguous.
Summary:
public
The current `ScrollView.scrollTo()` API is confusing due to the `(y, x)` parameter order, and the boolean `animated` argument. E.g.

    ScrollView.scrollTo(5, 0, true) // what do these arguments mean?

This diff replaces the API with a configuration object, so the arguments are all explicit:

    ScrollView.scrollTo({x: 0, y: 5, animated: true}) // much better

The `scrollTo()` method checks the argument types, and provides backwards compatibility with the old argument format for now. Using the old API will generate a warning, and this will eventually be upgraded to an error.

Reviewed By: davidaurelio

Differential Revision: D2892287

fb-gh-sync-id: cec4d504242391267c6e863816b6180ced7a7d5e
2016-02-03 04:00:40 -08:00
joranz c2233ef7e6 Add iOS tintColor prop to TextInput
Summary:
In response to https://github.com/facebook/react-native/issues/5595

Adds tintColor property to TextInput component for iOS:

<img width="375" alt="screen shot 2016-01-28 at 1 39 35 pm" src="https://cloud.githubusercontent.com/assets/3868826/12730689/eae58a36-c8e1-11e5-9453-70716617bfab.png">

Usage:

<img width="454" alt="screen shot 2016-01-28 at 1 42 37 pm" src="https://cloud.githubusercontent.com/assets/3868826/12730711/fedeed8e-c8e1-11e5-87d0-1621d19a0418.png">
Closes https://github.com/facebook/react-native/pull/5678

Reviewed By: svcscm

Differential Revision: D2895115

Pulled By: nicklockwood

fb-gh-sync-id: bfb52b992d5e02754fe47f409f6e8df426514718
2016-02-03 00:22:34 -08:00
Kudo Chien 6d65a90017 Allow customized refreshControl in ScrollView for Android
Summary:
Original Android's refreshControl in ScrollView is tightly coupled with AndroidSwipeRefreshLayout. If someone use `ref=` for RefreshControl in ScrollView, it does nothing since RefreshControl in Android return null.

This change allows customized  RefreshControl especially for `ref=` as well as making ScrollView's code clearer.
Closes https://github.com/facebook/react-native/pull/5623

Reviewed By: svcscm

Differential Revision: D2890072

Pulled By: nicklockwood

fb-gh-sync-id: a8fc7746bcc050a6e46fedf3583979f4cb9021b6
2016-02-02 07:12:32 -08:00
Aleksei Androsov 65b0913210 TextInput should call blur and focus methods of selectionState
Summary:
DocumentSelectionState returns anchor and focus offsets only in focused state. So TextInput should set proper state to selectionState when blur and focus.
Closes https://github.com/facebook/react-native/pull/5354

Reviewed By: svcscm

Differential Revision: D2890277

Pulled By: andreicoman11

fb-gh-sync-id: 84f96504e218cf7c70d7e24865ab074d882f3bea
2016-02-02 05:22:08 -08:00
Andrei-Ovidiu Coman 729c04b58b Revert "TextInput should call blur and focus methods of selectionState" 2016-02-02 13:19:58 +00:00
Andrei-Ovidiu Coman f3ffafb756 Merge pull request #5354 from doochik/textinput-selectionstate-focus-blur
TextInput should call blur and focus methods of selectionState
2016-02-02 10:39:56 +00:00
Nick Lockwood 46106f756a Ported `source` prop over to iOS WebView
Summary:
public
https://github.com/facebook/react-native/pull/5494 added a new `source` property to WebView on Android that provides a better API, as well as allowing for request headers to be set.

This diff ports that functionality over to iOS, so we can have a consistent API cross-platform.

I've also extended the API to include `method` (GET or POST) and `body` when setting the WebView content with a URI, and `baseUrl` when setting static HTML.

Reviewed By: javache

Differential Revision: D2884643

fb-gh-sync-id: 83f24494bdbb4e1408aa8f3b7428fee33888ae3a
2016-02-01 18:01:35 -08:00
glevi@fb.com 5ec1d354c2 Deploy v0.21.0
Reviewed By: jeffmo

Differential Revision: D2888689

fb-gh-sync-id: fe94e50c7872b9a1344a054acccab365d385f6ed
2016-02-01 17:13:35 -08:00
Michael Tostenson 80a2f5d50f Add headers prop to Android WebViews
Summary:
Related to [issue #5418](https://github.com/facebook/react-native/issues/5418)

This is a follow-up to [this previous pull request.](https://github.com/facebook/react-native/pull/5419)

~~Adds a new ReactProp 'urlWithHeaders' to Android WebViews that takes an object with a 'url' string and a 'headers' map.~~

[Update] Adds a new prop 'source' to Android WebViews
```
{
   html: string,
   url: string,
   headers: map<string, string>,
}
```

Update: resolves TODO 8495359
Closes https://github.com/facebook/react-native/pull/5494

Reviewed By: svcscm

Differential Revision: D2881313

Pulled By: nicklockwood

fb-gh-sync-id: 7cad8490d4932d0a7ef559165f3ec279d873c537
2016-02-01 10:06:35 -08:00
Nick Lockwood ee30433b76 Update Android's ScrollView.scrollTo API to match JS/iOS
Summary:
public
We recently updated the `ScrollResponder.scrollResponderScrollTo` method to accept an `animated` argument, and deprecated the `scrollResponderScrollWithoutAnimationTo` method. This change was reflected in the native iOS implementation, but not on Android.

This diff updates the Android ScrollViewManager implementation to match the JS API, and removes the platform-specific fork in the JS code.

Reviewed By: dmmiller

Differential Revision: D2883515

fb-gh-sync-id: e5a0e1cf470e21af837b2311cf1048162ac3aff5
2016-02-01 04:04:35 -08:00
Dotan J. Nahum 5712e0c3eb Typo: Change WebWiew to WebView
Summary: Closes https://github.com/facebook/react-native/pull/5648

Reviewed By: svcscm

Differential Revision: D2884296

Pulled By: androidtrunkagent

fb-gh-sync-id: 50340c0fc06926fbb3dc41c3078aa985ff48ccd3
2016-01-31 08:41:33 -08:00
Martin Konicek 679beb2a3a Tweak docs before releasing 0.19
Reviewed By: mkonicek

Differential Revision:D2883844
Ninja: Only docs and React Native website, doesn't affect any fb apps

fb-gh-sync-id: 4bf56dc695224f172832ca5381cebceab9e5fe4f
2016-01-30 17:11:28 -08:00
Nick Lockwood 9d0242fdc3 Replace direct access of NativeModules.UIManager with require('UIManager')
Summary:
public
Due to the cross-platform polyfills we have added (and will add in future) to `UIManager.js`, accessing UIManager directly via NativeModules instead of importing the wrapper is discouraged.

This diff fixes a few places where we were doing this inside our own modules.

Note: As a general policy, we should avoid accessing modules via NativeModules anyway. Using wrapper classes allows us to provide static declarations for all the native methods and properties, which can be checked at build time by flow. If we access the modules directly, those interfaces are only known at runtime.

Reviewed By: vjeux

Differential Revision: D2881300

fb-gh-sync-id: 6737358ea8ea6d722cc1941a4b9fa0123a87fc29
2016-01-30 07:36:34 -08:00
Christoph Jerolimov cb874a55aa Add MapView annotation callback when it gets / lost the focus
Summary:
For my project it was required to receive a notification when the MapView annotation was deselected.

So I renamed `onAnnotationPress` to `onAnnotationSelected` and added a new method `onAnnotationDeselected`, this names was "inspired" by the underlaying iOS API. The old API was still called and marked as deprecated.

But maybe you have an idea for a better naming (onAnnotationFocus/-Blur?) -- or should a deselected call the press method again without an annotation (undefined)?
Closes https://github.com/facebook/react-native/pull/5167

Reviewed By: svcscm

Differential Revision: D2869695

Pulled By: nicklockwood

fb-gh-sync-id: 91795ac3f1e4533b250af8901534d8870729d9db
2016-01-29 06:26:30 -08:00
Martin Konicek 1dd5ba7021 Add a cross-platform Picker
Summary:
The basic API is consistent with iOS; there are several platform-specific props.

Also fixed the flickering when a value is selected.

public

Reviewed By: bestander

Differential Revision: D2871092

fb-gh-sync-id: f5cdf6858cb7344b28ee46954cb6b0a3b144b646
2016-01-29 03:59:54 -08:00
Janic Duplessis 1c6e837504 Add a deprecatedPropType module to show deprecation warnings
Summary:
To allow smoother API changes for users we often deprecate props and keep them around for a while before removing them. Right now it is all done manually, this adds a consistent way to show a warning when using a deprecated prop.

This also adds a deprecation warning of the website generated from the deprecatedPropType.

<img width="643" alt="screen shot 2016-01-26 at 7 43 08 pm" src="https://cloud.githubusercontent.com/assets/2677334/12600172/7af28fb0-c465-11e5-85e5-3786852bf522.png">

It also changes places where we added the warnings manually to use deprecatedPropType instead.
Closes https://github.com/facebook/react-native/pull/5566

Reviewed By: svcscm

Differential Revision: D2874629

Pulled By: nicklockwood

fb-gh-sync-id: c3c63bae7bbec26cc146029abd9aa5efbe73f795
2016-01-29 02:05:38 -08:00
Kudo Chien 8de86a0d65 Add onPageScrollStateChanged for ViewPagerAndroid
Summary:
I have an issue when combining `PullToRefreshViewAndroid` and `ViewPagerAndroid`.
`ViewPagerAndroid` will not able to scroll that gesture handler is being taken by `PullToRefreshViewAndroid`
One solution is to disable `PullToRefreshViewAndroid` if `ViewPagerAndroid` is scrolling (i.e. not idle).
[Reference solution here](http://stackoverflow.com/a/29946734/2590265)

So here need to expose the `onPageScrollStateChanged` event.
Some code referenced from  DrawerLayoutAndroid, especially the `VIEWPAGER_PAGE_SCROLL_STATES` array.
Please feel free give me comments.
Thanks.
Closes https://github.com/facebook/react-native/pull/5026

Reviewed By: svcscm

Differential Revision: D2830623

Pulled By: andreicoman11

fb-gh-sync-id: c2a6920c6f4c7daab0115f13864db83b93b31abf
2016-01-29 01:17:35 -08:00
August Flanagan 0f7477f9f9 add flag to enable momentum scrolling on iOS
Summary:
Expose a `decelerationNormalEnabled` flag on WebView, which, when enabled, will WebView's ScrollView's `decelerationRate` to `UIScrollViewDecelerationRateNormal`. This gives the WebView the same "momentum" style scrolling as other iOS views.

This was discussed with ide in #5447. Please let me know if there's anything I'm missing, or anything else you'd like to see in this pull request.
Closes https://github.com/facebook/react-native/pull/5527

Reviewed By: svcscm

Differential Revision: D2870312

Pulled By: nicklockwood

fb-gh-sync-id: 7dbfd06a349e3365a5df40c3bacf25a4fdb306cf
2016-01-28 05:36:33 -08:00
Jean Regisser b84f5fb6c9 Added iOS indicatorStyle prop to ScrollView
Summary:
Hi,

The doc wording was adapted from https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScrollView_Class/#//apple_ref/doc/c_ref/UIScrollViewIndicatorStyle

Note that the iOS doc is misleading, and `UIScrollViewIndicatorStyleDefault` is the same as `UIScrollViewIndicatorStyleBlack` (since iOS 7 I think).

Let me know what you think.
Closes https://github.com/facebook/react-native/pull/5583

Reviewed By: svcscm

Differential Revision: D2870011

Pulled By: nicklockwood

fb-gh-sync-id: d28a96e1a2d4610cbeaee0ae70108ab9d9f05fdb
2016-01-27 10:16:33 -08:00
Nick Lockwood f685878938 Improved 3D touch implementation, and added example
Summary:
public
This diff improves the implementation of 3D touch by adding a `forceTouchAvailable` constant to View that can be used to check if the feature is supported.

I've also added an example of how you can use the `force` property of the touch event to measure touch pressure in React Native.

Reviewed By: vjeux

Differential Revision: D2864926

fb-gh-sync-id: 754c54989212ce4e4863716ceaba59673f0bb29d
2016-01-27 09:05:36 -08:00
Satyajit Sahoo e33e6ab1f0 Add cross-platform Linking module
Summary:
A promise based API for handling Link for Android and iOS. Refer #4971

The iOS part doesn't handle errors. Will need someone with iOS knowledge to do that.

cc skevy ide brentvatne mkonicek vjeux nicklockwood
Closes https://github.com/facebook/react-native/pull/5336

Reviewed By: svcscm

Differential Revision: D2866664

Pulled By: androidtrunkagent

fb-gh-sync-id: 67e68a827e6b85886bfa84e79b897f079e78b1b5
2016-01-26 14:34:31 -08:00
Jed Lau affd6230fe self -> this in ScrollResponder
Summary:
I *think* this is causing a crash for me in a release build (curiously, not a debug build):
```
ReferenceError: Can't find variable: self
```

I saw this in 0.18.1, which I assume was renamed to v0.19.0-rc.
Closes https://github.com/facebook/react-native/pull/5562

Reviewed By: svcscm

Differential Revision: D2866491

Pulled By: androidtrunkagent

fb-gh-sync-id: 196f718bf807c5eef676f66f1e15d7bde9475d5b
2016-01-26 14:23:32 -08:00
Martin Konicek 9a0539d2c4 Open source Android date and time pickers
Reviewed By: bestander

Differential Revision: D2856486

fb-gh-sync-id: 0bb81136289e2f121387649765ba682103e4701b
2016-01-26 10:31:17 -08:00
Noam Bartov f68281a0d8 added support for overlayColor property for image
Summary:
In Android, Fresco's default rounding corners support mode is BITMAP_ONLY which doesn't work in all cases (such as animated GIF's, some scale types, etc.).
Specifying the new "overlayColor" property on an Image will cause Fresco to switch to the other rounding corners mode, OVERLAY_COLOR, and will draw rounded corners by overlaying the solid color specified.

Fresco's behaviour is explained here: http://frescolib.org/docs/rounded-corners-and-circles.html
Closes https://github.com/facebook/react-native/pull/5366

Reviewed By: svcscm

Differential Revision: D2854696

Pulled By: mkonicek

fb-gh-sync-id: 251701ee8a64acbfc22694e9d4661c40eef75725
2016-01-24 14:00:39 -08:00
Christopher Dro 2b309a426a Updates to Text & IntentAndroid
Summary: Closes https://github.com/facebook/react-native/pull/5496

Reviewed By: svcscm

Differential Revision: D2858772

Pulled By: androidtrunkagent

fb-gh-sync-id: 5edf52af256efe6bb7ae1f8bcc2622d7e6a1298c
2016-01-23 11:01:33 -08:00
Elliot Hesp f644af34ef Correctly bind Touchable.js setTimeout
Summary:
Fixes https://github.com/facebook/react-native/issues/5337

`this.setTimeout` is undefined and the scope wasn't being passed through causing a RedBox error.
Closes https://github.com/facebook/react-native/pull/5376

Reviewed By: svcscm

Differential Revision: D2838623

Pulled By: androidtrunkagent

fb-gh-sync-id: 513210298b6c39d812047a03d8f2edd5c11e46f6
2016-01-22 14:45:35 -08:00
Huang Yu f453e14c8f Fix StyleSheet 'textAlign' for AndroidTextInput. Closes #2702
Summary:
change `setTextAlign` and `setTextAlignVertical` to receive argument of type `String` (the same as in `StyleSheet`), so that native props and stylesheet props are calling the same ReactMethod

- add demo (may not be necessary)
Closes https://github.com/facebook/react-native/pull/4481

Reviewed By: svcscm

Differential Revision: D2823456

Pulled By: mkonicek

fb-gh-sync-id: 349d17549f419b5bdc001d70b583423ade06bfe8
2016-01-21 11:08:34 -08:00
Dave Miller 747be0bf5c Change the js signature to be Promise based and dynamically detect it used as a callback
Summary:
Making the default people see when they look at the module the Promise based version

public

Reviewed By: davidaurelio

Differential Revision: D2850048

fb-gh-sync-id: e0815983ed798c202047cb071e65ce63a52fd1af
2016-01-21 09:49:34 -08:00
Jeff Berg 48117ce6c4 Fix TouchNativeFeedback so that the ripple starts from where a person touches
Summary:
It needs the touch coordinates for with-in the element, not for on the page.
Closes https://github.com/facebook/react-native/pull/5400

Reviewed By: svcscm

Differential Revision: D2848834

Pulled By: androidtrunkagent

fb-gh-sync-id: 88cf0fd7bd2332eb3db835b26438064412c8358c
2016-01-20 20:36:38 -08:00
tantan 15f806957f Return a Promise for `Clipboard.getString()`
Summary:
For clipboard, add error callback in Android. Code like
```javascript
Clipboard.getString((content)=>{
    //do something
},(error)=>{
   //do something for error
})
```
Closes https://github.com/facebook/react-native/pull/4792

Reviewed By: svcscm

Differential Revision: D2844937

Pulled By: nicklockwood

fb-gh-sync-id: 19953807ff07238e6a6ef5aedf1a3fcbca7e62a1
2016-01-20 10:54:32 -08:00
Janic Duplessis bd4bf8ca39 Fix a crash in ViewPagerAndroid when passing a null child
Summary:
Fixes #5195
Closes https://github.com/facebook/react-native/pull/5236

Reviewed By: svcscm

Differential Revision: D2819197

Pulled By: androidtrunkagent

fb-gh-sync-id: cea451802c659512f64c1e90905647b8fbe4490b
2016-01-18 13:57:30 -08:00
Aleksei Androsov 5ea4d397a9 TextInput should call blur and focus methods of selectionState
DocumentSelectionState returns anchor and focus offsets only in focused state. So TextInput should set proper state to selectionState when blur and focus.
2016-01-16 14:49:40 +03:00
Horcrux 274a3e0585 add onLoading* prop for WebView
Summary:
add onLoadingStart,onLoadingError,onLoadingFinish prop for WebView
Closes https://github.com/facebook/react-native/pull/5335

Reviewed By: svcscm

Differential Revision: D2834003

Pulled By: nicklockwood

fb-gh-sync-id: bbe84297ebeb5a6c2bf1caaacee8c59e0bcef1db
2016-01-15 09:31:33 -08:00
Konstantin Raev 18437093f2 Open sourced spinner aka picker aka drop down for android
Reviewed By: mkonicek

Differential Revision: D2830803

fb-gh-sync-id: e6b6fcdbe33d942180cf2c1041076ad71d0473ce
2016-01-15 06:25:16 -08:00
Nick Lockwood e4c53c28ae Improved shadow performance
Summary:
public
React Native currently exposes the iOS layer shadow properties more-or-less directly, however there are a number of problems with this:

1) Performance when using these properties is poor by default. That's because iOS calculates the shadow by getting the exact pixel mask of the view, including any tranlucent content, and all of its subviews, which is very CPU and GPU-intensive.
2) The iOS shadow properties do not match the syntax or semantics of the CSS box-shadow standard, and are unlikely to be possible to implement on Android.
3) We don't expose the `layer.shadowPath` property, which is crucial to getting good performance out of layer shadows.

This diff solves problem number 1) by implementing a default `shadowPath` that matches the view border for views with an opaque background. This improves the performance of shadows by optimizing for the common usage case. I've also reinstated background color propagation for views which have shadow props - this should help ensure that this best-case scenario occurs more often.

For views with an explicit transparent background, the shadow will continue to work as it did before ( `shadowPath` will be left unset, and the shadow will be derived exactly from the pixels of the view and its subviews). This is the worst-case path for performance, however, so you should avoid it unless absolutely necessary. **Support for this may be disabled by default in future, or dropped altogether.**

For translucent images, it is suggested that you bake the shadow into the image itself, or use another mechanism to pre-generate the shadow. For text shadows, you should use the textShadow properties, which work cross-platform and have much better performance.

Problem number 2) will be solved in a future diff, possibly by renaming the iOS shadowXXX properties to boxShadowXXX, and changing the syntax and semantics to match the CSS standards.

Problem number 3) is now mostly moot, since we generate the shadowPath automatically. In future, we may provide an iOS-specific prop to set the path explicitly if there's a demand for more precise control of the shadow.

Reviewed By: weicool

Differential Revision: D2827581

fb-gh-sync-id: 853aa018e1d61d5f88304c6fc1b78f9d7e739804
2016-01-14 14:04:34 -08:00
Andrei Coman 25c3dd140f Add phone-pad keyboard
Summary:
With the numeric keyboard now being an actual numeric keyboard (before
it was actually phone-pad), we need a proper phone-pad keyboard as well.

public

Reviewed By: dmmiller

Differential Revision: D2830707

fb-gh-sync-id: 80a1d314eac730e691de73a31342c014a2fa5ba6
2016-01-14 11:42:34 -08:00
Nick Lockwood ff6a2c3998 Deprecated `scrollResponderScrollWithoutAnimationTo`
Summary:
public

This diff deprecates `scrollResponderScrollWithoutAnimationTo` and replaces it with an optional `animated` param in `scrollResponderScrollTo`. This is more consistent with our other APIs.

Using the old `ScrollResponder.scrollResponderScrollWithoutAnimationTo` or  `ScrollView.scrollWithoutAnimationTo` functions will still work, but will trigger a warning.

Reviewed By: javache

Differential Revision: D2823479

fb-gh-sync-id: 259966512104ca7b3995c9586144812a91b8d3e9
2016-01-14 07:42:34 -08:00
Janic Duplessis f5062d0840 Add doc for RefreshControl on the website
Summary:
Exposes the doc for RefreshControl and add a link to the component page in ScrollView.
Closes https://github.com/facebook/react-native/pull/5209

Reviewed By: svcscm

Differential Revision: D2818217

Pulled By: mkonicek

fb-gh-sync-id: eb1ae70103e6a02af3a12866509f68eacc413dfd
2016-01-13 11:34:31 -08:00
Gaëtan Renaudeau 963f26cea8 add ScrollResponder#scrollResponderZoomTo animated second argument
Summary:
ScrollResponder was missing a non animated version for zoomToRect.

- scrollResponderScrollTo <> scrollResponderScrollWithoutAnimationTo
- ~~scrollResponderZoomTo <> 🆕 **scrollResponderZoomWithoutAnimationTo**~~
- `scrollResponderZoomTo(rect, animated = true)`
Closes https://github.com/facebook/react-native/pull/5268

Reviewed By: svcscm

Differential Revision: D2823311

Pulled By: nicklockwood

fb-gh-sync-id: ea409d332963f56e8b58ec2c086db3f6815058f7
2016-01-13 02:55:33 -08:00
Andrei Coman cc449b394e Refactor text input keyboards
Reviewed By: foghina

Differential Revision: D2807491

fb-gh-sync-id: e7e5fb8c235f3637f619b2f44053749c51f379f0
2016-01-07 13:40:33 -08:00
realaboo a45219966c ProgressBarAndroid: default value for styleAttr
Summary:
Current default value of ProgressBarAndroid's styleAttr is "Large" which sets the ProgressBar's style to [Widget_ProgressBar_Large](http://developer.android.com/reference/android/R.style.html#Widget_ProgressBar_Large) at native side. But large is not the default style for the native side ProgressBar.

For example, the size of the ProgressBar is 48dip for default style, but 76dip for large and 16dip for small as in the Material themes. Although the size of ProgressBarAndroid could be set in JS, it'll be better to have the same default style as in native side themes.

My PR adds a "Normal" value for styleAttr prop and makes it the default value.
Closes https://github.com/facebook/react-native/pull/4974

Reviewed By: svcscm

Differential Revision: D2811229

Pulled By: bestander

fb-gh-sync-id: 087f68d1919fe933d86e5194112bf7a5f5b3f3c6
2016-01-07 12:02:37 -08:00
Dave Miller 6dc6794881 Add onSelectionChange for Android TextInput
Summary:
public

Add an onSelectionChange method to TextInput that works on Android same as iOS

Reviewed By: andreicoman11

Differential Revision: D2780131

fb-gh-sync-id: 9b3b8fbd9ea653d43e3107a338e4bc08bde2e8c6
2016-01-07 12:02:06 -08:00
Elliot Hesp d6513ca03f Add "Only supports one child" to TouchableWithoutFeedback
Summary: Closes https://github.com/facebook/react-native/pull/4985

Reviewed By: svcscm

Differential Revision: D2794384

Pulled By: bestander

fb-gh-sync-id: 7332a83df635619d1d6bfacbf6e9c71af90179d9
2016-01-06 11:52:30 -08:00
Quentin Valmori 3d0ff69e40 Map follow user location
Summary:
Fix #3105

It's the same PR as #3119 but as I force-pushed in my branch, I can't reopen the PR. I added an example.
![capture d ecran 2016-01-05 a 07 15 37](https://cloud.githubusercontent.com/assets/1107936/12108841/2727f504-b37c-11e5-8250-b53785930aba.png)
Closes https://github.com/facebook/react-native/pull/5126

Reviewed By: svcscm

Differential Revision: D2803052

Pulled By: nicklockwood

fb-gh-sync-id: 2e8978ff1b293d699462a8290b45fa74cc16b4dd
2016-01-06 11:00:34 -08:00
Ognen Ivanovski 61025a9b33 bugfix: NavigatoriOS doesn't update any scenes when 0th scene is replaced
Summary:
Calling navigator.replace(0, scene) has no effect.

This is because 0 is false in Javascript so when

    this.state.updatingAllIndicesAtOrBeyond == 0

(meaning update all indices starting with 0)

The whole expression evaluates to 0, i.e. false ->  therefore no update
happens.

Explicitly checking for not-equal to null (!= will convert undefined to null automatically) fixes the issue.
Closes https://github.com/facebook/react-native/pull/5155

Reviewed By: svcscm

Differential Revision: D2807397

Pulled By: nicklockwood

fb-gh-sync-id: 519a4ab35c86b0b608808b36593f5f8c2ecd1561
2016-01-06 10:33:36 -08:00
Christopher Dro a3d9fadc78 Remove fixed size for Android. Fixes #3785
Summary:
Fixed #3785
Closes https://github.com/facebook/react-native/pull/4298

Reviewed By: svcscm

Differential Revision: D2807289

Pulled By: mkonicek

fb-gh-sync-id: 6f161e4f8b04597726183fdcf8bc22c682557958
2016-01-06 07:42:28 -08:00
Nick Lockwood 17df595e32 Implement Android's dispatchViewManagerCommand interface on iOS
Summary:
public
Android implement ViewManager methods via a dispatch method on UIManager, whereas iOS implements them by exposing the methods on the view manager modules directly.

This diff polyfills Android's implementation on top of the iOS implementation, allowing the same JS API to be used for both.

Reviewed By: javache

Differential Revision: D2803020

fb-gh-sync-id: 0da0544e593dc936467d16ce957a77f7ca41355b
2016-01-06 05:58:37 -08:00
Alex Kotliarskyi 28c0240361 Fix `background` warning in TouchableNativeFeedback
Summary:
The problem: no matter what value `background` prop has, it always triggers a warning

![screen shot 2016-01-05 at 1 20 35 pm](https://cloud.githubusercontent.com/assets/192222/12128053/c0a8754a-b3af-11e5-92c6-921e2e0c7cc4.png)

Looks like this happens because we use `createStrictShapeTypeChecker` prop types inside `PropTypes.oneOfType` instead of `PropTypes.shape`.
Closes https://github.com/facebook/react-native/pull/5132

Reviewed By: svcscm

Differential Revision: D2804478

Pulled By: mkonicek

fb-gh-sync-id: 32ce964047bddd9d92c214baaff5422dbcfd7e90
2016-01-06 05:58:31 -08:00
odino 6edcebef9c Stop using platform-specific names for props
Summary:
Follows up on [this comment](https://github.com/facebook/react-native/pull/5065#issuecomment-168353782) by nicklockwood in #5065.

Rely on using the platform annotation and keep the API / naming less redundant.
Closes https://github.com/facebook/react-native/pull/5081

Reviewed By: svcscm

Differential Revision: D2803143

Pulled By: nicklockwood

fb-gh-sync-id: 9bdf028f5022ef46fcb63aa6c3fc931fdcc46f2b
2016-01-05 10:32:43 -08:00
Janic Duplessis 44f7a00e95 Cross platform PullToRefreshView component
Summary:
Both iOS and Android currently support some sort of native pull to refresh control but the API was very different. I tried implementing a component based on PullToRefreshViewAndroid but that works on both platforms.

I liked the idea of wrapping the ListView or ScrollView with the PullToRefreshView component and allow styling the refresh view with platform specific props if needed. I also like the fact that 'refreshing' is a controlled prop so there is no need to keep a ref to the component or to the stopRefreshing function.

It is a pretty rough start so I'm looking for feedback and ideas to improve on the API before cleaning up everything.

On iOS we could probably deprecate the onRefreshStart property of the ScrollView and implement the native stuff in a PullToRefreshViewManager. We could then add props to customize the look of the UIRefreshControl (tintColor). We could also deprecate the Android only component and remove it later.
Closes https://github.com/facebook/react-native/pull/4915

Reviewed By: svcscm

Differential Revision: D2799246

Pulled By: nicklockwood

fb-gh-sync-id: 75872c12143ddbc05cc91900ab4612e477ca5765
2016-01-04 08:00:29 -08:00
Katrina Nova 86af597c2e Update NavigatorIOS.ios.js
Summary:
Allow props passed to the route object to overwrite props passed to the navigator.
Closes https://github.com/facebook/react-native/pull/5101

Reviewed By: svcscm

Differential Revision: D2799379

Pulled By: androidtrunkagent

fb-gh-sync-id: 147b6ba4b309657f03d7bda38f8958c4599c38c3
2016-01-04 07:42:31 -08:00
Jason Brown b8aac8b77a Implement draggable annotations on MapView. Closes #2512
Summary: Closes https://github.com/facebook/react-native/pull/4441

Reviewed By: svcscm

Differential Revision: D2707897

Pulled By: nicklockwood

fb-gh-sync-id: 6f67f711c1ec1f821d03b9b1ea5cc39859d28fd1
2016-01-04 06:38:30 -08:00
Jay Salvat e62471b7c3 Fix pop method to properly refresh the navigatorBar
Summary:
When using nativator.pop() the navigatorBar doesn't refresh properly if we change navigationBarHidden.

When navigator.pop() is called, the navbar doesn't show up, even avec navigationBarHidden set back to true. See between Statusbar and Movie poster in the example below.

![bad](https://cloud.githubusercontent.com/assets/55496/8683849/77effa30-2a75-11e5-9f32-9be6fa87efac.gif)

    // Not actually updating the indices yet until we get the native
    // `onNavigationComplete`.
    updatingAllIndicesAtOrBeyond: null,

https://github.com/facebook/react-native/blob/master/Libraries/Components/Navigation/NavigatorIOS.ios.js#L510-L512

The View need to be refreshed in pop method anyway.

    updatingAllIndicesAtOrBeyond: this.state.requestedTopOfStack - n,

Now, navbar appears properly.

![good](https://cloud.githubusercontent.com/assets/55496/8683907/be9d2714-2a75-11e5-8fda-653e68869076.gif)
Closes https://github.com/facebook/react-native/pull/1989

Reviewed By: svcscm

Differential Revision: D2798515

Pulled By: androidtrunkagent

fb-gh-sync-id: 9d554c9d88b87628488a8cebb7e3bbe4dd9c017d
2016-01-02 22:52:30 -08:00
Kudo Chien 4972cabaa5 Add <Text> shadow support
Summary:
Add three new TextStylePropTypes for \<Text>
- textShadowOffset
- textShadowRadius
- textShadowColor
Closes https://github.com/facebook/react-native/pull/4975

Reviewed By: svcscm

Differential Revision: D2796278

Pulled By: nicklockwood

fb-gh-sync-id: f8c3fa210e664428b029b9fba8eca4a8eb81c08d
2016-01-01 09:33:31 -08:00
odino 6793128435 Allowing turning on / off DOM storage on android webviews
Summary:
Was developing on a WebView and couldnt get it to run. Turns out its JS code mostly depends on `localStorage` and I realized it wasnt turned on in RN. This PR adds a prop, similar to `javascriptEnabledAndroid` to be able to turn DOM storage on / off.

TBH I dont really know how it works on IOS, so I created an android specific thingy. I assume DOM storage is enabled by default on IOS.
Closes https://github.com/facebook/react-native/pull/5065

Reviewed By: svcscm

Differential Revision: D2797735

Pulled By: androidtrunkagent

fb-gh-sync-id: cd60cfa4d24d80fb82e4f54f387a4517a99e75ab
2015-12-31 18:04:29 -08:00
Brent Vatne fef01ed394 ScrollWithouth => ScrollWithout
Summary:
Oops!
Closes https://github.com/facebook/react-native/pull/5029

Reviewed By: svcscm

Differential Revision: D2793490

Pulled By: vjeux

fb-gh-sync-id: 0115d3ef38cad3e838241937263308827e56f25f
2015-12-29 12:42:26 -08:00
StefanT a162f72655 Added ColorPropType
Summary:
Problem: https://github.com/facebook/react-native/issues/4708

Solution: Added a ColorPropType that validates the color used by the dev

Notes:
1) I'm working a Win8.1 machine and couldn't build the react-native using the github repo. As soon as I figure that out, I'll probably figure how to run the tests and how to add some for this feature.
2) It's my first pull request. Be gentle :)
Closes https://github.com/facebook/react-native/pull/4866

Reviewed By: bestander, svcscm

Differential Revision: D2783672

Pulled By: nicklockwood

fb-gh-sync-id: ca22aa3c0999188075681b5d20fff0631496e238
2015-12-23 10:08:38 -08:00
Andreas Stütz 7164c755cb Add props for content insets
Summary:
This PR adds a contentInsetStart and a contentInsetEnd property to ToolbarAndroid, allowing offsetting Toolbar contents to different keylines
Closes https://github.com/facebook/react-native/pull/4699

Reviewed By: svcscm

Differential Revision: D2759294

Pulled By: mkonicek

fb-gh-sync-id: f22aa255f07929ad7a99ac7568981d35e848065b
2015-12-23 10:08:33 -08:00
Mike Fowler 134dd57cd6 Update ToolbarAndroid.android.js
Summary:
Updates the documentation for `ToolbarAndroid.android.js` with proper asset system syntax.
Closes https://github.com/facebook/react-native/pull/4908

Reviewed By: svcscm

Differential Revision: D2783113

Pulled By: mkonicek

fb-gh-sync-id: 321d79cb80025d7a065ccf012678ecebccb35bae
2015-12-23 10:08:28 -08:00
Brent Vatne 6df737d1e7 Expose in public interface
Summary:
Allows you to do:
```
var { RecyclerViewBackedScrollView } = require('react-native')
```

Rather than:
```
var RecyclerViewBackedScrollView = require('react-native/Libraries/Components/ScrollView/RecyclerViewBackedScrollView')
```

Also...

- Export `ScrollView` by default rather than `UnimplementedView` for `RecyclerViewBackedScrollView` on iOS -- this makes it easier on the user, so you don't have to always do a conditional for: `if IOS then use ScrollView else use RecyclerViewBackedScrollView`. I can't think of a case where this would lead to undesirable behaviour.
- Add `RecyclerViewBackedScrollView` to `MainReactPackage`
- Fix an issue with `MapView` that threw a red-screen when trying to access constants on Android because there is no `MapView` in open source and MapView.js doesn't have a platform extension.
Closes https://github.com/facebook/react-native/pull/4514

Reviewed By: svcscm

Differential Revision: D2753466

Pulled By: mkonicek

fb-gh-sync-id: 0b6e2133975c911d5117e7531cb9093faf314c52
2015-12-23 10:07:34 -08:00
Christopher Dro 4cb775286c Add option for both min/max track image.
Summary:
This is a followup to PR #3850 but now separates min/max track images into different properties.
Closes #4476

Add examples for `minimumTrackTintColor`, `maximumTrackTintColor`, `minimumTrackImage`, `maximumTrackImage` to UIExplorer.
Closes https://github.com/facebook/react-native/pull/4586

Reviewed By: svcscm

Differential Revision: D2779193

Pulled By: nicklockwood

fb-gh-sync-id: 0510a0f496816baacdd0d4be0f3cd3a63a5a9865
2015-12-21 10:30:39 -08:00
Nick Lockwood 97fe0eae6b Fix map annotation view layout bug
Summary:
public
When using the custom view option for MapView annotations, the view would sometimes be top-left-aligned on the coordinate instead of centered on it. This fixes that.

Reviewed By: fredliu

Differential Revision: D2776380

fb-gh-sync-id: 793bfd1c3f5b1c923caf031e01b1f6c90e544472
2015-12-19 09:16:26 -08:00
glevi@fb.com dc6ca95c3a Fixed Flow errors
Reviewed By: nicklockwood

Differential Revision: D2773940

fb-gh-sync-id: 3d632c57c411ddaf428c1d96d145da62dd115a14
2015-12-18 11:17:29 -08:00
Nick Lockwood 9901bf20e1 Fixed image source for MapView annotations
Summary:
public
resolveAssetSource was not being called on MapView image any more, resulting in an error when using `require(./imagename.png)` syntax.

Reviewed By: fredliu

Differential Revision: D2772560

fb-gh-sync-id: 0a50a9c3ba727406343a0f47c84941e95df9cadd
2015-12-18 00:50:30 -08:00
Nick Lockwood ba3a5f0eec Removed overly-strict typing in MapViewExample
Summary:
public

While it's nice to see such a masterclass in strict typing with Flow, having it an example serves no useful purpose, and makes the example unnecessarily fragile with respect to API changes.

Reviewed By: gabelevi

Differential Revision: D2769981

fb-gh-sync-id: db5550d5674bf32ef8d331861751a4e6aa1f6536
2015-12-17 16:34:09 -08:00
Martin Konicek 8cd7730080 Open source Android WebView
Summary:
Keep `WebView.android.js` and `WebView.ios.js`, there are
some small differences. Use the same example on both platforms.

public

Reviewed By: bestander

Differential Revision: D2769446

fb-gh-sync-id: be3d0afcbfd6ddcbaa49f70555063b3081ba03cb
2015-12-17 12:47:39 -08:00
Nick Lockwood f9dfb90a35 Added ability to use a custom view for MapView annotations
Summary:
public
This diff adds the ability to specify a custom React component (aka view) to be displayed as a MapView pin.

This makes it possible to use remote images (using an <Image/> component), or text (using a <Text/> component), or anything else.

One consequence of this is that MapView can no longer support arbitrary subviews. To place views in front the map, add them to a separate container view.

Reviewed By: tadeuzagallo

Differential Revision: D2764790

fb-gh-sync-id: e16b44e866c2d76c76b0cb35ef9eefbfc68d6719
2015-12-17 06:46:33 -08:00
Dave Miller fcf0431d25 Add support for more Scroll Events to Android
Summary:
public
This adds support for
onScrollBeginDrag/End
onMomentumScrolBegin/End

Reviewed By: astreet

Differential Revision: D2739035

fb-gh-sync-id: 2a49d1df54e5f5cd82008bdb0ffde0881ba39aff
2015-12-16 00:48:28 -08:00
Hedger Wang 53d18c83c8 Fix app crash caused by TextInput.
Reviewed By: zjj010104

Differential Revision: D2761644

fb-gh-sync-id: 89241de2f8c84d569ec452871f740a0d655cc95e
2015-12-15 17:32:27 -08:00
Justas Brazauskas 0e8b207cc3 Bugfix - Typos
Summary:
Fixed few typos in `./Examples` and `./Libraries` folders.
Closes https://github.com/facebook/react-native/pull/4788

Reviewed By: svcscm

Differential Revision: D2759918

Pulled By: androidtrunkagent

fb-gh-sync-id: d692b5c7f561822353e522f9d4dfde7e60b491cf
2015-12-15 09:09:32 -08:00
Satyajit Sahoo eb188c8d98 Add deep linking support to IntentAndroid
Summary:
Add a method to handle URLs registered to the app,

```js
IntentAndroid.getInitialURL(url => {
    if (url) {
        // do stuff
    }
});
```

Refer - http://developer.android.com/training/app-indexing/deep-linking.html#adding-filters

The API cannot be same as the iOS API (i.e. as a constant), as the activity is not availble at the time of module initialization. Moreover, multiple activties can share the same bridge instance, and the activity itself is not a constant. Hence the initialURL can change.
Closes https://github.com/facebook/react-native/pull/4320

Reviewed By: svcscm

Differential Revision: D2759667

Pulled By: foghina

fb-gh-sync-id: b725231ae1401fa5565d444eee5a30d303e263ae
2015-12-15 06:27:27 -08:00
Huang Yu f946d14fcc clean four MapView lint warnings
Summary:
clean four MapView lint warnings.
Closes https://github.com/facebook/react-native/pull/4778

Reviewed By: svcscm

Differential Revision: D2759161

Pulled By: androidtrunkagent

fb-gh-sync-id: c5b028d0400c5084436d636d3bf9a0072fa09571
2015-12-14 22:47:29 -08:00
Brent Vatne c8108bdbe1 Fixed controlled component on iOS and remove unnecessary code
Summary:
Closes #4290

`mostRecentEventCount` was always being set after `text` on iOS, so let's be really explicit about the order here as we were doing on Android: always call `setNativeProps` providing the `mostRecentEventCount` before we call `onChange` or `onChangeText`.

I also ripped out storing `mostRecentEventCount` in the state, which isn't necessary since we're always doing it through `setNativeProps`.
Closes https://github.com/facebook/react-native/pull/4588

Reviewed By: svcscm

Differential Revision: D2754565

Pulled By: nicklockwood

fb-gh-sync-id: a1401f39b4e19248095517c2a3503cd2af59fa47
2015-12-14 06:46:31 -08:00
Huang Yu e0c724a4c3 fix lint warnings from DrawerLayoutAndroid
Summary:
fix 3 lint warnings from DrawerLayoutAndroid.android.js
Closes https://github.com/facebook/react-native/pull/4451

Reviewed By: svcscm

Differential Revision: D2715067

Pulled By: mkonicek

fb-gh-sync-id: 9cd0158087c8533950cdab85fdbfb137fcca20e4
2015-12-11 23:05:27 -08:00
tantan 90c7ad112f add Clipboard component for ios and android
Summary:
add Clipboard component for ios and android
 ```javascript
    import Clipboard from 'react-native'

    Clipboard.get((content)=>{
          console.log('here is content in clipboard:%s',content)
    });
    var content = 'here is a string';
    Clipboard.set(content);
```
Closes https://github.com/facebook/react-native/pull/4384

Reviewed By: svcscm

Differential Revision: D2738881

Pulled By: mkonicek

fb-gh-sync-id: a06df32d1eb2824cc9ca3de9d45e4e67fd2edbc9
2015-12-09 10:04:21 -08:00
Harry Moreno 54ec6e7cab Docs warn navigator ios
Summary:
ping https://github.com/facebook/react-native/issues/795#issuecomment-139895307
Closes https://github.com/facebook/react-native/pull/3087

Reviewed By: svcscm

Differential Revision: D2738947

Pulled By: mkonicek

fb-gh-sync-id: e29dfd933a8da42551576bdb1fb5c270039722ee
2015-12-09 04:34:30 -08:00
Nick Lockwood b672294858 Added RCTImageSource
Summary:
public

The +[RCTConvert UIImage:] function, while convenient, is inherently limited by being synchronous, which means that it cannot be used to load remote images, and may not be efficient for local images either. It's also unable to access the bridge, which means that it cannot take advantage of the modular image-loading pipeline.

This diff introduces a new RCTImageSource class which can be used to pass image source objects over the bridge and defer loading until later.

I've also added automatic application of the `resolveAssetSource()` function based on prop type, and fixed up the image logic in NavigatorIOS and TabBarIOS.

Reviewed By: javache

Differential Revision: D2631541

fb-gh-sync-id: 6604635e8bb5394425102487f1ee7cd729321877
2015-12-08 03:32:30 -08:00
Mihai Giurgeanu 31125b2ed7 Android - Fixing #4392
Summary:
This is just an workaround for making UIExplorer work in Android.
Closes https://github.com/facebook/react-native/pull/4405

Reviewed By: svcscm

Differential Revision: D2727452

Pulled By: tadeuzagallo

fb-gh-sync-id: af48fb8c462ab04874cfdb96c0fd4409bf6d92c3
2015-12-05 14:59:29 -08:00
glevi@fb.com 383d991c40 Fix flow errors in fbobjc
Reviewed By: jeffmo

Differential Revision: D2724169

fb-gh-sync-id: d2736ce2550fe8bf45c18bce7d89a9cb5c98cb87
2015-12-04 11:56:29 -08:00
Matt Revell c1849e7f4b Fix an issue with unsafe picker access to setNativeProps.
Summary:
Fixing an issue where PickerIOS and DatePicker are being accessed unsafely, As a side effect we are also using ref callbacks as oppose to strings.

Fixed after spotting an issue in our app where the picker is closed and the callback attempts to update native props for an item that no longer exists.
Closes https://github.com/facebook/react-native/pull/3920

Reviewed By: svcscm

Differential Revision: D2663634

Pulled By: nicklockwood

fb-gh-sync-id: 813b32a038f59864401d5d3985c7ea32f5e13301
2015-12-04 07:41:30 -08:00
Christopher Dro dd9c1e16ee Add string as possible propType for 'systemIcon'
Summary:
Fixes #2361
Closes https://github.com/facebook/react-native/pull/4523

Reviewed By: svcscm

Differential Revision: D2718568

Pulled By: androidtrunkagent

fb-gh-sync-id: a15c94acaac899dfdaeb397c8c764053d1430854
2015-12-03 11:10:40 -08:00
Nick Lockwood 3313f769f5 Use console.error() for the Touchable.js bug so we can capture it in production logs
Reviewed By: javache

Differential Revision: D2717874

fb-gh-sync-id: 7c2cac61fe4fbd2c6de6cf1d9059df9ac119f543
2015-12-03 09:02:25 -08:00
Sameer Rahmani c8eed6a361 RTL support added for ToolbarAndroid via "rtl" property
Summary: Closes https://github.com/facebook/react-native/pull/4378

Reviewed By: svcscm

Differential Revision: D2715052

Pulled By: mkonicek

fb-gh-sync-id: e24f5db230cd7329911797794e5ef150f6195c4a
2015-12-03 05:18:26 -08:00
Nick Lockwood 7ab17e5ef3 Fix for long press state transition error in Touchable.js
Summary:
public

This diff fixes an occasional JS exception thrown by Touchable.js when it attempts to transitions to the RESPONDER_ACTIVE_LONG_PRESS_IN state from the RESPONDER_INACTIVE_PRESS_IN state.

Although I wasn't able to reproduce the error while testing, I was able to identify the likely cause: the LONG_PRESS_DETECTED state transition is triggered by a timer that is started on touch-down. This timer should be cancelled if the gesture is interrupted, however I identified a code path where the state can be changed to RESPONDER_INACTIVE_PRESS_IN without the longPressDelayTimeout being cancelled.

To fix this, I've added some logic to cancel the timer in that case. I've also added a test for the error scenario that will display a redbox in __DEV__ mode, but will fail gracefully in production mode.

Reviewed By: jingc

Differential Revision: D2709750

fb-gh-sync-id: aeea1a31de5e92eb394c2ea177f556b131d50790
2015-12-02 09:54:29 -08:00
Nick Lockwood 37042573b8 Added blurOnSubmit support to multine TextInput (aka RCTTextView)
Summary:
public

Setting `blurOnSubmit=true` on a multiline `<TextInput>` now causes it to behave like a single-line input with respect to the return key:

With the default value of `false`, pressing return will enter a newline character into the field. If you set the value to `true`, pressing return will now blur the field and trigger the onSubmitEditing event. The newline character will *not* be added to the text.

(See associated github task for dicussion: https://github.com/facebook/react-native/pull/2149)

Reviewed By: javache

Differential Revision: D2710448

fb-gh-sync-id: c9706ae11f8b399932d3400ceb4c7558e455570d
2015-12-02 08:16:27 -08:00
Gabe Levi 892dd5b86a Fix errors uncovered by v0.19.0
Reviewed By: mroch

Differential Revision: D2706663

fb-gh-sync-id: 017c91bab849bf18767cacd2ebe32d1a1b10c715
2015-12-01 20:11:26 -08:00
Huang Yu 0a3694ce48 fix several lint warnings
Summary: fix some ling warnings from several files
Closes https://github.com/facebook/react-native/pull/4450

Reviewed By: svcscm

Differential Revision: D2707606

Pulled By: mkonicek

fb-gh-sync-id: 410ccacf061ac7b0f6e44d1a5e4621a9d1d606fc
2015-12-01 07:26:29 -08:00
Huang Yu 8f2023d961 fix Libraries/Components/Touchable lint warnings
Summary: fix 4 lint warnings under Libraries/Components/Touchable directory
Closes https://github.com/facebook/react-native/pull/4449

Reviewed By: svcscm

Differential Revision: D2705537

Pulled By: spicyj

fb-gh-sync-id: 0c573d846a2263819c2a0bffe0a178eee1fe3fca
2015-11-30 17:16:26 -08:00
Nick Lockwood c63de5e2a5 Fixed MapView crash on iOS 8 and earlier
Summary: public

[MKPinAnnotationView redPinColor] is only supported on iOS 9 and later. This caused React Native to crash on iOS 8 and earlier.

This fixes the crash by providing a forked implementation for different OS versions.

Reviewed By: tadeuzagallo, javache

Differential Revision: D2702737

fb-gh-sync-id: cd8984f1f3d42989001f3c571e325f1b4ba09ac8
2015-11-30 05:10:26 -08:00
Nick Lockwood 60db876f66 Wrapped UIManager native module for better abstraction
Summary: public

RCTUIManager is a public module with several useful methods, however, unlike most such modules, it does not have a JS wrapper that would allow it to be required directly.

Besides making it more cumbersome to use, this also makes it impossible to modify the UIManager API, or smooth over differences between platforms in the JS layer without breaking all of the call sites.

This diff adds a simple JS wrapper file for the UIManager module to make it easier to work with.

Reviewed By: tadeuzagallo

Differential Revision: D2700348

fb-gh-sync-id: dd9030eface100b1baf756da11bae355dc0f266f
2015-11-27 07:00:32 -08:00
Tim Park 8911b72d9e Add Polyline support to MapView
Summary: Per issue #1925, add support for Polyline to MapView.

Briefly, if you have a MapView declared as:

    <MapView
      annotations={this.state.annotations}
      overlays={this.state.overlays}
      style={styles.map}
      region={this.state.region}
      ref="mapView"
    />

then setting

    this.state.overlays = [{
      coordinates: [
        { latitude: 35.5, longitude: -5.5 },
        { latitude: 35.6, longitude: -5.6 },
        ...
      ],
      strokeColor: 'rgba(255, 0, 0, 0.5)',
      lineWidth: 3,
    }];

will draw a red line between the points in locations with a width of 3 and equally blended with the background.
Closes https://github.com/facebook/react-native/pull/4153

Reviewed By: svcscm

Differential Revision: D2697347

Pulled By: nicklockwood

fb-gh-sync-id: a436e4ed8d4e43f2872b39b4694fad7c02de8fe5
2015-11-26 08:54:16 -08:00
Nick Lockwood 4b6b71664e Fix buck error
Reviewed By: idevelop

Differential Revision: D2699529

fb-gh-sync-id: d71a5abf04b767a58dd6f054a88a8bf0c561aa8d
2015-11-26 05:42:25 -08:00
Nick Lockwood 5b5b55027b Added support for custom color and image for map annotations
Summary: public

This diff extends RCTMap annotations with an `image` and `tintColor` property, which can be used to render completely custom pin graphics.

The tintColor applies to both regular pins and custom pin images, allowing you to provide varied pin colors without needing multiple graphic assets.

Reviewed By: fredliu

Differential Revision: D2685581

fb-gh-sync-id: c7cf0af5c90fd8d1e9b3fec4b89206440b47ba8f
2015-11-26 03:07:28 -08:00
Kyle Corbitt b65f1f2234 Use elevation to implement shadows on Android
Summary: This PR includes a working interface to Android's `elevation` property implemented as an RN style. Elevation is the only (easy) [platform-supported way to create shadows](http://developer.android.com/training/material/shadows-clipping.html). For it to work note that you must be running on Android 5.0+, and add `elevation` to a view with a `backgroundColor` set. These are platform limitations.

This PR is not intended to be merged in its current state, but rather to inform the discussion from #2768. At a minimum, before merging we would need to add the elevation style to the docs and rebase this to master (**EDIT** I have now rebased on master because from v0.14.2 too many commits were being pulled in -- haven't tested it since the rebase though). Additionally, it might be good to add tests, although I couldn't find any for the Android code. I'm happy to get that done if this feature gets signed off by the React Native team.

Finally, as I argued in #2768 I think that `elevation` is a useful abstraction ov
Closes https://github.com/facebook/react-native/pull/4180

Reviewed By: svcscm

Differential Revision: D2684746

Pulled By: mkonicek

fb-gh-sync-id: 825f3ccd20c4b0eea9d11b5f0e3a6b018b7e4378
2015-11-25 18:28:29 -08:00
Pieter De Baets 38db6fa465 Remove scrollview support from UIManager, remove mainScrollView(delegate)
Reviewed By: nicklockwood

Differential Revision: D2692749

fb-gh-sync-id: 48975d2f09f3b2902dfa2e56ff9d34257b2395bc
2015-11-25 04:12:34 -08:00
Manuel Nakamurakare 9fc3991615 added method to set thumb image
Summary: this change will allow the slider to have different thumb images .

Sets an image for the thumb. It only supports static images
Closes https://github.com/facebook/react-native/pull/3849

Reviewed By: svcscm

Differential Revision: D2665699

Pulled By: nicklockwood

fb-gh-sync-id: 3a767e43170074e2419067d5c8eae61668ebb5e9
2015-11-24 16:10:04 -08:00
Krzysztof Magiera 469a65217c Add note in View.js render method that wrapper component is not used.
Summary: Got bitten lately by View.js returning different component based on `__DEV__`

Adding a warning in the render method that should make it cleaner in the future that this method is not actually being used in prod mode.
Closes https://github.com/facebook/react-native/pull/4322

Reviewed By: svcscm

Differential Revision: D2691880

Pulled By: vjeux

fb-gh-sync-id: 119672740969a857ab6288b7914d52e8d40a1d95
2015-11-24 13:08:25 -08:00
Roman Telicak 3622e44426 Update removeClippedSubviews prop default value 2015-11-24 16:04:35 +01:00
Spencer Ahrens 598d37f6d5 Quick fix to require cycle in UnimplementedView
Reviewed By: vjeux

Differential Revision: D2686884

fb-gh-sync-id: 99afd8b389d5849d708654a4967dbd403ac24a9b
2015-11-23 14:14:32 -08:00
Martin Konicek b9580511a6 Codemod IntentAndroid.{openURI -> openURL}
Reviewed By: olegbl

Differential Revision: D2680128

fb-gh-sync-id: d9786b6c20d4d6f62cc79fb21ab6861afe30bb54
2015-11-23 11:04:29 -08:00
Martin Konicek 155a609781 Unbreak tests
Summary: The recent commits for RecyclerViewBackedScrollView introduced a bunch of Flow errors.

Disable Flow for now in `ReactNativeViewPool` as it looks like that file doesn't use Flow :)

public

Reviewed By: gabelevi

Differential Revision: D2679974

fb-gh-sync-id: 71512f403e3fa271f6c0fa1a64e877ca1750f675
2015-11-20 09:53:28 -08:00
Krzysztof Magiera 1195f9c8e8 Further improvements in RecyclerViewBackedScrollView.
Summary: public
Changed ListView to use onLayout and onContentSizeChange (new) events instead of measure. Updated ScrollView implementation to support contentSizeChange event with an implementation based on onLayout attached to the content view. For RecyclerViewBackedScrollView we need to generate that event directly as it doesn't have a concept of content view.
This greatly improves performance of ListView that uses RecyclerViewBackedScrollView

Reviewed By: mkonicek

Differential Revision: D2679460

fb-gh-sync-id: ba26462d9d3b071965cbe46314f89f0dcfd9db9f
2015-11-20 07:44:31 -08:00
Krzysztof Magiera 7cd7591f04 Use requireNativeComponent in View.js.
Summary: public
In a previous diff I've removed a need for using View attributes in requireNativeComponent. Thanks to that we can now use requireNativeComponent in View module. In a follow up diff I'll be getting rid of ReactNativeViewAttributes.

Reviewed By: sahrens

Differential Revision: D2676088

fb-gh-sync-id: d5d6e50f4629bd7982b90f3496e1fd22078e96a8
2015-11-20 02:09:38 -08:00
EwanThomas 2faf8632d3 UIRefreshControl added to scroll view
Summary: **What:**

adds `onRefreshStart` property to `ScrollView.js` for displaying and activating pull to refresh.

**Why:**

Javascript implementations seemed a little flakey and inconsistent.  As you can see in the issues below:

https://github.com/facebook/react-native/issues/2356
https://github.com/facebook/react-native/issues/745

So this is an attempt a completely native implementation.

What do you think?

![Image of dog](http://i.imgur.com/HcTQnzJ.gif)
Closes https://github.com/facebook/react-native/pull/4205

Reviewed By: svcscm

Differential Revision: D2674945

Pulled By: nicklockwood

fb-gh-sync-id: 65113a5db9785df5a95c68323c2cdf19f3b217b1
2015-11-19 11:15:48 -08:00
Quentin Valmori 7da42e3950 add allowsInlineMediaPlayback prop to play inline html5 video
Summary: Allow an html5 video to be played inline. (see #3112)
Closes https://github.com/facebook/react-native/pull/3137

Reviewed By: svcscm

Differential Revision: D2674318

Pulled By: nicklockwood

fb-gh-sync-id: cf71e4039c7027f1468370ae3ddef6eb3e2d2d4f
2015-11-19 07:11:29 -08:00
gilchenzion a3d9f5ba84 Add showsCompass to MapView props
Summary: Was trying to remove the compass from the map and thought I would contribute to the project for everyone.
Closes https://github.com/facebook/react-native/pull/4225

Reviewed By: svcscm

Differential Revision: D2674060

Pulled By: nicklockwood

fb-gh-sync-id: 66f069dfc53fdeae8aaab76980146296cea1140f
2015-11-19 02:22:29 -08:00
Krzysztof Magiera dd09c88571 Compose propTypes from View.propTypes where appropriate.
Reviewed By: davidaurelio

Differential Revision: D2668380

fb-gh-sync-id: f34fc8df3bbf755c710e99c5421762406afaba2c
2015-11-18 13:06:27 -08:00
Krzysztof Magiera f2545bafc9 Use requireNativeComponent everywhere.
Reviewed By: sahrens

Differential Revision: D2663780

fb-gh-sync-id: 94a7e2265f6f869a2bdf1576dd8ea76b4c5f0b34
2015-11-18 09:43:28 -08:00
Krzysztof Magiera e6093cff04 Use requireNativeComponent with propTypes for Android components.
Reviewed By: davidaurelio

Differential Revision: D2663502

fb-gh-sync-id: 550e7b7c783ec0463a6beb052c09a768a8086056
2015-11-18 06:36:28 -08:00
sunnylqm b0196a1932 fix typo: showText -> show
Summary: fix typo: showText -> show
Closes https://github.com/facebook/react-native/pull/4140

Reviewed By: svcscm

Differential Revision: D2663635

Pulled By: nicklockwood

fb-gh-sync-id: 3969419e98e8220842494ffc8004b77b6d9a403f
2015-11-17 09:05:30 -08:00
Manuel Nakamurakare 2f23b30624 added a property to set a track image to slider ios
Summary: this change will allow the slider to have different track images.

Sets an image for the sliderIOS's track. It only supports images that are included as assets.
Closes https://github.com/facebook/react-native/pull/3850

Reviewed By: svcscm

Differential Revision: D2659680

Pulled By: nicklockwood

fb-gh-sync-id: faf6ddea1077b081c1fc05f8f110b669cef9902c
2015-11-17 08:45:30 -08:00
Nick Lockwood 7aa789ad57 Fix onSelectionChange "this" binding
Reviewed By: tadeuzagallo

Differential Revision: D2660071

fb-gh-sync-id: 3fc50c0af8566dd7db5a56b220df979625673d07
2015-11-16 14:09:23 -08:00
James Ide f331d2a844 Expose the touch-retention offset as a prop
Summary: The touch-retention offset defines a rect around a touchable component in which the touch is retained. Easiest way to see this is to touch a button in a real navigation bar and slide your finger out of the range and back in. This diff exposes the offset as a prop (I thought touchRetentionOffset was a more informative name than pressRectOffset)

Fixes #198
Closes https://github.com/facebook/react-native/pull/713

Reviewed By: svcscm

Differential Revision: D2115370

Pulled By: shayne

fb-gh-sync-id: c3f57940dfa3806f9c88df03a01d4d65bb58cf32
2015-11-16 13:53:31 -08:00
Nick Lockwood 5a34a097f2 Open sourced the onSelectionChange event
Summary: public

Open-sourced the onSelectionChange event for RCTTextView, and also added onSelectionChange support for RCTTextField.

Reviewed By: javache

Differential Revision: D2647541

fb-gh-sync-id: ab0ab37f5f087e708a199461ffc33231a47d2133
2015-11-14 09:44:30 -08:00
Brent Vatne 50b8b00768 Add setPageWithoutAnimation
Summary: In some cases it's desirable to set the page in the ViewPager without animating it -- we have this in ScrollView with `scrollWithoutAnimationTo`. This PR adds `setPageWithoutAnimation` on ViewPager.

cc ide kmagiera
Closes https://github.com/facebook/react-native/pull/3621

Reviewed By: svcscm

Differential Revision: D2652056

Pulled By: mkonicek

fb-gh-sync-id: 6f1f38558c41ffdd863c0ebb2f046c75b5c0392c
2015-11-13 08:05:27 -08:00
Eric Vicenti 5041171b78 Fix ScrollResponder scrollResponderScrollNativeHandleToKeyboard when kb is offscreen
Summary: public

`scrollResponderScrollNativeHandleToKeyboard` would fail silently if there is no keyboard present. This makes sure to do the correct scrolling behavior, by assuming the screen height is where the keyboard would be located.

This still might not work properly in landscape apps, but it should not make the situation worse

Also fix an issue wehre `scrollResponderKeyboardDidHide` would swallow the event

Reviewed By: vjeux

Differential Revision: D2643477

fb-gh-sync-id: f917390f4709361cc47bcd553b214833422ec05d
2015-11-12 19:17:28 -08:00
Martin Konicek ab7b3b2dea Open source IntentAndroid
Summary: Move the code to the github folder, add more docs and improve the example.

We might want to merge this with `LinkingIOS` later (it has the same functionality
plus support for deep links) but want to see how people use the `IntentAndroid`
API first (and what other methods we should add) to have more data points.

public

Reviewed By: lexs

Differential Revision: D2646936

fb-gh-sync-id: 751f35784d387efcd031f9b458821cdfde048a54
2015-11-12 12:41:32 -08:00
Christopher Dro f407211131 Add keyboardAppearance prop to TextInput component.
Summary: Resolves #3649.
Closes https://github.com/facebook/react-native/pull/4012

Reviewed By: javache

Differential Revision: D2636538

Pulled By: nicklockwood

fb-gh-sync-id: 022e79d8f8fa684cad43af1a51f728d60ac652a8
2015-11-11 05:38:35 -08:00
Krzysztof Magiera 5695ebdcf4 Perf improvements to RecyclerViewBackedScrollView.
Differential Revision: D2641500

fb-gh-sync-id: 7ec6e2863bccebc98f75f586c0f17d509808d46b
2015-11-11 01:21:26 -08:00
Harry Moreno 4386a3664d Note onSubmitEditing is invalid with multiline={true}
Summary: Repeat onSubmitEditing is invalid if mutliline is set to true. Closer to the method's documentation.
Closes https://github.com/facebook/react-native/pull/4008

Reviewed By: svcscm

Differential Revision: D2639710

Pulled By: nicklockwood

fb-gh-sync-id: b7a169f0d21ac53f092278bdd32ee2d79779aa14
2015-11-10 17:34:45 -08:00
Andrei Coman 86c1375c1a Fix test id test case
Differential Revision: D2631505

fb-gh-sync-id: a7a21f114e521ca4ffff9fe9f8408cda70ad5ff3
2015-11-09 06:32:28 -08:00
Ben Alpert bbee3c6f60 Update core libraries for React 0.14 final
Summary: All minor changes since we were already on the beta: most notable is that destructors are required in pooling to help prevent memory leaks.

public

Reviewed By: sebmarkbage

Differential Revision: D2608692

fb-gh-sync-id: acdad38768f7f48c0f0e7e44cbff6f0db316f4ca
2015-11-06 19:52:34 -08:00
Adrov Igor b6340ee2b0 implement android maxlength prop
Summary: Fixes https://github.com/facebook/react-native/issues/3864
But I don't sure that this code is correct.

But it works and works same as in iOS.
Closes https://github.com/facebook/react-native/pull/3873

Reviewed By: mikearmstrong001

Differential Revision: D2626122

Pulled By: andreicoman11

fb-gh-sync-id: 316915c99b218ed5f32ca90fd72ce9810571383a
2015-11-06 13:25:34 -08:00
Alexander Blom 527d11ce01 Support progress in ProgressBarAndroid
Differential Revision: D2626321

fb-gh-sync-id: a358a1db8c8f3b4a41dc9a600ee691e6e60310f3
2015-11-06 12:08:29 -08:00
Alexander Blom a797be6ffd Support 'color' attribute in ProgressBarAndroid
Differential Revision: D2625690

fb-gh-sync-id: 34ef656be7ce3304add3fae3e697c6b39b866af1
2015-11-06 02:34:32 -08:00
Andrei Coman e3b6104810 Fix ViewPager warning
Differential Revision: D2620741

fb-gh-sync-id: 9f35e94efb25c689661bf2775a7d0624b3c586f4
2015-11-05 05:06:33 -08:00
Brent Vatne 0da2004e88 Expose additional private modules
Summary: - TextInputState as TextInput.State
- Touchable
- flattenStyle as StyleSheet.flatten
- ReactNativeART as ART

Original discussion in #1821
Closes https://github.com/facebook/react-native/pull/3308

Reviewed By: sebmarkbage

Differential Revision: D2527152

Pulled By: javache

fb-gh-sync-id: 19d4ef9d4c0e6587b9f0793e1ca624aebb034f3b
2015-11-05 03:35:18 -08:00
Dave Sibiski 7af752403e Implements `blurOnSubmit`
Summary: The default value (to retain current behavior) is set to `true`. Setting the value to `false` will prevent the textField from blurring but still fire the `onSubmitEditing` callback. However, the `onEndEditing` callback will not be fired.

Addresses issue: https://github.com/facebook/react-native/issues/2129
Closes https://github.com/facebook/react-native/pull/2149

Reviewed By: svcscm

Differential Revision: D2619822

Pulled By: nicklockwood

fb-gh-sync-id: 9a61152892f4afb5c6c53e7b38dffae13bc7e13f
2015-11-04 21:05:42 -08:00
Pieter De Baets 0a290e22da Exporting a synchronous UIWebView to JS
Summary: public

Original github title:  Exported a callback for native webview delegate method shouldStartLoadWithRequest

We have a requirement in our app, to open in mobile Safari, any http:// and https:// links displayed in a web view. Our web view is not full screen and is loaded with an HTML string from the backend. Displaying external content in that web view is outside of the scope of our app, so we open them in mobile Safari.

I've forked the WebView component and added a callback property, shouldStartLoadWithRequest, and modified the RCTWebView implementation of `webView:shouldStartLoadWithRequest:navigationType:`
to check if the shouldStartLoadWithRequest property is set.

If the property is set, `webView:shouldStartLoadWithRequest:navigationType:` passes the URL & navigationType to the callback. The callback is then able to ignore the request, redirect it, open a full screen web view to display the URL content, or even deep link to another app with LinkingIOS.openURL().

Original author: PJ Cabrera <pj.cabrera@gmail.com>
Closes https://github.com/facebook/react-native/pull/3643

Reviewed By: nicklockwood

Differential Revision: D2600371

fb-gh-sync-id: 14dfdb3df442d899d9f2af831bbc8d695faefa33
2015-11-04 08:44:29 -08:00
Nick Lockwood d799558db5 Fix Groups text input
Reviewed By: javache

Differential Revision: D2590712

fb-gh-sync-id: 453e20970460c703230547d8fd649383ba7d4c4a
2015-11-04 04:09:27 -08:00
Dave Sibiski 6c7c845145 Implements `onKeyPress`
Summary: - When a key is pressed, it's `key value` is passed as an argument to the callback handler.
 - For `Enter` and `Backspace` keys, I'm using their `key value` as defined [here](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key#Key_values). As per JonasJonny & brentvatne's [suggestion](https://github.com/facebook/react-native/issues/1882#issuecomment-123485883).

- Example
```javascript
 _handleKeyPress: function(e) {
      console.log(e.nativeEvent.key);
  },

  render: function() {
    return (
      <View style={styles.container}>
        <TextInput
            style={{width: 150, height: 25, borderWidth: 0.5}}
            onKeyPress={this._handleKeyPress}
        />
        <TextInput
            style={{width: 150, height: 100, borderWidth: 0.5}}
            onKeyPress={this._handleKeyPress}
            multiline={true}
        />
      </View>
    );
  }
```
- Implements [shouldChangeCharactersInRange](https://developer.apple.com/library/prerelease/ios/documentat
Closes https://github.com/facebook/react-native/pull/2082

Reviewed By: javache

Differential Revision: D2280460

Pulled By: nicklockwood

fb-gh-sync-id: 1f824f80649043dc2520c089e2531d428d799405
2015-11-02 09:15:31 -08:00
aleclarsoniv 97f9aa842c Add 'onMoveShouldSetResponderCapture' to 'propTypes'
Summary: Closes https://github.com/facebook/react-native/pull/3777

Reviewed By: svcscm

Differential Revision: D2602708

Pulled By: javache

fb-gh-sync-id: 8259ffd4cdd3d0c052e94ac50a9020d6da59ded7
2015-10-30 16:38:27 -07:00
Nick Lockwood 0d14d0f1ce Improved SliderIOS
Summary: public

* No longer sends events when not observing valueChanged.
* Snaps to step value while dragging.
* Added additional example to UIExplorer.

Reviewed By: javache

Differential Revision: D2595594

fb-gh-sync-id: 1e92427d2ab2e71e4eb4a9a7a75cd0f5f4a3a529
2015-10-30 09:13:26 -07:00
Ivan Sorokin e409e20d2b Step support for SliderIOS
Summary: Add step support to SliderIOS
Closes https://github.com/facebook/react-native/pull/3746

Reviewed By: svcscm

Differential Revision: D2595360

Pulled By: nicklockwood

fb-gh-sync-id: 4adf8bcdf46c709776d779244ba3de2b40eb27d6
2015-10-30 07:18:28 -07:00
Andr3wHur5t 22cc044a67 Added support for toggling POI visibility on iOS map view.
Summary: Adds support for toggling points of interests visibility on iOS map view; resolving #3244
Closes https://github.com/facebook/react-native/pull/3631

Reviewed By: svcscm

Differential Revision: D2575148

Pulled By: nicklockwood

fb-gh-sync-id: 0d0ee9d3b4726aa40bc439bc2f36d1db4cae1147
2015-10-29 11:02:25 -07:00
Martin Konicek 8167f40163 Document that WebView is iOS-only until we open source the Android implementation
Summary: The absence of docs can be confusing:
https://twitter.com/40_thieves/status/659500246632939520

public

Reviewed By: davidaurelio

Differential Revision: D2595809

fb-gh-sync-id: b741263782ad579bb40e94a383992dca3a6e8040
2015-10-29 10:09:34 -07:00
Manuel Nakamurakare 7d4f5a5c47 added property to sliderIOS to be able to disable it
Summary: added a new property named 'disable' to SliderIOS
this property prevents the user from being able to slide the slider
Closes https://github.com/facebook/react-native/pull/3730

Reviewed By: svcscm

Differential Revision: D2590154

Pulled By: javache

fb-gh-sync-id: b8a9c82c1b05eb813d9b81180cb1083b3f1852ac
2015-10-28 05:48:28 -07:00