Commit Graph

1289 Commits

Author SHA1 Message Date
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
Wenjing Wang 0058b0806b propTypes could be undefined
Summary:
public
This causes a warning since propType not exist

Reviewed By: vjeux

Differential Revision: D2713358

fb-gh-sync-id: 58406d1dc969e6f1d40bee958c28cc87036b30c2
2015-12-02 12:33:30 -08:00
Konstantin Raev 0779dd1e87 Open source the Android NetInfo module
Reviewed By: mkonicek

Differential Revision: D2703432

fb-gh-sync-id: 4a85844f1734ec433df543c89f0fdd56fe5db13c
2015-12-02 11:52:22 -08:00
Nick Lockwood 6d29f710e1 Fixed TextInput on iOS 8 and earlier
Summary:
public

The scrolling fix I added to RCTTextView doesn't work on iOS 8 because the underlying UITextField doesn't resize correctly, which breaks text input functionality. This diff fixes it.

Reviewed By: tadeuzagallo

Differential Revision: D2712618

fb-gh-sync-id: 1d0282df3a16f1cb6ddf9d005d640738bb1b5659
2015-12-02 10:37: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
Nick Lockwood 807e0d9310 Fixed Xcode warnings
Summary:
public

Fixed some Xcode warnings, and added some missing UIResponder methods to make the behavior of RCTTextView more self-consistent.

Reviewed By: javache

Differential Revision: D2712250

fb-gh-sync-id: d30038500194d7a5262d9e77d516c65d836a4420
2015-12-02 08:03:26 -08:00
Nick Lockwood 04187536d1 Fixed threading bug in RCTNetworking
Summary:
public

When uploading images, RCTHTTPFormDataHelper was sometimes accessed on the wrong thread.

Reviewed By: helouree

Differential Revision: D2709186

fb-gh-sync-id: d0a14926927d1d41f602f78a9f6892dfbdfc6ff9
2015-12-02 02:24:27 -08:00
Wenjing Wang 0571250521 8/n Fix warnings at startup
Summary:
public
- Add missing required `key` prop for array of child components

Reviewed By: zjj010104

Differential Revision: D2711271

fb-gh-sync-id: b9848abffd3c458cf45b1231be5eff0a5de805f1
2015-12-01 22:53:30 -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
Nathan Spaun cf892a96d6 Fix NetInfo for Android
Reviewed By: oli

Differential Revision: D2708102

fb-gh-sync-id: f6a12c49c89c46d31114fefaf3e2b1ba72dabdee
2015-12-01 15:14:30 -08:00
Mike Armstrong b6f5c7fa04 Fix systrace profile handling for relay async calls
Reviewed By: astreet

Differential Revision: D2700239

fb-gh-sync-id: eaa29d63ee4f7688dd70b0cdc12564a9d479f9ef
2015-12-01 08:42:24 -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
Aleksei Androsov d08727d99f RCTImagePickerManager crash on image from CameraRoll
Summary: Image from CameraRoll haven't UIImagePickerControllerReferenceURL. So we need to save it to PhotoAlbums first.

To save image I've used the same method from RCTCameraRollManager.
Closes https://github.com/facebook/react-native/pull/4412

Reviewed By: svcscm

Differential Revision: D2707249

Pulled By: nicklockwood

fb-gh-sync-id: eee683bd4179700bed46ebf45e569197f3ad2077
2015-12-01 02:13:28 -08:00
Christopher Dro f025049b6c Add secure and login-password types to AlertIOS.
Summary: Request from issue #3893

* Added support for `secure-text` and `login-password` types to AlertIOS.
* Fixed and extended the cancel button highlighting functionality, which was broken at some point
* Added localization for default `OK` and `Cancel` labels when using UIAlertController

Closes https://github.com/facebook/react-native/pull/4401

Reviewed By: javache

Differential Revision: D2702052

Pulled By: nicklockwood

fb-gh-sync-id: cce312d7fec949f5fd2a7c656e65c657c4832c8f
2015-11-30 19:51:41 -08:00
Huang Yu 7242efde0a fix navigator lint warnings
Summary: fix some lint warnings under `Libraries/CustomComponents/Navigator/` directory
Closes https://github.com/facebook/react-native/pull/4447

Reviewed By: svcscm

Differential Revision: D2706390

Pulled By: ericvicenti

fb-gh-sync-id: 5bfed687265e07a162ffc528a41fa5b0d384f635
2015-11-30 19:31:30 -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
Huang Yu da0744892c fix Library/ReactNative lint warnings
Summary: fix 2 lint warnings under `Libraries/ReactNative` directory
Closes https://github.com/facebook/react-native/pull/4446

Reviewed By: svcscm

Differential Revision: D2705429

Pulled By: nicklockwood

fb-gh-sync-id: a7318ef9d1d194f077b0879fd041c42da5b2dec3
2015-11-30 16:25:46 -08:00
Huang Yu 9f92e91608 fix camera roll lint warnings
Summary: fix lint warnings under `Libraries/CameraRoll` directory
Closes https://github.com/facebook/react-native/pull/4445

