Commit Graph

550 Commits

Author SHA1 Message Date
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
Nick Lockwood b0b9a56ef8 Fixed ActivityIndicatorIOS layout
Summary: public

This has been broken for a while. The styles in the JS were being set on the container instead of the activity view itself.

Also, due to the way frames were set directly on layer properties instead of the view, resizing didn't work properly because the UIImageView inside the UIActivityView was not being realligned when the bounds changed. This also caused problems for other controls such as maps, where it was fixed with a method override, but the simpler solution is just to set the view center and bounds directly.

Before: {F23631143}
After: {F23631144}

Reviewed By: javache, tadeuzagallo

Differential Revision: D2575156

fb-gh-sync-id: e82e56d36648e7c924df77da1750e03037b5d5be
2015-10-23 09:13:24 -07:00
Charles Marsh 66717d802b Allow for styling of ToolbarAndroid's overflow icon
Summary: Fixes #2858.

Here's a screenshot of the custom overflow icon in action:
<img width="638" alt="overflow" src="https://cloud.githubusercontent.com/assets/1309177/10567090/693e395a-75ae-11e5-84cd-20b19149c620.png">
Closes https://github.com/facebook/react-native/pull/3497

Reviewed By: svcscm

Differential Revision: D2559787

Pulled By: foghina

fb-gh-sync-id: f188711ec094af3fa307722527f22aefff722e64
2015-10-22 04:43:25 -07:00
Krzysztof Magiera 8e2ec64763 Use RecyclerViewBackedScrollView in groups feed on Android.
Differential Revision: D2549975

fb-gh-sync-id: 98689a58a69ce8425c695acf74701509816821ae
2015-10-16 07:45:22 -07:00
Jihyun Yu 79e33078f2 Fix minor typos on documentation
Summary: Closes https://github.com/facebook/react-native/pull/2742

Reviewed By: @​svcscm

Differential Revision: D2549690

Pulled By: @javache

fb-gh-sync-id: 84cb3aa78c2c75bae24a8cc7c1b96e219c9a0552
2015-10-16 03:49:25 -07:00
Krzysztof Magiera f47e8ac6a1 Instrumentation test for native listview component.
Differential Revision: D2549707

fb-gh-sync-id: c9ff379383853c198274778e99a72b313d9dbda9
2015-10-16 03:41:18 -07:00
Ben Alpert 84df87ef64 Fix React warnings
Reviewed By: @sebmarkbage

Differential Revision: D2548854

fb-gh-sync-id: 9ace9ce57641e2dcaae997358e6404044d871f82
2015-10-16 03:41:14 -07:00
Krzysztof Magiera 1e52b8297c Wrapper for android RecyclerView to be used by ListView.js
Differential Revision: D2545291

fb-gh-sync-id: 5d745939f6d63aea4cd9bba2f55e68336efc1e9a
2015-10-15 09:22:31 -07:00
Michal Aichinger d0e40c581d Fixes a path in touchableHandlerResponderGrant method when touchableGetPressRectOffset method is not present.
Summary: Current code is checking presence of touchableGetPressRectOffset method but fails immediately on trying to get 'left' value of null.
Closes https://github.com/facebook/react-native/pull/3438

Reviewed By: @​svcscm

Differential Revision: D2545068

Pulled By: @javache

fb-gh-sync-id: d16cb46af1fc6eae02f56b2096c2169ce475e022
2015-10-15 09:22:29 -07:00
Ben Alpert 5e33dbcfcc Move stuff out of vendor/react_contrib/
Summary: This was a confusing place for them. BoundingDimensions, Position, and Touchable were only used in Touchable; StaticContainer I moved to Libraries/Components.

@​public

Reviewed By: @vjeux

Differential Revision: D2530730

fb-gh-sync-id: e636a6b7259c2bd3ab52c82ebd59a6c66c9e7e7a
2015-10-12 11:18:30 -07:00
Emmanouil Konstantinidis c16c3f9814 Fix typo - Remove duplicated "to have"
Summary: Closes https://github.com/facebook/react-native/pull/3015

Reviewed By: @​svcscm

Differential Revision: D2530576

Pulled By: @vjeux

fb-gh-sync-id: e7df3706f3c733e8de32c1f123d951b488133e8a
2015-10-11 21:14:54 -07:00
James Ide 2c7de35dee Export per-platform NavigatorNavigationBarStyles for consistent styling
Summary: This allows for the iOS-style navigation bar on Android and vice versa in order to simplify design. It is entirely optional in that NavigationBars will continue to defauly to their platform-specific style, but you can override it with the `navigationStyles` prop:

```js
<Navigator.NavigationBar
  navigationStyles={Navigator.NavigationBar.StylesIOS}
/>
```

Fixes #2995.
Closes https://github.com/facebook/react-native/pull/3028

Reviewed By: @​svcscm

Differential Revision: D2527902

Pulled By: @ericvicenti

fb-gh-sync-id: c7b1bfac200b5e03fc0d9dfb8acc8b916c825595
2015-10-10 15:32:46 -07:00
Jiajie Zhu c86966c150 fix breadcrumb icon offset
Reviewed By: @fkgozali

Differential Revision: D2528804

fb-gh-sync-id: 6ed9e9ce330ecc147c3fb8217c7b1b0986c862fe
2015-10-09 17:53:26 -07:00
Ben Alpert ab6f375c66 Log React warnings internally, fix warnings in Android tests
Reviewed By: @javache

Differential Revision: D2517993

fb-gh-sync-id: c91a42a0abe4037b72c4497a5dc8b52a922fbf98
2015-10-09 09:33:24 -07:00
Brent Vatne 1fd2e176ae Fix broken code block and make the example nicer
Summary: @​kmagiera @mkonicek - made a mistake while updating it, removed the `margin` style for some reason on the inner Text (it was 1am, ¯\_(ツ)_/¯). This also makes the example nicer looking - style the navigation with a white background, center the text in the main content view.