Reviewed By: svcscm

Differential Revision: D2705430

Pulled By: nicklockwood

fb-gh-sync-id: b5a179750a6696836cf458bc8e646e6b8a23fd98
2015-11-30 16:25:41 -08:00
Huang Yu 0c8bafe84a fix library/utility lint warnings
Summary: I have disected lint warnings fixes to several PRs. This one fixes lint warnings under Libraries/Utility path.
Closes https://github.com/facebook/react-native/pull/4444

Reviewed By: svcscm

Differential Revision: D2705303

Pulled By: spicyj

fb-gh-sync-id: c745ac62cbff30d6bb9478a1d2465fe56b305f0c
2015-11-30 16:15:30 -08:00
Nick Lockwood 94f126ddbf Fixed TextInput.blur()
Reviewed By: helouree

Differential Revision: D2704065

fb-gh-sync-id: a4f5aa9c9b4fcb7980eb85289d16982840a980bd
2015-11-30 14:32:06 -08:00
Aleksei Androsov 015c6b3be2 ImagePicker always called with cancelCallback
Summary: We should pick 2 callbacks from pickerCallbacks and pickerCancelCallbacks arrays and call them depens on args.
Closes https://github.com/facebook/react-native/pull/4411

Reviewed By: svcscm

Differential Revision: D2703209

Pulled By: javache