![](http://url.brentvatne.ca/16xXe.png)
![](http://url.brentvatne.ca/1a4Jt.png)
Closes https://github.com/facebook/react-native/pull/2682

Reviewed By: @​svcscm

Differential Revision: D2454465

Pulled By: @mkonicek

fb-gh-sync-id: 2fa17366b34ae31c490d37791ad693c17ac3f128
2015-10-08 14:01:52 -07:00
Martin Konicek 0a419650ce Open source ViewPagerAndroid
Reviewed By: @foghina

Differential Revision: D2513014

fb-gh-sync-id: d9bb668d76939ad85b657233c8b7beac9b244fab
2015-10-06 20:01:21 -07:00
Sebastian Markbage 6244fd003d Refactor Attribute Processing (Step 3)
Reviewed By: @spicyj

Differential Revision: D2514193

fb-gh-sync-id: 8ba55014e8d052c69d8e1def327284ec974d6837
2015-10-06 15:36:32 -07:00
Spencer Ahrens 36cbe74f99 introduce universal switch
Reviewed By: @vjeux, @mkonicek

Differential Revision: D2441456

fb-gh-sync-id: c4050ec86f30234ea29c38205d668157bde65a35
2015-10-06 10:29:22 -07:00
Felix Oghina 8f7748748e Revert [React Native] Refactor Attribute Processing (Step 3)
Reviewed By: @kmagiera, @mikearmstrong001

Differential Revision: D2512548

fb-gh-sync-id: bcae3a8c85bfcfa468f2128288a25f406d78cf08
2015-10-06 10:29:18 -07:00
Sebastian Markbage ac5b7548d2 Refactor Attribute Processing (Step 3)
Summary: Decouple processStyle from the main reconciliation. It is now a process
extension to the style attribute `transform`. This effectively decouples a
large portion of special cases and helper dependencies from the reconciler.

The transform attribute becomes translated into the transformMatrix attribute on
the native side so this becomes a little weird in that I have to special case
it. I don't think it is worth while having a general solution for this so I
intend to rename the native attribute to `transform` and just have it accept the
resolved transform. Then I can remove the special cases.

The next step is generalizing the flattenStyle function and optimizing it.

@​public

Reviewed By: @vjeux

Differential Revision: D2460465

fb-gh-sync-id: 243e7fd77d282b401bc2c028aec8d57f24522a8e
2015-10-06 10:28:41 -07:00
Sebastian Markbage 8e3ce0ff98 Refactor Attribute Processing (Step 2)
Summary: Move the ViewAttributes and StyleAttributes configuration into the
Components library since they're coupled and change with the
native component configuration.

This also decouples StyleAttributes from the reconciler by adding it
to the ReactViewAttributes.

To do that, I refactored the property diffing to allow for recursive
configurations. Now an attribute configuration can be a nested object,
a custom configuration (diff/process) or true.

The requireNativeComponent path incorrectly gets its attributes set up
on the root validAttributes instead of the nested style object.
So I also have to add the nested form. Effectively these currently allow
these attributes on props or nested.

@​public

Reviewed By: @vjeux

Differential Revision: D2456842

fb-gh-sync-id: cd5405bd8316c2fcb016d06c61244ce7719c26c0
2015-10-06 10:28:35 -07:00
Andrei Coman 166a96bcee Fix keyboardShouldPersistTaps default value
Reviewed By: @astreet

Differential Revision: D2507878
2015-10-05 10:25:21 -07:00
Alex Kotliarskyi de736227fa Add packager-managed assets support to NavigatorIOS
Reviewed By: @vjeux

Differential Revision: D2500520
2015-10-02 12:02:29 -07:00
Harry Moreno b1c8e490e0 Add docs for View BorderWidth
Summary: Closes https://github.com/facebook/react-native/pull/3133

Reviewed By: @​svcscm

Differential Revision: D2502503

Pulled By: @mkonicek
2015-10-02 04:13:24 -07:00
Harry Moreno 90fc8a30dd Format Code in TextInput Comment
Summary: * wrap code snippet in TextInput Comment in backticks ```
* unless there is a way to omit portions of comments from reaching the
docs this is less confusingCloses https://github.com/facebook/react-native/pull/3085

Reviewed By: @​svcscm

Differential Revision: D2495630

Pulled By: @frantic
2015-09-30 21:02:44 -07:00
Felix Oghină 5ca5ec7688 add remote image support to toolbar
Differential Revision: D2493627
2015-09-30 09:21:27 -07:00
Alex Kotliarskyi f07dd70051 Managed assets support for RCTConvert
Reviewed By: @nicklockwood

Differential Revision: D2443130
2015-09-29 09:21:39 -07:00
Olivier Notteghem 3f213e37d3 Fix scrollTo() method to pass integer as opposed to float
Reviewed By: @​nspaun

Differential Revision: D2480775
2015-09-25 13:01:25 -07:00
Andrei Coman d1e316fce3 Remove text input warnings
Reviewed By: @mkonicek

Differential Revision: D2471396
2015-09-23 19:29:04 -07:00
rxb dcf245a9a2 Definable distance pagination for ScrollView
Summary: This is an enhancement for ScrollView that adds the ability to paginate based on a width other than the width of the ScrollView itself. This is a fairly common pattern used on apps like Facebook, App Store, and Twitter to scroll through a horizontal set of cards or icons:

![img_8726 2](https://cloud.githubusercontent.com/assets/451050/8017899/39f9f47c-0bd2-11e5-9c1d-889452f20cf7.PNG) ![img_8727 2](https://cloud.githubusercontent.com/assets/451050/8017898/39f962dc-0bd2-11e5-98b4-461ac0f7f21b.PNG)  ![img_8728 2](https://cloud.githubusercontent.com/assets/451050/8017900/39fd91a4-0bd2-11e5-8786-4cf0316295a0.PNG)

After trying to accomplish this only with JS, it appears that attempting to take over an in-progress native scroll animation with JS is always going to result in some amount of jankiness and jumping.

This pull request uses `scrollViewWillEndDragging` in RCTScrollView.m to adjust `targetContentOffset` based on two new optional props added to ScrollView. `snapToInterval` sets the multiple that the
Closes https://github.com/facebook/react-native/pull/1532

Reviewed By: @​svcscm, @​trunkagent

Differential Revision: D2443701

Pulled By: @vjeux
2015-09-23 11:47:25 -07:00
alvaromb b9ef384f74 Updated TouchableHighlight docs
Summary: ``onlyChild`` restriction is implemented in ``TouchableHighlight``, not ``TouchableOpacity``.
Closes https://github.com/facebook/react-native/pull/2542

Reviewed By: @​svcscm

Differential Revision: D2471539

Pulled By: @vjeux
2015-09-23 11:25:34 -07:00
James Ide 3b68869fc8 Add scrollWithoutAnimationTo to Android
Summary: `ScrollView.scrollWithoutAnimationTo` is supported on iOS but not Android. This is an existing API, and this diff adds Android support.

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

Reviewed By: @​svcscm

Differential Revision: D2452630

Pulled By: @mkonicek
2015-09-23 05:58:27 -07:00
Colin Parsons 972ae4c186 fix minor grammar and typo errors in comments
Summary: comments only. no code modified.
Closes https://github.com/facebook/react-native/pull/2038

Reviewed By: @​svcscm

Differential Revision: D2468021

Pulled By: @vjeux
2015-09-22 14:41:28 -07:00
Jason Als f762a55abd Wrong function name
Summary: RippleAndroid is actually Ripple
Closes https://github.com/facebook/react-native/pull/2710

Reviewed By: @​svcscm

Differential Revision: D2452607

Pulled By: @mkonicek
2015-09-21 09:00:34 -07:00
alantrrs c6495531fb Fix typo on example code
Summary: Closes https://github.com/facebook/react-native/pull/2828

Reviewed By: @​svcscm

Differential Revision: D2457233

Pulled By: @foghina
2015-09-18 10:32:32 -07:00
ChristianHersevoort b6cb0e1246 Fixed typo in TouchableNativeFeedback docs
Summary: Closes https://github.com/facebook/react-native/pull/2843

Reviewed By: @​svcscm

Differential Revision: D2457197

Pulled By: @foghina
2015-09-18 10:32:25 -07:00
Hedger Wang 1fd27dae5e Fix crash on RC while toggling object status.
Reviewed By: @​chaceliang

Differential Revision: D2454891
2015-09-17 17:20:51 -07:00
Alexsander Akers 9a2d05d9b2 Move color processing to JS
Reviewed By: @vjeux

Differential Revision: D2346353
2015-09-17 17:20:45 -07:00
Hedger Wang bab9bfec3a Fix crash on RC while toggling object status.
Reviewed By: @​chaceliang

Differential Revision: D2446382
2015-09-16 15:35:35 -07:00
facebook-github-bot-6 0d09f22dbf Get back 100% in sync with fb codebase 2015-09-16 10:30:53 -07:00
Martin Konicek 42eb5464fd Release React Native for Android
This is an early release and there are several things that are known
not to work if you're porting your iOS app to Android.

See the Known Issues guide on the website.

We will work with the community to reach platform parity with iOS.
2015-09-14 18:13:39 +01:00
Andrei Coman eb48759675 Add License headers to .js files
Differential Revision: D2438967

committer: Service User <svcscm@fb.com>
2015-09-14 07:40:31 -07:00
Dorota Kapturkiewicz d7ee28e079 fix ToastAndroid
Differential Revision: D2433671

committer: Service User <svcscm@fb.com>
2015-09-11 07:50:29 -07:00
Nick Lockwood 33036b1f01 Fixed DatePickerIOS onChange event
Reviewed By: @javache

Differential Revision: D2429598
2015-09-10 10:10:26 -07:00
Dorota Kapturkiewicz 4a4f087a9c move Toast to oss
Summary: Importing JS changes to fbobjc which should be maintained as a source of truth
for React Native JS files. For more details about this change, please refer to
the original diff in fbandroid repo: D2410797

Reviewed By: @andreicoman11

Differential Revision: D2424679
2015-09-09 11:25:22 -07:00
Christopher Chedeau a9607901e2 Updates from Tue 8 Sep 2015-09-08 16:54:44 -07:00
Chace Liang c971aae676 [RN][Accessibility] typo in onAccessibilityTap 2015-09-08 10:40:28 -08:00
Nacho Lopez Sais 551815c1cf Adapted changes from android repo for TextInput numberOfLines 2015-09-08 10:25:13 -08:00
Chace Liang 836e4c03fc [RN][Accessibility] Expose accessibilityTraits and accessibilityComponentType props to Touchable* component 2015-09-03 12:16:21 -08:00
Spencer Ahrens d7b13fb32b Updates from Thu Sep 3rd. 2015-09-03 12:55:40 -07:00
Nick Lockwood aa62a5e4e0 Send layout events on shadow queue
Summary:
We currently wait until after views have been updated on the main thread before sending layout events. This means that any code that relies on those events to update the UI will lag the atual layout by at least one frame.

This changes the RCTUIManager to send the event immediately after layout has occured on the shadow thread. This noticably improves the respinsiveness of the layout example in UIExplorer, which now updates the dimension labels immediately instead of waiting until after the layout animation has completed.
2015-09-03 03:42:26 -08:00
Nick Lockwood 848839858b Added mechanism for directly mapping JS event handlers to blocks
Summary:
Currently, the system for mapping JS event handlers to blocks is quite clean on the JS side, but is clunky on the native side. The event property is passed as a boolean, which can then be checked by the native side, and if true, the native side is supposed to send an event via the event dispatcher.

This diff adds the facility to declare the property as a block instead. This means that the event side can simply call the block, and it will automatically send the event. Because the blocks for bubbling and direct events are named differently, we can also use this to generate the event registration data and get rid of the arrays of event names.

The name of the event is inferred from the property name, which means that the property for an event called "load" must be called `onLoad` or the mapping won't work. This can be optionally remapped to a different property name on the view itself if necessary, e.g.

  RCT_REMAP_VIEW_PROPERTY(onLoad, loadEventBlock, RCTDirectEventBlock)

If you don't want to use this mechanism then for now it is still possible to declare the property as a BOOL instead and use the old mechanism (this approach is now deprecated however, and may eventually be removed altogether).
2015-09-02 06:11:24 -08:00
Hedger Wang 36dfd402b2 [madman] Supports `onLayout` for `AdsManagerTouchableHighlight`.
Summary:
Supports `onLayout` for Touchable*` by piping onLayout
through to the native component inside since only native components support
it by default.
2015-09-01 10:22:47 -08:00
Spencer Ahrens 465f539057 Updates from Mon Aug 31st. 2015-08-31 16:31:41 -07:00
Nick Lockwood fa6bc1c3cd Fixed WebView example 2015-08-27 14:08:17 -08:00
Andy Street a9115bcbb3 [ReactNative][SyncDiff] Add parameter to allow turning on/off off screen rendering for alpha compositing 2015-08-26 15:15:36 -08:00
Martin Konicek 590156a360 More updates from Wed 26 Aug 2015-08-26 18:52:03 +01:00
Andrei Coman f2da308928 [ReactNative] Add unimplemented views for some components 2015-08-26 05:47:12 -08:00
Martin Konicek 5526533f51 Updates from Wed 26 Aug 2015-08-26 14:04:01 +01:00
Andrei Coman a8f11d7115 [ReactNative] Add TouchableNativeFeedback to OSS 2015-08-26 01:31:52 -08:00
Andy Street 504fa60168 [ReactNative][SyncDiff] AutoSync 2015-08-25 14:54:10 -08:00
Martin Konicek da7ac11c53 Updates from Tue 25 Aug 2015-08-25 19:21:59 +01:00
Martin Konicek 5f8c0613fe [ReactNative] Temporarily disable flow in TabBarItemIOS 2015-08-25 07:16:35 -08:00
Nick Lockwood 65a3c07cfe Fixed tab bar icon scale
Summary:
TabBarItemIOS supports setting the scale for base64-encoded images using an optional scale parameter, however this was broken due to the JS code only passing the uri, not the whole source object, to the native side.

(See: https://github.com/facebook/react-native/issues/2413)
2015-08-25 05:26:14 -08:00
Dorota Kapturkiewicz f128269da7 [ReactNative] make radiobutton work with accessibility 2015-08-21 07:23:04 -07:00
Bill Fisher debca6d24f [ReactNative] Pass events through to touchable handlers
Summary:
We want to be able to access the touch data within our components' event handlers, so we need to thread the event object all the way through to them.
2015-08-21 03:03:32 -07:00
Alexsander Akers dc01ecbc98 Remove now useless comment 2015-08-14 04:46:26 -08:00
Dorota Kapturkiewicz a2c51b3b28 [ReactNative] expose importantForAccessibility to JS 2015-08-14 03:28:22 -08:00
Andrei Coman e9735556f6 [ReactNative] Sync [react_native] Fix keyboard behavior for android 2015-08-14 02:58:37 -08:00
Martin Konicek c483db1b88 [ReactNative] Open source ProgressBarAndroid, remove example from the RN launcher 2015-08-12 12:02:17 -08:00
Chace Liang eb402d8c7d [e2e] Fix TouchableHighlight in e2e test 2015-08-11 10:53:50 -08:00
Christopher Chedeau 0d636a017d Updates from Tue 11 Aug 2015-08-11 08:42:07 -07:00
Dorota Kapturkiewicz 59b974eafb [ReactNative] make AdsManager floater and TouchableHighlight accessible 2015-08-10 04:41:09 -08:00
Felix Oghină 205a2c0bfc [react_native] JS files from D2318945: Implement a slider for React Native Android 2015-08-07 10:15:52 -08:00
Andy Street 1d452f3e4d [ReactNative] Remove testID from root view 2015-08-07 05:23:40 -08:00
Andrei Coman 327f84b967 [ReactNative] Sync [react_native] Implement TextInput editable 2015-08-06 11:07:06 -08:00
Andrei Coman 0d981c06de [ReactNative] Sync [react_native] Text Input missing letters fix 2015-08-06 04:59:09 -08:00
James Ide d4eac3ddca [RFC][Rendering] Add shouldRasterizeIOS to View components
Summary:
Exposes the `shouldRasterize` property. Fixes #1986.
Closes https://github.com/facebook/react-native/pull/2226
Github Author: James Ide <ide@jameside.com>
2015-08-04 15:37:38 -08:00
Philipp von Weitershausen 3e79838a31 [React Native] sync JS for D2287297 2015-07-31 21:31:46 -08:00
Krzysztof Magiera b807c51bbe [ReactNative] Fix TextInput Focus issue 2015-07-31 11:03:41 -08:00
Dorota Kapturkiewicz 8a272bc873 [ReactNative] implement accessibilityLiveRegion and accessibilityComponentType 2015-07-30 01:40:37 -08:00
Dorota Kapturkiewicz e073fdc4c7 [ReactNative] add accessibilityComponentType 2015-07-29 09:20:23 -08:00
Alex Kotliarskyi 2eb401a496 Updates from 2015-07-27 2015-07-27 10:01:30 -07:00
Martin Konicek c3d194d1f8 [ReactNative] TextInput docs 2015-07-27 06:45:13 -08:00
Spencer Ahrens f1bd1cbc94 [ReactNative] cleanup native components 2015-07-24 18:54:35 -08:00
Matej Hamas 000ab1139f [ReactNative] Adding clear function to the react native TextInput component. 2015-07-24 09:46:01 -08:00
Rui Chen accf6f12e4 Make the scrollResponderScrollNativeHandleToKeyboard works on Android 2015-07-23 18:14:43 -08:00
Ben Alpert e01f90784f [ReactNative] Update core RN modules to work with React 0.14-beta1 2015-07-23 18:07:59 -08:00
Mark Miyashita 10ffe170c2 [StatusBar] Add ability to toggle the network activity indicator in the status bar + example in UIExplorer
Summary:
Added the ability to turn on and off the network activity indicator using:

```
StatusBarIOS.setNetworkActivityIndicatorVisible(true)
```
and
```
StatusBarIOS.setNetworkActivityIndicatorVisible(false)
```

Also added an example to the UIExplorer example app.

Fix #986
Closes https://github.com/facebook/react-native/pull/2079
Github Author: Mark Miyashita <negativetwelve@gmail.com>
2015-07-23 16:22:56 -08:00
Alex Kotliarskyi 03dccfbf71 Updates from Thu, July 23 2015-07-23 13:09:48 -07:00
Martin Konicek 19a8eff668 [ReactNative] ScrollView docs
Summary:
In preparation for open sourcing React Native for Android, document which ScrollView props are platform-specific.
2015-07-23 06:56:46 -08:00
Christopher Chedeau b34892eb80 [ReactNative][BREAKING_CHANGE] Remove cloneElement from TouchableBounce 2015-07-22 17:22:35 -08:00
Rui Chen 93bbc6482d Unbreak the dismissing keyboard behavior on Android 2015-07-22 15:24:42 -08:00
Spencer Ahrens bb7aa500d7 Updates from Thurs July 23rd 2015-07-23 01:16:05 +02:00
Spencer Ahrens cec5360f1b [RN] Introduce initialValue prop to fix TextInputExamples
Summary:
Some of the examples relied on the fact that TextInput wasn't a controlled
component before.  This introduces a new `initialValue` prop which behaves the
way the `value` prop used to - that is, you could type without updating it and
it wouldn't get reset, thus acting as just an initial value - and switches the
examples to use it where appropriate.
2015-07-22 14:21:16 -08:00
Spencer Ahrens 961c1eb429 [ReactNative] TextInput bug fixes and features
Summary:
This introduces event counts to make sure JS doesn't set out of date values on
native text inputs, which can cause dropped characters and can mess with
autocomplete, and obviates the need for the input buffering which added lag and
complexity to the component.  Made sure to test simulated super-slow JS text
event processing to make sure characters aren't dropped, as well as typing
obviously correctable words and making sure autocomplete works as expected.

TextInput is now a controlled input by default without causing any issues for
most cases, so I removed the `controlled` prop.

Fixes selection state jumping by restoring it after setting new text values, so
highlighting the middle of some text in the new ReWrite example and hitting
space will replace that selection with an underscore and keep the cursor at a
sensible position as expected, instead of jumping to the end.

Ads `maxLength` prop to support the most commonly needed syncronous behavior:
preventing the user from typing too many characters.  It can also be used to
prevent users from continuing to type after entering special characters by
changing it to the current length after a regex match.  Made sure to verify it
works well with pasted input (including in the middle of existing text),
truncating it and collapsing the selection the same way it does on the web.

Fixes bug in TextEventsExample where it wouldn't show the submit and end events,
even though there were firing correctly.
2015-07-21 12:45:07 -08:00
Christopher Chedeau 725053acfe [Animated][BREAKING_CHANGE] Convert <TouchableOpacity> to Animated
Summary:
Because we don't want to integrate Animated inside of the core of React, we can only pass Animated.Value to styles of <Animated.View>. TouchableOpacity unfortunately used cloneElement. This means that we should have asked every single call site to replace their children to Animated.View. This isn't great.

The other solution is to stop using cloneElement and instead wrap the children inside of an <Animated.View>. This has many advantages:
- We no longer use cloneElement so we're no longer messing up with elements that are not our own.
- Refs are now working correctly for children elements
- No longer need to enforce that there's only one child and that this child is a native element

The downside is that we're introducing a <View> into the hierarchy. Sadly with CSS there is no way to have a View that doesn't affect layout. What we need to do is to remove the inner <View> and transfer all the styles to the TouchableOpacity. It is annoying but fortunately a pretty mechanical process.

I think that having a wrapper is the best solution. I will investigate to see if we can make wrappers on TouchableHighliht and TouchableWithoutFeedback as well.

**Upgrade Path:**

If the child is a View, move the style of the View to TouchableOpacity and remove the View itself.

```
<TouchableOpacity onPress={...}>
  <View style={...}>
    ...
  </View>
</TouchableOpacity>

-->

<TouchableOpacity onPress={...} style={...}>
  ...
</TouchableOpacity>
```

If the child is an Image or Text, on all the examples at Facebook it worked without any change. But it is a great idea to double check them anyway.
2015-07-20 16:44:36 -08:00
Elliot Lynde 4a262e0f2b [React Native][Pokes Dashboard] Fix crash 2015-07-17 17:00:47 -08:00
Spencer Ahrens 4a5f12aa29 Updates from Fri July 17th 2015-07-17 14:14:30 +02:00
Spencer Ahrens c43e93d1b4 Reverted ca9d1b3bf5a6f46ec29babe8685634690ff9a2bc to unbreak groups 2015-07-17 04:03:01 -08:00
Spencer Ahrens 4b82673484 revert [React Native] Fix scroll view sticky headers 2015-07-16 16:31:53 -08:00
Mr Speaker 2cb634bb0b Nav ios hide hairline
Summary:
For the current project I am working on I needed to add a boolean option (`shadowHidden`) to remove the 1px hairline shadow from the NavigationIOS component:

`<NavigatorIOS shadowHidden={true} initialRoute={...} />`

By default, or with `shadowHidden={false}` it looks like this:

![withhairline](https://cloud.githubusercontent.com/assets/129330/8145401/d2704956-11d4-11e5-86e8-a75435b68480.png)
Setting the shadow hidden  with `shadowHidden={true}` looks like this:

![nohairline2](https://cloud.githubusercontent.com/assets/129330/8145405/148ed56e-11d5-11e5-85d6-f8cd3453d5ac.png)

The code it uses to do the actual hiding is... a bit of a hack (*I* think), but it's the only way currently to do it, and is the way they do it in the iPhone calendar app: iterating through the subviews and removing the shadow image.

This removes the shadow *and* keeps the translucent blurry effect with a ScrollView (see this [SO discussion](http://stackoverflow.com/questions/18160173/how-to-remove-uinavigationbar-inner
Closes https://github.com/facebook/react-native/pull/1615
Github Author: Mr Speaker <mrspeaker@gmail.com>
2015-07-16 04:31:17 -08:00
Spencer Ahrens 902ffbbfb8 Updates from Wed July 15th 2015-07-15 19:05:08 +02:00
Christopher 5006eca4a8 [TextInput] Remove focus on TextInput if property `editable` is …
Summary:
Clicking on a TextField with editable set to false still would trigger a keyboard event.
In this case that the TextField was a multiline, it would scroll you down to the bottom.

Closes https://github.com/facebook/react-native/pull/1855
Github Author: Christopher <hello@blick-labs.com>
2015-07-15 08:37:22 -08:00
Matt Revell 64c00dcd7a Issues/#1689 text input warning
Summary:
This should close issue 1689. Using Object.assign to pass Flow checks.
Closes https://github.com/facebook/react-native/pull/1956
Github Author: Matt Revell <mattrevell82@me.com>
2015-07-15 06:33:03 -08:00
chirag04 04fa09afef [Style] added backface-visibility. fixes #1973
Summary:
default behavior remains same(backface visible).

cc @sahrens
Closes https://github.com/facebook/react-native/pull/1977
Github Author: chirag04 <jain_chirag04@yahoo.com>
2015-07-14 17:38:05 -08:00
Spencer Ahrens 34c2157b66 Updates from Tue July 14th 2015-07-14 20:37:13 +02:00
Jean Regisser 9936a2406d [TabBarIOS] Add translucent property to TabBarIOS
Summary:
To be on par with NavigatorIOS, I added the translucent property to TabBarIOS.

Usage:
```
<TabBarIOS
 translucent={false} // default is true
/>
```
Closes https://github.com/facebook/react-native/pull/1937
Github Author: Jean Regisser <jean.regisser@gmail.com>
2015-07-14 08:02:44 -08:00
Alex Akers eb06659711 [React Native] Update code comments about layout-only view 2015-07-14 02:52:45 -08:00
Nathan Spaun 875ab073ea [Treehouse] Sync from android permalink keyboard layout changes 2015-07-13 18:29:54 -08:00
Spencer Ahrens 31b63ade13 Updates_for_Mon_July_13th 2015-07-14 00:27:24 +02:00
Hedger Wang 2cbcfcea88 [Android][JS]: supports prop "html" in WebView 2015-07-10 12:33:16 -08:00
Spencer Ahrens 7ce8cd7222 Updates Tue July 7th and Wed July 8th including Animated 2015-07-09 12:59:47 +02:00
Alex Akers bfbc280fb4 [React Native] Fix scroll view sticky headers
Summary:
The `ScrollView` component tells the native side the subview indices of the views to make sticky. The problem is that, once layout-only views are collapsed, the indices are no longer reflective of the original views to make stick to the top.
2015-07-08 09:35:16 -08:00
Hedger Wang bb141e3a3c Rename prop "injectedJavascriptIOS" to "injectedJavaScript
Summary:
Android WebView now supports the prop "injectedJavaScript", too.
It's time to rename "injectedJavascriptIOS" to "injectedJavaScript" for API
consistency between IOS and Android.
2015-07-07 17:17:22 -08:00
Alexsander Akers 02db374e50 [React Native] Remove layout-only nodes (Take 2!)
Summary:
Remove layout-only views. Works by checking properties against a list of known properties that only affect layout. The `RCTShadowView` hierarchy still has a 1:1 correlation with the JS nodes.

This works by adjusting the tags and indices in `manageChildren`. For example, if JS told us to insert tag 1 at index 0 and tag 1 is layout-only with children whose tags are 2 and 3, we adjust it so we insert tags 2 and 3 at indices 0 and 1. This keeps changes out of `RCTView` and `RCTScrollView`. In order to simplify this logic, view moves are now processed as view removals followed by additions. A move from index 0 to 1 is recorded as a removal of view at indices 0 and 1 and an insertion of tags 1 and 2 at indices 0 and 1. Of course, the remaining indices have to be offset to take account for this.

The `collapsible` attribute is a bit of a hack to force `RCTScrollView` to always have one child. This was easier than rethinking out the logic there, but we could change this later.
2015-07-07 05:06:50 -08:00
Alexsander Akers e37e794ccf Merge new changes from fbobjc 2015-07-03 13:22:43 +01:00
Alexsander Akers c1d7c0df47 Updates from Thu 3 Jul 2015-07-03 11:37:17 +01:00
Alex Akers 88cfc1aaa6 [React Native] Fix navigation bar translucency 2015-07-03 02:12:28 -08:00
Rui Chen 66e32dc406 [Treehouse RN] Sync for D2161376 2015-07-02 19:50:47 -08:00
Alex Akers 00e85cbc85 [React Native] Persist open UIExplorer example between refreshes 2015-07-02 09:36:26 -08:00
Alexsander Akers 13be9454cc Update with test fixes 2015-07-02 11:19:17 +01:00
Hedger Wang 54825b304a [WebView]: Kill `shouldInjectAJAXHandler`, and add `injectedJavascriptIOS`
Summary:
@public

The API and implementation of `shouldInjectAJAXHandler` is very opinionated, and it does not solve many of the use cases that we'd like to address.

Since  `shouldInjectAJAXHandler` is basically juts injecting JS to the web page, we should let developer inject whatever JS that address different issues that they want to fix.

Test Plan:
Test this snippet at <Playground />

```
<WebView
  url="http://www.facebook.com"
  injectedJavascriptIOS="document.body.style.border='solid 10px red'"
/>
```
2015-07-01 18:56:14 -08:00
Alexsander Akers 44c587e828 Updates from Wed 1 Jul 2015-07-01 19:10:35 +01:00
Nick Lockwood 8708c35702 Restructuring FBReactKit project: Part 2 2015-06-28 11:49:41 -08:00
Alex Kotliarskyi 843e181542 Updates from Fri 26, Jun 2015-06-26 15:16:59 -07:00
Owen Kelly 1cca4fb769 [NavigatorIOS] Allow translucent on NavigatorIOS
Summary:
Hi,

I've updated the NavigatorIOS component to allow setting the translucent property.

usage is:
```
            <NavigatorIOS
                translucent={false}
            />
```

This is my first contrib to react-native, so apologies if I've missed something.

Cheers,
Owen
Closes https://github.com/facebook/react-native/pull/1273
Github Author: Owen Kelly <owen@novede.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-26 07:17:54 -08:00
Kevin Gozali 3ec3312c7c [madman]: Fix MapView crashing problem. 2015-06-25 21:21:08 -08:00
chaceliang 7159a4e947 Revert "[React Native] Remove layout-only nodes" 2015-06-25 13:30:06 -08:00
David Mohl 99bc08cf61 [MapView] Support for annotation callouts, annotation press, callout presses and pin animation
Summary:
Started from here - https://github.com/facebook/react-native/issues/1120. Most functionality for annotations were missing so I started implementing and somehow got caught up until the entire thing was done.

![screen shot 2015-05-12 at 10 07 43 pm](https://cloud.githubusercontent.com/assets/688326/7588677/8479a7a4-f8f9-11e4-99a4-1dc3c7691810.png)

2 new events:
- callout presses (left / right)
- annotation presses

6 new properties for annotations:
- hasLeftCallout
- hasRightCallout
- onLeftCalloutPress
- onRightCalloutPress
- animateDrop
- id

1 new property for MapView
- onAnnotationPress

---
Now the important thing is, that I implemented all of this the way "I would do it". I am not sure this is the 'reacty' way so please let me know my mistakes 😄

The problem is that there is no real way to identify annotations which makes it difficult to distinguish which one got clicked. The idea is to pass a `id` and whether it has callouts the entire way with the annotation. I had to
Closes https://github.com/facebook/react-native/pull/1247
Github Author: David Mohl <me@dave.cx>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-25 09:15:21 -08:00
Alex Akers 3c5b4b0a9f [React Native] Remove layout-only nodes
Summary:
Remove layout-only views. Works by checking properties against a list of known properties that only affect layout. The `RCTShadowView` hierarchy still has a 1:1 correlation with the JS nodes.

This works by adjusting the tags and indices in `manageChildren`. For example, if JS told us to insert tag 1 at index 0 and tag 1 is layout-only with children whose tags are 2 and 3, we adjust it so we insert tags 2 and 3 at indices 0 and 1. This keeps changes out of `RCTView` and `RCTScrollView`. In order to simplify this logic, view moves are now processed as view removals followed by additions. A move from index 0 to 1 is recorded as a removal of view at indices 0 and 1 and an insertion of tags 1 and 2 at indices 0 and 1. Of course, the remaining indices have to be offset to take account for this.

The `collapsible` attribute is a bit of a hack to force `RCTScrollView` to always have one child. This was easier than rethinking out the logic there, but we could change this later.

@public

Test Plan: There are tests in `RCTUIManagerTests.m` that test the tag- and index-manipulation logic works. There are various scenarios including add-only, remove-only, and move. In addition, two scenario tests verify that the optimization works by checking the number of views and shadow views after various situations happen.
2015-06-25 09:12:00 -08:00
Alex Kotliarskyi cfe13f2c4e Updates Thu, 25 Jun 2015-06-25 09:37:02 -07:00
Olivia Bishop 1373dab826 [react native] JS change to support placeholderTextColor on android 2015-06-25 05:15:21 -08:00
Alex Kotliarskyi 2e4cbc41b0 Updates from Wed 24 Jun 2015-06-24 10:49:09 -07:00
Felix Oghină 22ea66923f [react_native] JS files from D2172754: support setting the cursor position in TextInput 2015-06-22 06:10:46 -08:00
Andrei Coman 3fa8ec0271 [ReactNative] Change text input underline color 2015-06-17 15:25:52 -08:00
alvaromb a48e9b4690 [WebView] Exposed scalesPageToFit UIWebView property
Summary:
Added the ``scalesPageToFit`` prop to ``WebView``. This allows ``UIWebView`` to handle user zoom and scale.
Closes https://github.com/facebook/react-native/pull/1631
Github Author: alvaromb <amedina@apsl.net>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-17 13:56:38 -08:00
James Ide 51e5794cb8 [ActivityIndicator] Specify a width
Summary:
The activity indicator was treated as a zero-width element without an explicit width. Fill it in so the style dimensions match what is displayed on the screen.

Closes https://github.com/facebook/react-native/pull/1156
Github Author: James Ide <ide@jameside.com>

Test Plan:
 Render an ActivityIndicator with a background, and see that the background shows up as a square behind the spinner instead of not showing up at all (since it was 0px wide previously).
2015-06-17 07:49:59 -08:00
Peter Cottle a331bb7526 [RFC] Add ScrollView bounded height explanation
Summary:
As discussed in our internal group, think this is a fairly easy error to run into so I added some explanation.

@frantic / @vjeux open to better wording here, but I tried to explain how setting the height directly is discouraged and it's probably better to pipe `flex: 1` all the way down.

I didn't regenerate the website since the script assumes some permissions (push permission to master repo) and has some missing npm dependencies (and after fixing that, still had some obscure error :P )
Closes https://github.com/facebook/react-native/pull/1633
Github Author: Peter Cottle <pcottle@fb.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-16 15:48:30 -08:00
Prathamesh Sonpatki 7dd2dd7962 [Docs] Fixed word auto-correction in TextInput.js
Summary:
Closes https://github.com/facebook/react-native/pull/1593
Github Author: Prathamesh Sonpatki <csonpatki@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-16 10:13:04 -08:00
Tadeu Zagallo 1607d8e9b4 Updates from Tue 16 Jun 2015-06-16 11:30:14 +01:00
Prathamesh Sonpatki 03f49c8b0f [Docs] Added documentation for onChangeText prop of TextInput
Summary:
Closes https://github.com/facebook/react-native/pull/1602
Github Author: Prathamesh Sonpatki <csonpatki@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-15 12:15:24 -08:00
James Ide 01199984d3 [Idea: ScrollView] Add `getScrollResponder` to ScrollView for composition
Summary:
This is a proposal to add `getScrollResponder` to all ScrollView-like components, including ListView. This allows multiple higher-order scroll views to be composed while allowing the owner of the top-level scroll view to call `scrollableView.getScrollResponder().scrollTo(...)` regardless of whether `scrollableView` is a ScrollView, ListView, InvertedScrollView, etc.
Closes https://github.com/facebook/react-native/pull/766
Github Author: James Ide <ide@jameside.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-12 14:04:29 -07:00
Andrei Coman 778e23eaf3 [react_native] JS files from D2139723: [react_native] Set WebView user-agent from JS 2015-06-12 14:04:28 -07:00
Gabe Levi 1295c004e0 [Flow] Fix or suppress last minute errors for 0.12.0 2015-06-12 14:04:28 -07:00
Adam Krell 373854a47f Add map type property (standard, satellite, hybrid) to MapView.
Summary:
Here is an example project demonstrating this pull request: [AKMapView](https://github.com/adamkrell/AKMapView)
Closes https://github.com/facebook/react-native/pull/1503
Github Author: Adam Krell <akrell@bethanyassociates.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-12 14:04:27 -07:00
Gabe Levi 1acca01aa4 [Flow] Fix or suppress react-native github errors for Flow v0.12.0 2015-06-12 14:04:26 -07:00
James Ide 6b621a5677 [Idea: ScrollView] Add `getScrollResponder` to ScrollView for composition
Summary:
This is a proposal to add `getScrollResponder` to all ScrollView-like components, including ListView. This allows multiple higher-order scroll views to be composed while allowing the owner of the top-level scroll view to call `scrollableView.getScrollResponder().scrollTo(...)` regardless of whether `scrollableView` is a ScrollView, ListView, InvertedScrollView, etc.
Closes https://github.com/facebook/react-native/pull/766
Github Author: James Ide <ide@jameside.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-12 11:15:51 -08:00
Andrei Coman 3ff6abb6d1 [react_native] JS files from D2139723: [react_native] Set WebView user-agent from JS 2015-06-12 02:37:57 -08:00
Gabe Levi 66c7511f73 [Flow] Fix or suppress last minute errors for 0.12.0 2015-06-11 17:43:06 -08:00
Adam Krell 04b3b52726 Add map type property (standard, satellite, hybrid) to MapView.
Summary:
Here is an example project demonstrating this pull request: [AKMapView](https://github.com/adamkrell/AKMapView)
Closes https://github.com/facebook/react-native/pull/1503
Github Author: Adam Krell <akrell@bethanyassociates.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-11 10:53:41 -08:00
Gabe Levi b05e99a531 [Flow] Fix or suppress react-native github errors for Flow v0.12.0 2015-06-10 13:34:19 -08:00
Spencer Ahrens 205e2659a1 Updates from Tue 9 Jun 2015-06-09 17:20:30 -07:00
Spencer Ahrens 3102fc5df9 [ReactNative] Fix secure text entry
Summary:
@public

`validAttributes` strikes again.

Test Plan: secure box in example is actually secure
2015-06-09 16:02:38 -08:00
Andrei Coman fc48f175c3 [react_native] JS files from D2126599: Android MentionInput Rendering (part 1/2) 2015-06-08 03:47:32 -08:00
Eric Vicenti 0293def7a9 Updates from Fri 5 Jun 2015-06-05 15:11:57 -07:00
Nick Lockwood 45d8fb0ef6 Removed deprecated RCT_EXPORT + code paths 2015-06-05 09:58:25 -08:00
Alex Kotliarskyi 63b8262843 [ReactNative] Allow TouchableWithoutFeedback override accessible attribute 2015-06-03 16:37:11 -08:00
Andrei Coman 6d25ff83ec [react_native] Fix sync 2015-06-03 15:07:39 -08:00
jmstout 074fa759a6 [Touchable] Add custom delay props to Touchable components
Summary:
@public
This PR adds quite a bit of functionality to the Touchable components, allowing the ms delays of each of the handlers (`onPressIn, onPressOut, onPress, onLongPress`) to be configured.

It adds the following props to `TouchableWithoutFeedback, TouchableOpacity, and TouchableHighlight`:
```javascript
/**
 * Delay in ms, from the release of the touch, before onPress is called.
 */
delayOnPress: React.PropTypes.number,
/**
 * Delay in ms, from the start of the touch, before onPressIn is called.
 */
delayOnPressIn: React.PropTypes.number,
/**
 * Delay in ms, from the release of the touch, before onPressOut is called.
 */
delayOnPressOut: React.PropTypes.number,
/**
 * Delay in ms, from onPressIn, before onLongPress is called.
 */
delayOnLongPress: React.PropTypes.number,
```

`TouchableHighlight` also gets an additional set of props:
```javascript
/**
 * Delay in ms, from the start of the touch, before the highlight is shown.
 */
delayHighlightShow: React.PropTypes.number,
/**
 * Del
...
```

Closes https://github.com/facebook/react-native/pull/1255
Github Author: jmstout <git@jmstout.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-06-03 12:57:28 -08:00
Nick Lockwood e68f89bfad Added ProgressViewIOS 2015-06-03 09:49:35 -08:00
Christopher Chedeau b9a47062a6 [ReactNative] Unbreak flow errors 2015-05-29 23:52:02 +01:00
Christopher Chedeau 6bffa6c8a8 [ReactNative] Unbreak flow errors 2015-05-29 14:24:00 -08:00
Tadeu Zagallo 1567e8224a Updates from Fri 29 May 2015-05-29 23:18:30 +01:00
Krzysztof Magiera e2dc2db9dc [react_native] JS files from D2091817: Support nested text nodes in TextInput. 2015-05-29 12:39:47 -08:00
Alex Akers 40da2c7e08 [React Native] Add E2E tests for Catalyst that test login, app launcher, and opening UIExplorer, MAdMan, Groups 2015-05-29 05:30:09 -08:00
Tadeu Zagallo 9d1960948c Updates from Thu 28 May 2015-05-28 16:17:37 +01:00
Stan Chollet 76ea00483d TabBarIOS tintColor
Summary:
[Origin Pull request](https://github.com/facebook/react-native/pull/961) from [cmcewen](https://github.com/cmcewen)

All the work have been done by @cmcewen, I just rebased his work with the master.
Closes https://github.com/facebook/react-native/pull/1337
Github Author: Stan Chollet <stanislas.chollet@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-26 17:21:36 -08:00
Changgeng Li 84783dbac4 Add renderSeparator support to ListView 2015-05-26 15:20:29 -08:00
James Ide 64ae42c10a Merge pull request #1395 from pwmckenna/touchableopacitysinglechilddocs
Add doc warning stating that TouchableOpacity can only support a single child
2015-05-25 22:20:19 -07:00
Patrick Williams 0466bbd616 Add doc warning stating that TouchableOpacity can only support a single child 2015-05-25 22:03:43 -07:00
Georgiy Kassabli d211359aeb Added ability to set custom accessibility tap handler to React Native 2015-05-20 08:32:15 -08:00
Alex Akers a4f92ba3db [React Native] Add magic tap accessibility gesture 2015-05-19 06:28:01 -08:00
Spencer Ahrens 1c70f33511 [ReactNative] clean lint for Libraries/Components 2015-05-18 15:54:07 -08:00
Andrei Coman 03905e69f4 [react_native] JS files from D2079609: [react_native] Use email type for login field 2015-05-18 07:36:39 -08:00
Georgiy Kassabli 6ef7eaf663 Added accessibility traits support to View class 2015-05-18 07:30:29 -08:00
James Ide 08d30e751b [ActivityIndicator] Add the onLayout prop to the outer container view
Summary:
ActivityIndicator was forwarding all of its props except `style` to the inner native view. This meant that onLayout would report a zero-sized frame that was relative to the wrapper view instead of the parent of the ActivityIndicator.

This diff adds `onLayout` to the wrapper view instead of the native view.

In general, all components that forward props need to be audited in this manner.

Closes https://github.com/facebook/react-native/pull/1292
Github Author: James Ide <ide@jameside.com>

Test Plan: `<ActivityIndicator onLayout={...} />` reports the size of the spinner plus a position relative to its parent view.
2015-05-15 18:08:32 -08:00
James Ide d72045932e [TextInput] Add `onLayout` to TextInput, forwarding it to the native views
Summary:
`TextInput` does not automatically forward all props using the spread operator so we need to explicitly forward the `onLayout` prop.

Closes https://github.com/facebook/react-native/pull/1296
Github Author: James Ide <ide@jameside.com>

Test Plan:
 Mount a TextInput component with an `onLayout` prop and see that the callback handler is invoked with the TextInput's frame.
2015-05-15 11:52:23 -08:00
James Ide b1c93bb9fc [Haste] @provides -> @providesModule StaticRenderer
Summary:
Pretty sure this shouldn't be @provides
Closes https://github.com/facebook/react-native/pull/837
Github Author: James Ide <ide@jameside.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-14 08:42:13 -08:00
Alex Akers 86709c15cb [React Native] Support variable corner radii on RCTView 2015-05-13 13:24:37 -07:00
Ben Alpert a0440daf98 [react-native] Codemod .getNodeHandle, .getNativeNode to React.findNodeHandle 2015-05-13 13:24:37 -07:00
Ben Alpert a2f73b4d77 [react-native] Add React.findNodeHandle 2015-05-13 13:24:37 -07:00
Krzysztof Magiera ff00e1496c [ReactNative] Rename ReactIOS JS module (and relatives) to ReactNative. 2015-05-13 13:24:35 -07:00
Ben Alpert 5e51fac8d5 [react-native] In TouchableOpacity, access .props on element, not component 2015-05-08 08:31:04 -08:00
Eric Vicenti 61bd008ea0 [ReactNative] Fix TouchableOpacity crash when child props are missing 2015-05-07 18:04:19 -08:00
Spencer Ahrens 1ef4e00fba [ReactNative] Introduce onLayout events
Summary:
Simply add an `onLayout` callback to a native view component, and the callback
will be invoked with the current layout information when the view is mounted and
whenever the layout changes.

The only limitation is that scroll position and other stuff the layout system
isn't aware of is not taken into account.  This is because onLayout events
wouldn't be triggered for these changes and if they are desired they should be
tracked separately (e.g. with `onScroll`) and combined.

Also fixes some bugs with LayoutAnimation callbacks.

@public

Test Plan:
- Run new LayoutEventsExample in UIExplorer and see it work correctly.
- New integration test passes internally (IntegrationTest project seems busted).
- New jest test case passes.

{F22318433}

```
2015-05-06 15:45:05.848 [info][tid:com.facebook.React.JavaScript] "Running application "UIExplorerApp" with appParams: {"rootTag":1,"initialProps":{}}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF"
2015-05-06 15:45:05.881 [info][tid:com.facebook.React.JavaScript] "received text layout event
", {"target":27,"layout":{"y":123,"x":12.5,"width":140.5,"height":18}}
2015-05-06 15:45:05.882 [info][tid:com.facebook.React.JavaScript] "received image layout event
", {"target":23,"layout":{"y":12.5,"x":122,"width":50,"height":50}}
2015-05-06 15:45:05.883 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":70.5,"x":20,"width":294,"height":204}}
2015-05-06 15:45:05.897 [info][tid:com.facebook.React.JavaScript] "received text layout event
", {"target":27,"layout":{"y":206.5,"x":12.5,"width":140.5,"height":18}}
2015-05-06 15:45:05.897 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":70.5,"x":20,"width":294,"height":287.5}}
2015-05-06 15:45:09.847 [info][tid:com.facebook.React.JavaScript] "layout animation done."
2015-05-06 15:45:09.847 [info][tid:com.facebook.React.JavaScript] "received image layout event
", {"target":23,"layout":{"y":12.5,"x":82,"width":50,"height":50}}
2015-05-06 15:45:09.848 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":110.5,"x":60,"width":214,"height":287.5}}
2015-05-06 15:45:09.862 [info][tid:com.facebook.React.JavaScript] "received text layout event
", {"target":27,"layout":{"y":206.5,"x":12.5,"width":120,"height":68}}
2015-05-06 15:45:09.863 [info][tid:com.facebook.React.JavaScript] "received image layout event
", {"target":23,"layout":{"y":12.5,"x":55,"width":50,"height":50}}
2015-05-06 15:45:09.863 [info][tid:com.facebook.React.JavaScript] "received view layout event
", {"target":22,"layout":{"y":128,"x":60,"width":160,"height":337.5}}
```
2015-05-07 12:27:44 -08:00
James Ide b97ce93cea [Nav] Add support for bar button icons and left buttons
Summary:
NavigatorIOS supports four new properties:

  - **rightButtonImageSource:** The source of an image to display in the top right. This must be a static image since UINavigationController only supports UIImages. Adding support for UIImageViews (or arbitrary views) is more complicated because custom views do not fade on touch and do not have hit slop the same way that UIImage buttons do. Usage: `rightButtonImageSource: ix('ImageName')`
  - **backButtonImageSource:** Use a custom image for the back button. This does not replace the back caret (`<`) but instead replaces the text next to it.
  - **leftButtonTitle**: Text for the left nav button, which supersedes the previous nav item's back button when specified. The main use case for this is your initial screen/UIVC which has nothing to go back to (since it is the first VC on the stack) but need to display a left button. This does hide the back button if there would have been one otherwise.
  - **leftButtonImageSource:** Image source for the left button, super
Closes https://github.com/facebook/react-native/pull/263
Github Author: James Ide <ide@jameside.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-07 08:03:21 -08:00
Brent Vatne f05494c96f Fix scrollview doc type - canimprove -> can improve
Summary:
Simple one character change - add a missing space
Closes https://github.com/facebook/react-native/pull/1112
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-06 21:19:25 -08:00
Brent Vatne 0b844feedb [TouchableOpacity] Reset opacity to the inactiveValue rather than always 1.0
Summary:
As per #941 - fixes bug with `TouchabeOpacity` always reseting child opacity to `1.0` after press.

A note about the code: we could probably use a general `getNativeProp(propName, callback)` function rather than `getOpacity` but just used that as it was simpler for this specific PR, perhaps that refactor could be left to another - or maybe there is a way to do this already that I missed.

Before:
![bug](https://cloud.githubusercontent.com/assets/90494/7287207/52d6a686-e907-11e4-8e16-04b2ddd0582c.gif)

After:
![after](https://cloud.githubusercontent.com/assets/90494/7287689/5aca4776-e90c-11e4-8c40-aa6bd3e822d8.gif)

Example code:
```javascript
'use strict';

var React = require('react-native');
var {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  TouchableOpacity,
} = React;

var TestIt = React.createClass({
  render() {
    return (
      <View style={styles.container}>
        <TouchableOpacity activeOpacity={0.3}>
          <View style={styles.searchButton}>
            <Text>
Closes https://github.com/facebook/react-native/pull/977
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-06 17:27:12 -08:00
Peter Zich d177a45bdc [ReactNative] Pull transform properties out into TransformPropTypes 2015-05-06 14:24:10 -08:00
Krzysztof Magiera 4402c4c885 [react_native] JS files from D2038965: Extract view specific commands from UIManager. 2015-05-05 02:58:05 -08:00
Ben Alpert 8c2f44d640 [react-native] Don't mutate props in TouchableBounce 2015-05-02 10:23:24 -08:00
Spencer Ahrens 59997df1c1 [ReactNative] Fix warnings w/h => width/height 2015-05-02 10:22:59 -08:00
Krzysztof Magiera 4bd56ca6d1 [react_native] JS files from D2038898: Move view specific constants out of UIManager to the cooresponding view manager class. 2015-05-01 07:06:51 -08:00
Nick Lockwood ba501a1bf5 Upgraded dev menu 2015-05-01 06:36:49 -08:00
Hedger Wang 4ac2fcc4a6 [madman][android]: unbreak android app. 2015-04-29 15:38:10 -08:00
Nick Lockwood 81e82d10ab Added missing features from Multiline Text commit 2015-04-29 15:27:15 -08:00
Clay Allsopp 11f204748d Add SegmentedControlIOS
Summary:
Fixes #534:

![screen shot 2015-03-31 at 7 52 10 pm](https://cloud.githubusercontent.com/assets/153704/6934038/742ddd34-d7e3-11e4-8f55-3eb7d9d3f1cd.png)

```jsx
<SegmentedControlIOS
  tintColor="#ff0000"
  values={['One', 'Two', 'Three', 'Four']}
  selectedtIndex={0}
  momentary={false}
  enabled={true}
  onValueChange={ (value) => console.log(value) } />
```

This only supports string-based segments, not images. Also doesn't support full customization (no separator images etc); I figure this is a good MVP to lock-down a basic API

I also included a snapshot test case, but the images keep coming out funky. When I look at the sim, I see that the text labels show up for the selected segment, but the snapshot keeps coming out with no text on those segments. I tried forcing a delay, but same result. Is that explainable?

Obviously happy to change anything about the API, code-style nitpicks, etc
Closes https://github.com/facebook/react-native/pull/564
Github Author: Clay Allsopp <clay.allsopp@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-29 08:08:45 -08:00
Gabe Levi b6e6dae6ba [Flow] Properly fix new errors as of Flow v0.10. 2015-04-27 14:56:21 -08:00
Ben Alpert dd56ccb9c7 [react-native] Fix capitalization of "REact" 2015-04-27 13:52:57 -08:00
Maksim Bunkow bae4e44c60 Added placeholderTextColor property for TextInput class
Summary:
Closes https://github.com/facebook/react-native/pull/997
Github Author: Maksim Bunkow <bimawa@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-27 10:43:10 -08:00