fb-gh-sync-id: 7d2d7c63b933a66a1ff600663c3a7fcc821c750b
2015-11-30 10:33:59 -08:00
Danny Arnold df70005c12 calling navigationBar's overridden ref function
Summary: Before that it was not possible to get a ref to a navigation bar (unless using Navigator's internal `_navBar` prop)
Closes https://github.com/facebook/react-native/pull/3755

Reviewed By: svcscm

Differential Revision: D2674315

Pulled By: nicklockwood

fb-gh-sync-id: 26120f7bcbb675e8217b8bd963dcc6ed314d4ba3
2015-11-30 08:32:23 -08:00
Andreas Amsenius 0f0b57880f ActionSheetIOS sharing exclude activity types
Summary: Closes https://github.com/facebook/react-native/pull/4427

Reviewed By: svcscm

Differential Revision: D2702825

Pulled By: nicklockwood

fb-gh-sync-id: f12e83332f2083cee2c04625b5113774c8a907e0
2015-11-30 06:20:30 -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 01a0facf33 Fixed onFocus/onBlur events for multiline TextInput
Summary: public

onFocus and onBlur were not firing for multiline TextInputs.

Reviewed By: tadeuzagallo

Differential Revision: D2699846

fb-gh-sync-id: 7e64309bc631a42a99f989f615fef927dc50217c
2015-11-27 07:47:28 -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
Mike Armstrong af753a8a4d Add NativeProfiling module that uses RN nativeProfiler or console.profile
Reviewed By: jspahrsummers

Differential Revision: D2696072

fb-gh-sync-id: 6a2b9793424cf9a82b9472e6d468cbd81dd6780a
2015-11-27 04:44:25 -08:00
Mike Armstrong e1533fdff6 Move BridgeProfile call to give better systrace info
Reviewed By: tadeuzagallo, sahrens

Differential Revision: D2697510

fb-gh-sync-id: 00ec4d5835331b78c554c904dd29661dad9f6f97
2015-11-27 01:19:25 -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
Andy Street a636ddd9f0 Backout D2677289 [react_native] View recycling in JS
Summary: public

We're seeing related crashes. The diff has no tests, the perf tests weren't conclusive, and the person who'd be supporting it no longer is available to work on it. We can try this again later in a less rushed manner with proper perf testing.

Reviewed By: davidaurelio

Differential Revision: D2696615

fb-gh-sync-id: 3b6814ac12af19516146d5c42d2add8321b10db5
2015-11-26 08:41:27 -08:00
Pieter De Baets bb11e05c33 Default empty view to RCTView with position: absolute
Reviewed By: spicyj, davidaurelio

Differential Revision: D2693494

fb-gh-sync-id: fc00b995d7d4fdaaedf4c3e5382354f0a1f4ac23
2015-11-26 08:12:28 -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
Brent Vatne ae09a10c95 Add onLoadX support on Android
Summary: ~~This is a WIP, just finished the first bit and wanted to get some feedback to see if this approach seems appropriate, as I haven't done a lot of Android development.~~

Looks ready for review now.
Closes https://github.com/facebook/react-native/pull/3791

Reviewed By: svcscm

Differential Revision: D2672262

Pulled By: mkonicek

fb-gh-sync-id: 1e8f1cc6658fb719a68f7da455f30a7c9b1db730
2015-11-25 18:30:31 -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
Chester Wood e966cd1041 Set navigator.product to ReactNative
Summary: Fix for [Issue 1331](https://github.com/facebook/react-native/issues/1331). Sets navigator.product to ReactNative and navigator.productSub to the version string in package.json.

Note that the code requires package.json, which works fine in the RN packager, but webpack users will probably a need to configure a json loader in their config file.

Tested using UIExplorer and console.log printout of the product variables in xcode and Chrome debugger.
Closes https://github.com/facebook/react-native/pull/4083

Reviewed By: svcscm

Differential Revision: D2696881

Pulled By: vjeux

fb-gh-sync-id: 511446432dcd0ec658100715129c77153e743423
2015-11-25 12:45:28 -08:00
Milen Dzhumerov a663d4d8d5 Use for-loop instead of forEach() in a hot path
Summary: public

Replaces the usage of forEach() with a for loop on a hot code path

Reviewed By: tadeuzagallo

Differential Revision: D2690727

fb-gh-sync-id: b7cbcda5cf80a0e31753f49c01e145abb789f3e5
2015-11-25 07:24:31 -08:00
Milen Dzhumerov 638fd11c5c Revert 3770f061c832 for further investigation
Reviewed By: idevelop

Differential Revision: D2695659

fb-gh-sync-id: b1ba529c648681faef5d4f07273722764722fbe1
2015-11-25 05:24:28 -08:00
Nick Lockwood 060664fd3d Refactored module access to allow for lazy loading
Summary: public

The `bridge.modules` dictionary provides access to all native modules, but this API requires that every module is initialized in advance so that any module can be accessed.

This diff introduces a better API that will allow modules to be initialized lazily as they are needed, and deprecates `bridge.modules` (modules that use it will still work, but should be rewritten to use `bridge.moduleClasses` or `-[bridge moduleForName/Class:` instead.

The rules are now as follows:

* Any module that overrides `init` or `setBridge:` will be initialized on the main thread when the bridge is created
* Any module that implements `constantsToExport:` will be initialized later when the config is exported (the module itself will be initialized on a background queue, but  `constantsToExport:` will still be called on the main thread.
* All other modules will be initialized lazily when a method is first called on them.

These rules may seem slightly arcane, but they have the advantage of not violating any assumptions that may have been made by existing code - any module written under the original assumption that it would be initialized synchronously on the main thread when the bridge is created should still function exactly the same, but modules that avoid overriding `init` or `setBridge:` will now be loaded lazily.

I've rewritten most of the standard modules to take advantage of this new lazy loading, with the following results:

Out of the 65 modules included in UIExplorer:

* 16 are initialized on the main thread when the bridge is created
* A further 8 are initialized when the config is exported to JS
* The remaining 41 will be initialized lazily on-demand

Reviewed By: jspahrsummers

Differential Revision: D2677695

fb-gh-sync-id: 507ae7e9fd6b563e89292c7371767c978e928f33
2015-11-25 04:49:45 -08:00
Pieter De Baets bba71f146d Defer rendering events popover until required
Reviewed By: davidaurelio

Differential Revision: D2690835

fb-gh-sync-id: 1d17c20b308e364c49f868d8861c6ad93957bffe
2015-11-25 04:15:27 -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
Milen Dzhumerov fc5a8678d3 Implement efficient DiskCache.clear()
Summary: public

Ability to efficiently remove all keys with a particular prefix

Reviewed By: tadeuzagallo

Differential Revision: D2658741

fb-gh-sync-id: 3770f061c83288efe645162ae84a9fd9194d2fd6
2015-11-25 03:23:36 -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
Nick Lockwood b5be05d82b Fix flaky scrolling for TextInput when using rich text
Summary: public

This diff fixes the jumpy scrolling for multiline `<TextInput>` when using nested `<Text>` components to implement rich text highlighting.

The fix is to disable scrolling on the underlying UITextView, and nest it inside another UIScrollView that we control.

Reviewed By: ericvicenti, tadeuzagallo

Differential Revision: D2674670

fb-gh-sync-id: bacee3ae485523cc26ca8102b714e081df230629
2015-11-24 15:38:27 -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
Tim Yung 2c14ab582a RN: Add "Dismiss All" to YellowBox
Summary: Adds a "Dismiss All" button to YellowBox for people who see litter on the ground and continue walking. (Just kidding).

public

Reviewed By: vjeux

Differential Revision: D2691764

fb-gh-sync-id: 9746b42bc1e5dc51f2320880f47f8cb17b952570
2015-11-24 11:37:31 -08:00
Alexey Lang b4beba5217 Fix logging JSAppRequireTime
Reviewed By: andreicoman11

Differential Revision: D2690760

fb-gh-sync-id: 41e88c48deec05539e7681862d794ed650b81bfa
2015-11-24 10:20:28 -08:00
Konstantin Raev 37f81341a0 Open source SwipeRefreshLayoutAndroid
Reviewed By: mkonicek

Differential Revision: D2679605

fb-gh-sync-id: 7f3e7384b37f29002ddd8cb7a4567fa96c76f047
2015-11-24 10:15:14 -08:00
Roman Telicak 3622e44426 Update removeClippedSubviews prop default value 2015-11-24 16:04:35 +01:00