Commit Graph

671 Commits

Author SHA1 Message Date
Philipp von Weitershausen 4273af9e29 Allow uploading a native file (e.g. photo) via XMLHttpRequest
Summary:
With this in place, it's possible to upload a picture from the `CameraRoll` to Parse, for instance:

    xhr = new XMLHttpRequest();
    xhr.onload = function() {
      data = JSON.parse(xhr.responseText);
      var parseFile = new Parse.File(data.name);
      parseFile._url = data.url;
      callback(parseFile);
    };
    xhr.setRequestHeader('X-Parse-Application-Id', appID);
    xhr.setRequestHeader('X-Parse-JavaScript-Key', appKey);
    xhr.open('POST', 'https://api.parse.com/1/files/image.jpg');
    // assetURI as provided e.g. by the CameraRoll API
    xhr.send(new NativeFile(assetURI));

Closes https://github.com/facebook/react-native/pull/1357
Github Author: Philipp von Weitershausen <philikon@fb.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-26 09:45:34 -08:00
Philipp von Weitershausen 7069e4cd3f XMLHttpRequest: ignore case for request headers
Summary:
HTTP headers are case-insensitive, so we should treat them that way when they're being set on `XMLHttpRequest`.
Closes https://github.com/facebook/react-native/pull/1381
Github Author: Philipp von Weitershausen <philikon@fb.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-26 08:15:42 -08:00
Nick Lockwood b7c669aa73 Fixed root view background color propagation 2015-05-26 04:18:55 -08:00
Philipp von Weitershausen c6ed85afcc new XMLHttpRequest().status is a number, not a string
Summary:
See http://www.w3.org/TR/XMLHttpRequest/#interface-xmlhttprequest
Closes https://github.com/facebook/react-native/pull/1356
Github Author: Philipp von Weitershausen <philikon@fb.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-22 16:42:15 -08:00
Alex Kotliarskyi 53ea27c7b8 [ReactNative] Warn when native component does not exist 2015-05-22 16:29:59 -08:00
Jared Forsyth aad54006e3 Observing "MemoryWarningNotification" and proxying it up to the DeviceEventEmitter 2015-05-22 13:09:56 -08:00
Eric Vicenti 5bad316678 [ReactNative] Navigator de-contextualize popToRoute 2015-05-22 11:56:55 -08:00
Eric Vicenti 62c556c785 [ReactNative] Navigator context setHandler refer by index 2015-05-22 11:44:49 -08:00
Christoph Pojer 6cb31bb19d [JS] Faster crc32 2015-05-22 09:45:41 -08:00
Nick Lockwood fe4b4c2d83 Optimised blending for translucent images with opaque background color + fixed cropping for images in cover/contain mode.
Summary:
@public

Our background color propagation mechanism is designed to make rendering of translucent content more efficient by pre-blending against an opaque background. Currently this only works for text however, because images are not composited into their background even if the background color is opaque.

This diff precomposites network images with their background color when the background is opaque, allowing them to take advantage of this performance optimization.

I've also added some logic to correctly crop the downloaded image when the resizeMode is "cover" or "contain" - previously it was only correct for "stretch".

Before:{F22437859}
After:{F22437862}

Test Plan: Run the UIExplorer "<ListView> - Paging" example with "color blended layers" enabled and observe that the images appear in green now, instead of red as they did before.
2015-05-22 07:19:06 -08:00
James Ide 7f51f9c8a9 [Navigator] Support the `ref` prop on scene roots
Summary:
Navigator overrides the `ref` prop of scene components so that it can call `onItemRef` and do internal bookkeeping. With callback refs, we can additionally call the original value of the `ref` prop as long as it's a function (that is, string refs are not supported). Note that the `ref` prop is moved to `reactElement.ref` out of `reactElement.props.ref`, which is why this diff accesses `child.ref`.

This diff adds support for callback refs and warns helpfully if a string ref was provided. It should be completely backwards compatible since scenes couldn't have been relying on the `ref` prop before.

cc @ericvicenti

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

@public

Test Plan:
 Write a renderScene implementation that puts a callback ref on the root component:
```js
renderScene() {
  return <View ref={component => console.log('yes! this is called')} />;
}
```
2015-05-21 11:01:09 -08:00
Andy Street c6670658f4 [react_native] JS files from D2087892: [react_native] Implement setInterval in JS 2015-05-21 04:24:04 -08:00
Joe Savona 1d5d01c3c9 InteractionManager: DEV warning for possibly unclosed handles 2015-05-20 16:54:03 -08:00
Georgiy Kassabli d211359aeb Added ability to set custom accessibility tap handler to React Native 2015-05-20 08:32:15 -08:00
Spencer Ahrens 32666f0aa2 [ReactNative] Add AppEventsTest 2015-05-20 00:31:50 -08:00
Eric Vicenti c1609bcab8 [ReactNative] Navigator fix for sceneStyle
Summary:
Fixes https://github.com/facebook/react-native/issues/1332

When the absolute left position is not set to zero on a provided sceneStyle, scene enabling is broken and no scene will be visible when it is pushed. This was broken recently when the scene disabling was modified to push the scenes offscreen.

Closes https://github.com/facebook/react-native/pull/1347
Github Author: Eric Vicenti <evv@fb.com>

@public

Test Plan:  Tested when pushing a scene Navigator in the UIExplorer example while sceneStyle is set on the Navigator
2015-05-19 18:54:15 -08:00
Eric Vicenti 97137e8bcc [ReactNative] Navigator clean scenes popped with gesture
Summary:
Fixes https://github.com/facebook/react-native/issues/1252

Scenes dismissed/popped via a gesture were not being removed. This is probably a regression from an earlier refactor.

Test plan: log statements after scene focusing now reports that `navigator.getCurrentRoutes().length` lowers after gesture. Tested on UIExplorer Navigator example
Closes https://github.com/facebook/react-native/pull/1346
Github Author: Eric Vicenti <evv@fb.com>

@public

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-19 18:45:42 -08:00
Spencer Ahrens 11b515b1b0 [ReactNative] clean lint in all of Libraries/ 2015-05-19 13:47:04 -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
Premasagar Rose 33ac55b2bd Fix typo in image documentation
Summary:
Closes https://github.com/facebook/react-native/pull/970
Github Author: Premasagar Rose <p@dharmafly.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-18 13:01:20 -08:00
Luke de27f1db54 fix exception when ES6 class with no propTypes defined before calling requireNativeComponent
Summary:
Closes https://github.com/facebook/react-native/pull/1260
Github Author: Luke <kejinlu@gmail.com>

Test Plan: Created `class Foo extends React.Component` and made sure error messages were good.
2015-05-18 11:47:42 -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
Brent Vatne c668fd5be0 [ReactNative] Add "RCTNativeAppEventEmitter"
Summary:
As mentioned in #906, [in the docs it mentions sending native app events](http://facebook.github.io/react-native/docs/nativemodulesios.html#sending-events-to-javascript) eg: calendar event reminder received, through the `RCTNativeAppEventEmitter`, but the JS module for that is missing. This adds it - it's nothing more than an instance of `EventEmitter`, just like [RCTDeviceEventEmitter](https://github.com/facebook/react-native/blob/master/Libraries/Device/RCTDeviceEventEmitter.js).
Closes https://github.com/facebook/react-native/pull/918
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-15 16:57:18 -08:00
Zhao Han 40da7bb835 Add more documentation in ListViewDataSource
Summary:
ListViewDataSource's default data extractor can actually expect another data form:

`{ sectionID_1: [ <rowData1>, <rowData2>, ... ], ... }`
Closes https://github.com/facebook/react-native/pull/1285
Github Author: Zhao Han <cx.chenghai+github@gmail.com>

Test Plan: Changed the ListViewExample to make sure all three formats work.
2015-05-15 13:47:43 -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
Nick Lockwood d27e6fa7f8 Fixed RCTWebSocket and chrome debugging in OSS 2015-05-15 11:37:07 -08:00
Christopher Chedeau 2d9990ca2a [ReactNative] Better error message when passing an Animated to a View 2015-05-15 11:01:46 -08:00
Spencer Ahrens 4771806c44 [ReactNative] Fix some mount callback issues 2015-05-15 10:59:09 -08:00
Tadeu Zagallo e467fb7202 [ReactNative] Add console.profile hooks to systrace
Summary:
Add console.profile sync hooks compliant with the chrome API
https://developer.chrome.com/devtools/docs/console-api#consoleprofilelabel

@public

Test Plan:
Add a `console.profile()` and a `console.profileEnd()` in the JavaScript,
and record a systrace-like profile via DevMenu
2015-05-14 15:59:20 -08:00
Georgiy Kassabli d2f79d835d Fixing misprint in RCText.m 2015-05-14 13:02:47 -08:00
Nick Lockwood 7c3070628a Fixed infinite #clowntown error loop 2015-05-14 12:19:15 -08:00
Yuta Okazaki 75ed1dd49e Fix typo of function name in ListView documentation
Summary:
When I read documents, I usually 'search within page' to see where they talk about specific things.
So I found this fix to be pretty useful. Hope it'll be merged!
Closes https://github.com/facebook/react-native/pull/1146
Github Author: Yuta Okazaki <s04155yo@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-14 09:52:19 -08:00
James Ide 4e412381f2 [TextView] Define missing properties and add getters
Summary:
Some of the RCTTextView properties weren't set up correctly which would cause bugs when you'd set a property and then unset it, trying to revert to the default. This requires reading the default value from the dummy view instance, but some of these properties didn't have getters which was causing issues.

Fixes #1174

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

Test Plan:  Create a `<TextInput multiline={true}>` component. Give it a style with `color: 'blue'`, and then on the next render pass remove the style. No more red box.
2015-05-14 09:45:12 -08:00
Alex Akers e9db0338d2 [React Native] Enable accessibility on RCTText 2015-05-14 09:41:21 -08:00
Harrison Harnisch babdc21614 WebSocket polyfill
Summary:
- Added as a library in /Libraries/WebSocket
- Drag and drop to add to project (similar to adding Geolocation polyfill)
- Exposed as `window.WebSocket` which conforms with https://developer.mozilla.org/en-US/docs/Web/API/WebSocket specs
Closes https://github.com/facebook/react-native/pull/890
Github Author: Harrison Harnisch <hharnisc@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-14 09:37:02 -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
Martin Konicek 661321fda7 [ReactNative] Remove ReactNativeComponentMixin 2015-05-14 08:17:20 -08:00
Spencer Ahrens 6e179fb7cd [ReactNative] introduce mountSafeCallback
Summary:
`mountSafeCallback` simply wraps a callback in an `isMounted()` check to prevent crashes when old callbacks are called on unmounted components.

@public

Test Plan:
Added logging and made sure callbacks were getting called through
`mountSafeCallback` and that things worked (e.g. photo viewer rotation etc).
2015-05-13 18:36:53 -08:00
Amjad Masad 9fde7d2828 [react-native] Make document.js into a polyfill. Fixes #1149
Summary:
@public
document shimming must run before anything else. However, we don't currently guarantee that. This moves the document shimming into `document.js` which is used as a polyfill.

Test Plan:
* start server
* go to playground app
* require `NativeModules` as the first thing
* open chrome debugger
* no error
2015-05-13 17:50:21 -08:00
Eric Vicenti 4b5385b2f0 [ReactNative] Fix Navigator resetTo race condition
Summary:
SetState can be somewhat racy. By the time the route state finishes, another resetTo has already happened, so the origional route is no longer in the stack. Hence the redbox invariant "Calling pop to route for a route that doesn't exist!"

This could also be fixed in product code by not calling resetTo rapidly, but the navigator should be resilient to such shenanigans

@public

Test Plan: Cannot get AdsManager crash t7031976
2015-05-13 12:17:31 -08:00
Gabe Levi aceaaa69eb [Flow] v0.11.0 cleaning - Part 15 (Libraries/FBReactKit/js) 2015-05-13 13:24:37 -07:00
Spencer Ahrens 81ad810186 [ReactNative] differentiate fatal and soft exceptions 2015-05-13 13:24:37 -07: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
Logan Bernard 2ed2d20dfe FloatFromLeft animation
Summary:
float from left animation for Navigator.SceneConfigs

#1100
@ericvicenti
@ide
Closes https://github.com/facebook/react-native/pull/1249
Github Author: Logan Bernard <bernard.logan4@gmail.com>

@public

Test Plan: Video: https://drive.google.com/file/d/0B9HtmABaCcR0Zi1yNkl5UDhWbzg/view
2015-05-13 13:24:37 -07:00
Bill Fisher 89e26e92b6 [ReactNative] decompose transform matrix 2015-05-13 13:24:37 -07:00
James Ide 6a699302c8 [Navigator] Pass route into onItemRef
Summary:
The index alone isn't so useful; pass the route as well. (I am using this to implement componentWill/DidFocus in a library instead of onWill/DidFocus; #1153).

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

@public

Test Plan:  Set up a navigator with a couple of scenes, and see that when onItemRef is called for each one, the route is passed in as the third argument.
2015-05-13 13:24:37 -07:00
Eric Vicenti 1a68585990 [ReactNative] Navigator fix rapid gesture breakage
Summary:
When gesturing rapidly between scenes, the navigator can get into an unresponsive state. A few minor fixes can avoid that case

@public

Test Plan: Rapid gestures on iOS device and simulator can no longer get into bad state
2015-05-13 13:24:36 -07:00
Gabe Levi 184bb1151a [Flow] v0.11.0 cleaning - Part 14 (react-native-github) 2015-05-13 13:24:36 -07:00
Martin Konicek 92fc92835f [ReactNative] Resolve assets on Android 2015-05-13 13:24:36 -07:00
Krzysztof Magiera 369e30f685 [ReactNative] Rename files after ReactIOS codemod so that filename matches name exported with @providesModule. 2015-05-13 13:24:36 -07:00
Vladimir Kurchatkin a142ed50ff Add `letterSpacing` style property for `Text`
Summary:
Fixes #457
Closes https://github.com/facebook/react-native/pull/482
Github Author: Vladimir Kurchatkin <vladimir.kurchatkin@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-13 13:24:36 -07:00
Eric Vicenti 02d875869a [ReactNative] Fix Navigator empty scene issue
Summary:
In some situations, when quickly swiping back to a scene we are transitioning from, the scene is blank/missing. This is fixed by adding a check for the active gesture when we hide the scenes.

@public

Test Plan: Can no longer reproduce on simulator when quickly swiping back to the scene we are transitioning from
2015-05-13 13:24:36 -07:00
Tadeu Zagallo ef339250b5 [ReactNative] Add prompt to AlertIOS
Summary:
Add `AlertIOS.prompt`

It's compatible with the js spec, with the exception that I had to add
a callback param since it's async. Also supports the same button configuration
as `AlertIOS.alert`.

@public

Test Plan:
I've updated the `AlertIOS` example on UIExplorer with every
valid combination of
parameters, so just going through it should be fine.
2015-05-13 13:24:36 -07:00
Nick Lockwood cfeae15c1f Fixed thread safety for RCTImageLoader 2015-05-13 13:24:36 -07:00
Nick Lockwood 5e160f168d Added support for local image to RCTImageLoader 2015-05-13 13:24:35 -07:00
Eric Vicenti aa19232609 [ReactNative] Fix case where scenes are not reset on gesture detaching
Summary:
Sometimes, when quicly backing out of a gesture, the scene isn't fully reset to the middle position and remains offset by a few pixels. This makes sure that never happens.

@public

Test Plan: Tested on iOS and I can no longer see the scenes stop when backing out of a gesture
2015-05-13 13:24:35 -07:00
Eric Vicenti a852227279 [ReactNative] Improve Navigator start gesture logic
Summary:
Previously it was possible for a gesture to be granted initiated if the start direction is not respected before the gesture detection distance gets reached, if the gesture direction is met eventually. This change ensures the gesture gets started in the right direction, otherwise the gesture action will set the responder.

@public

Test Plan: Fixes left-right swiping issue in AdsManager when a vertical swipe is intended.
2015-05-13 13:24:35 -07:00
Krzysztof Magiera ff00e1496c [ReactNative] Rename ReactIOS JS module (and relatives) to ReactNative. 2015-05-13 13:24:35 -07:00
Alex Kotliarskyi 320208f4f7 Updates from Fri 8 May 2015-05-08 10:29:59 -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
Alex Kotliarskyi c76fb40ec4 [ReactNative] Register assets with AssetRegistry 2015-05-07 17:27:42 -08:00
Brent Vatne 7141948a05 Bump fetch and add exports/globals for Headers, Request and Response
Summary:
Now on fetch 0.8.1, the latest tagged release. Previous version used was 0.7.0. See #1162 cc @vjeux @jtremback
Closes https://github.com/facebook/react-native/pull/1192
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: I arc patched and ran movies demo and storyline, they work fine
2015-05-07 13:24:16 -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
Brent Vatne 1c90a2dbcc Move updated propTypes into new TransformPropTypes 2015-05-07 12:14:15 -07:00
Brent Vatne 0bccc33dff Change rotation to rotate 2015-05-07 11:56:42 -07:00
Brent Vatne f878be84e6 Clarify transform for ViewStyleProps, generate union docs properly 2015-05-07 11:56:42 -07: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
Tadeu Zagallo 8d1fcfd615 Merge pull request #1112 from brentvatne/fix-scrollview-doc-typo
Fix scrollview doc type - canimprove -> can improve
2015-05-07 02:57:44 +01: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
Alex Kotliarskyi d3c0029cef [ReactNative] Do not throw when Image.source is null 2015-05-06 16:16:49 -08:00
Alex Kotliarskyi cad5cdef42 Updates from Wed 6 May 2015-05-06 16:08:10 -07:00
Alex Kotliarskyi ee449301b6 [ReactNative] Fail faster in OSS tests 2015-05-06 14:28:30 -08:00
Peter Zich d177a45bdc [ReactNative] Pull transform properties out into TransformPropTypes 2015-05-06 14:24:10 -08:00
Eric Vicenti 40e3f6ea8c [ReactNative] Navigator initialRoute default change
Summary:
The default initialRoute was the first route, but it makes more sense for the default initialRoute to be the last route in the initialRouteStack.

Updated the docs to reflect that.

@public

Test Plan: Updated call sites and checked that they work. Not many places use initialRouteStack yet.
2015-05-06 11:18:55 -08:00
Alex Kotliarskyi 735f67337a [ReactNative] Fail faster in OSS tests 2015-05-06 09:33:20 -07:00
Nick Lockwood 88a83084e4 Fixed UIExplorer in Catalyst shell 2015-05-06 00:08:08 -08:00
Eric Vicenti 86cfcbc77e [ReactNative] Navigator fix opacity reset for presented scene
Summary:
jumpN will call enableScene for the dest scene, which makes sure the scene can be made visible, but we need to avoid resetting the opacity for it when it is already the presented scene. There is already a check to make sure we don't reset opacity for the transitioningFrom scene.

@public

Test Plan: Fixes the issue on Android device when jumping to a scene that is already presented
2015-05-05 14:30:29 -08:00
Ryan Pastorelle 8a74a9f7c3 Force `responseHeaders` to lower case to respect case-insensitivity
Summary:
`XMLHttpRequest.getResponseHeader` is case-insensitive, therefor the React-Native implementation needs to mimic this behavior as to not break libraries that are dependent on this.

There is a corresponding issue in `superagent` but this is the root cause (https://github.com/visionmedia/superagent/issues/636).
Closes https://github.com/facebook/react-native/pull/1138
Github Author: Ryan Pastorelle <rpastorelle@yahoo.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-05 14:09:40 -08:00
Alex Kotliarskyi 5df5602f1a Updates from Tue 5 May 2015-05-05 14:15:51 -07:00
Alex Akers 08246b77df [React Native] Fix immediate animation crash 2015-05-05 07:21:43 -08:00
jmstout 929b2999c4 Fix a bug in the Navigator's gesture.edgeHitWidth implementation
Summary:
Should resolve #1081

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

Test Plan: Imported from GitHub, without a `Test Plan:` line.

Revert Plan: This seems legit, but I'm not qualified to review.
2015-05-05 06:26:51 -08:00
Alex Akers 1a17cceb17 [React Native] Save UIExplorer search state 2015-05-05 05:46:53 -08:00
Alex Akers 5eca2e1d3c [React Native] Added RCTSettings 2015-05-05 05:46:52 -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
Spencer Ahrens 66d2f600dd [ReactNative] improve console logging a little bit 2015-05-04 18:57:03 -08:00
Eric Vicenti 50de4a67b0 [ReactNative] Navigator use flattenStyle
Summary:
A hack was implemented in Navigator to do this manually, but there is a proper function to get these styles for setting native props

@public

Test Plan: Testing Navigator behavior on iOS and Android
2015-05-04 14:33:25 -08:00
Tadeu Zagallo 132a9170f1 [ReactNative] Create private underlying bridge to prevent retain cycles 2015-05-04 10:36:20 -08:00
Eric Vicenti 548a0a6a4f [ReactNative] Fix Navigator scene hiding logic
Summary:
Scenes with 0 opacity are being rendered on top of other scenes with full absolute positioning. On iOS this is fine, because the platform will not send touch events to a view with no opacity. On Android is poses a problem because the view on top, even with no opacity, is catching the touch events for the presented scene below.

This change enhances the scene enabling and hiding logic, has better naming, and improves the documentation of it.

@public

Test Plan: Tested transitions and gestures in slow motion on iOS and Android
2015-05-04 08:54:19 -08:00
Brent Vatne 2f9cc9723f Fix scrollview doc type - canimprove -> can improve 2015-05-02 19:51:18 -07:00
Tadeu Zagallo 09460cf21b [ReactNative] Use explicit doubles on RCTLocationOptions to avoid NSInvocation bug 2015-05-02 14:19:56 -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
Spencer Ahrens 5e110d2776 [ReactNative] Fix Text Updating Crash
Summary:
@public

{D1953613} added an optimization that allowed for shadow nodes that are not
backed by views, but didn't actually work robustly in the remove case because
the indices can get out of sync.  That diff also started returning nil for raw
text nodes, which triggered this bug and broke "see more" functionality in the
`FBTextWithEntities` and `ExpandingText` components, leading to crashes in the
Groups app.

This diff fixes the issue by simply returning `UIView` placeholders again.
Slight perf/ memory cost but no more crashes and there should be no other
adverse affects.

We'll need to think up something more clever in order to properly support `nil`
views in the future, probably something that uses the shadow hierarchy to build
the View hierarchy, rather than mirroring identical commands to both - see
#1102.

Test Plan:
- TextUpdateTest fails without native changes, now passes with them.
- ExpandingText example no longer crashes.
- See More in Groups app no longer crashes.
2015-05-02 10:07:08 -08:00
Spencer Ahrens a4616bff3f [ReactNative] Test case for text update bug 2015-05-02 10:07:07 -08:00
Emily Eisenberg 30a479db8b Make AsyncStorage types match the implementations
Summary:
The `getAllKeys` callback type was completely missing the return value, and all of the callbacks are optional. This just fixes the types to match what the implementations are doing.
Closes https://github.com/facebook/react-native/pull/1079
Github Author: Emily Eisenberg <xymostech@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-05-01 18:26:11 -08:00
Eric Vicenti c0d77dbe9c [ReactNative] Navigator pop specify route to pop
Summary:
Now you can pass a route to the pop function in the navigator context, and the Navigator will pop that scene off the stack and every scene that follows.

This changes the request API that bubbles up to the top-level navigator. The `pop` request had previously taken a route for `popToRoute`, but that is a more obscure use case. This makes the request API more closely match the context method naming.

@public

Test Plan: Verified this works by popping several routes in AdsManager. Experimented with UIExplorer Navigator example to make sure popToRoute still works as expected
2015-05-01 18:11:13 -08:00
Eric Vicenti 28e6e993c6 [ReactNative] Navigator focus handler context fix 2015-05-01 17:01:58 -08:00
Spencer Ahrens 48b281de76 [ReactNative] Remove padding restriction on images
Summary:
@public
Padding actually works fine on images.

Test Plan: Nested text inside an image is properly positioned with padding on the image.
2015-05-01 16:44:52 -08:00
Eric Vicenti 5453be2ab2 [ReactNative] Fix touch issue caused by D2036644 after swiping back 2015-05-01 16:15:28 -08:00
Eric Vicenti 6abf37b47e [ReactNative] Navigator.Interceptor handler arg fix 2015-05-01 14:20:09 -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
Spencer Ahrens 6cb7178098 [ReactNative] Suggest un-pausing debugger when there are issues
Summary:
@public
The most common problem I've noticed is that the debugger is paused, so we
shouldn't ask the user if Chrome is open, because it usually is.

Test Plan: Try to reload with debugger paused, see new error message.
2015-04-30 17:20:39 -08:00
Eric Vicenti 76dc14684d [ReactNative] Navigator block touches to non-active scenes
Summary:
When tapping a link quickly, it will cause two scenes to be pushed on. This prevents against that case by swallowing touches for all non-active scenes.

@public

Test Plan: Can no longer double-push scenes
2015-04-30 15:49:37 -08:00
Philipp von Weitershausen e5f47731c6 [ReactNative] Only report console.error()s as exceptions in dev mode 2015-04-30 15:02:09 -08:00
Kevin Gozali 824da1bada [ReactNative] pass in launchOptions to relevant bridged modules 2015-04-30 14:51:09 -08:00
Ben Alpert 63ab6e8281 [react-native] Remove iOS-specific attributes from ART text 2015-04-30 13:23:16 -08:00
Ben Alpert 4f70e58b37 [react-native] Only intercept console.error on iOS 2015-04-30 12:06:47 -08:00
Andrei Coman 8fe6626d5f [react_native] JS files from D2028144: [react_native] Expose android version to JS 2015-04-30 11:42:14 -08:00
Nick Lockwood eb0476074f Improved debug and fixed macros 2015-04-30 09:59:16 -08:00
Ben Alpert 261a0af9bb [react-native] Fix Chrome debugging
Summary:
Requiring ExceptionsManager in renderApplication (added in D2023119) led to a transitive require of ExecutionEnvironment, which has to run after InitializeJavaScriptAppEngine.

InitializeJavaScriptAppEngine is the right place for this sort of logic because we control the order that things are loaded, so move the console.error hook initialization there.

@public

Test Plan: Loaded shell app in simulator with Chrome debugging with no errors.
2015-04-30 02:16:40 -08:00
Eric Vicenti 08ec846176 [ReactNative] Fix logic in popToRoute 2015-04-29 20:52:32 -08:00
Ben Alpert d8ab648fce Updates from Wed 29 Apr 2015-04-29 18:55:07 -07: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
Ben Alpert c6af33e796 [react-native] Open-source ReactART for native 2015-04-29 15:21:48 -08:00
Andy Street 96850b7429 [react_native] JS files from D2027955: [react_native] Add bridge 'spy mode' to watch bridge traffic 2015-04-29 11:49:05 -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
Andy Street c82c6a07ae [react_native] JS files from D2027859: [react_native] Fix ToTheLeft wizard transitions 2015-04-29 04:49:43 -08:00
Brent Vatne c09bdebcd5 Add support for multiline TextInput via UITextView
Summary:
@nicklockwood - Could I get a review of this?

Just took `RCTTextField` and ported it from `UITextField` to `UITextView` as you mentioned in another discussion, and removed any `UITextField` specific attributes.

- How do you think this should behave when there are subviews?
- Do you know how we can respond to the `UIControlEventEditingDidEndOnExit` event to respond to submit? Because `UITextView` isn't a `UIControl` we can't just use `addTarget` with `UIControlEventEditingDidEndOnExit`.
- Any other feedback?

Still going to look over the `UITextView` docs in more detail and make sure we expose all important options, and add it to the UIExplorer example, just putting this out here for feedback.

![multiline](https://cloud.githubusercontent.com/assets/90494/7310854/32174d6a-e9e8-11e4-919e-71e54cf3c739.gif)

Closes https://github.com/facebook/react-native/pull/991
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-29 01:33:58 -08:00
Eric Vicenti 349f8b942a [ReactNative] Avoid Navigator invariant in edge case
Summary:
It is very rare, but sometimes there is no active gesture when the responder gets released. This will avoid a redbox in that case

@public

Test Plan: Saw the redbox. No longer see the redbox. Hardcoded missing activeGesture while responder and verified no redbox
2015-04-28 23:53:39 -08:00
Spencer Ahrens ecf7baebea [React Native] Actually bring back console.error redboxes with disable flag 2015-04-28 14:53:36 -08:00
Eric Vicenti 9209c444c7 [ReactNative] Androidized Navigator animations
Summary:
Added configurations for android-like animations, with gestures disabled.

@public

Test Plan: Tested on AdsManager Android
2015-04-28 13:10:49 -08:00
Nick Lockwood 48297753cf Refactored RKSounds, moved it into it's own library, and fixed tests 2015-04-28 10:53:53 -08:00
Philipp von Weitershausen f2b38bacbf [ReactNative] parse localized JSON files in JS, not in ObjC 2015-04-28 09:52:35 -08:00
Nick Lockwood bc24be8584 Fixed nil object insertion crash due to incorrectly encoded HTTP response body data 2015-04-28 04:48:32 -08:00
Eric Vicenti 8afdf30363 [ReactNative] Navigator refactor and improvements 2015-04-27 21:37:33 -08:00
Spencer Ahrens 473acdbc74 [ReactNative] Fix fatal from long press 2015-04-27 20:46:23 -08:00
Eric Vicenti ec3d70e738 [ReactNative] Quiet Navigator context warning 2015-04-27 17:31:12 -08:00
Eric Vicenti 6749f88650 [ReactNative] Fix Navigator resetTo 2015-04-27 17:18:52 -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
Eric Vicenti 3f723f451d [ReactNative][RFC] Yellow Box for warnings 2015-04-27 13:32:22 -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
Tadeu Zagallo 136431cc2f [ReactNative] Fix struct args on exported methods 2015-04-27 04:01:37 -08:00
Gabe Levi 70c9f5140d Clean the errors that Flow v0.10.0 finds 2015-04-26 18:31:53 -04:00
Nick Lockwood 77e38b26c5 Improved RCTActivityIndicatorView and fixed some flow errors 2015-04-26 02:17:13 -08:00
Spencer Ahrens 1cc0c96508 [React Native] Bring back console.error redboxes with disable flag 2015-04-24 17:54:16 -08:00
Spencer Ahrens 68eb3e4906 [ReactNative] geolocation method docs 2015-04-24 16:26:28 -08:00
Spencer Ahrens a2dd7fc69f [ReactNative] Fix dimensions in jest tests 2015-04-24 14:00:35 -08:00
Spencer Ahrens 8465859411 Fix doc generation for Geolocation 2015-04-24 13:14:24 -07:00
Krzysztof Magiera 46db1826c5 [react_native] JS files from D2017699: Expose JavaScriptEnabled property for WebView component on android. 2015-04-24 11:53:35 -08:00
Spencer Ahrens 5225acea01 Fix tests 2015-04-24 12:15:11 -07:00
Alex Kotliarskyi 970bff6132 [ReactNative] Enable resolveAssetSource for Image.android 2015-04-24 10:56:04 -08:00
Spencer Ahrens 21b4b5b352 Updates from Fri 24 Apr 2015-04-24 11:46:18 -07:00
Kevin Gozali d094952725 [ReactNative] Re-applied D2011598 2015-04-24 10:33:41 -08:00
Andrei Coman a635a73abc [react_native] JS files from D2020585: [react_native] Remove focus for TextInputs when they unmount 2015-04-24 09:49:39 -08:00
Tadeu Zagallo d293bed5ab [ReactNative] Fix analyze errors on oss 2015-04-24 08:28:35 -08:00
Felix Oghina d354c7dd91 [react_native] JS files from D2009062: add geolocation support 2015-04-24 02:24:18 -08:00
Ben Alpert dd6f7743eb Fix updating RCTText with new text of the same size
Summary:
Fixes #979.

Previously, a Text whose width is determined automatically (as opposed to set by a container) would position the text incorrectly after an update to the text *if* the text's width did not change (i.e., when changing only digits in a font with tabular numbers).

Every time RCTShadowText's RCTMeasure runs, it sets the text container's size to be the maximum allowed size for the text. When RCTText's drawRect is called later, it relied on layoutSubviews having been called to set the text container's size back to the proper width. But if RCTMeasure returned the same dimensions as last time, then RCTText's frame wasn't reset and so layoutSubviews was never re-called. With this change, we set the textContainer's size each time we draw the text.

We could also fix this by using a different NSTextContainer instance in RCTMeasure. Not sure what the pros and cons of that are.
Closes https://github.com/facebook/react-native/pull/989
Github Author: Ben Alpert <balpert@fb.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-23 16:12:35 -08:00
Kevin Gozali ee3986342a [ReactNative][madman] Revert D2011598 temporarily 2015-04-23 15:12:01 -08:00
Eric Vicenti 36afc46274 [ReactNative] Fix for Navigator.replacePreviousAndPop 2015-04-23 14:19:44 -08:00
Philipp von Weitershausen e88ba1a6a3 [ReactNative] Back out D2014163 entirely 2015-04-23 12:02:47 -08:00
Bill Fisher 357a54500e Implement transform styles, redux 2015-04-23 10:17:39 -08:00
Alex Kotliarskyi 7de74b129d [ReactNative] Move NativeModules mock to OSS 2015-04-23 09:35:55 -08:00
Jakub Zika e293efbfb1 Bump .buckversion to 6cdb82cb7493a86c39d0f0dc3c102d0f470f55de. 2015-04-23 08:24:08 -08:00
Eduardo aa3d343547 NavigatorIOS custom nav bar colors
Summary:
NavigatorIOS with custom nav bar custom colors, working example included in
UIExplorer.

Based on pull request #318 to complete pending work based on comments.
Closes https://github.com/facebook/react-native/pull/695
Github Author: Eduardo <edo.lomeli@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-23 06:32:35 -08:00
Ivan Starkov a36da5130b Add Linear easing to AnimationUtils
Summary:
Simple linear easing also very useful.
Closes https://github.com/facebook/react-native/pull/794
Github Author: Ivan Starkov <istarkov@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-23 06:03:22 -08:00
Brent Vatne c219f61818 Add minimumTrackTintColor and maximumTrackTintColor to SliderIOS
Summary:
There are still many other props that can be added to further customize the SliderIOS component, but I had a specific need for these two so I just went ahead and added them.
Closes https://github.com/facebook/react-native/pull/799
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-23 05:57:15 -08:00
Dr. Kibitz 621a30c8b8 Fixes #813
Summary:
Also fix RCTShadowText export name.
Closes https://github.com/facebook/react-native/pull/857
Github Author: "Dr. Kibitz" <info@drkibitz.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-23 04:06:16 -08:00
Tadeu Zagallo 2bda21fbf0 [ReactNative] Flush ReactUpdates only once per batch 2015-04-22 17:57:07 -08:00
Alex Kotliarskyi ffb3026419 [ReactNative] Pick correct assets depending on device scale 2015-04-22 16:39:54 -08:00
Spencer Ahrens e63bfae8f6 [ReactNative] console.error shows RedBox with pretty stack trace 2015-04-22 15:51:41 -08:00
Alex Kotliarskyi c5ea25f7fb [ReactNative] Adopt client asset managing code to server changes 2015-04-22 13:41:28 -08:00
Nick Lockwood fc6e209223 Fixed broken struct arguments 2015-04-22 13:25:53 -08:00
Spencer Ahrens 0727cde42c [ReactNative] Quick fix to busted redboxes 2015-04-22 10:29:36 -08:00
Eric Vicenti 7aa413d619 [ReactNative] Fix Android back btn regression from D2010265 2015-04-22 10:06:10 -08:00
Andy Street eafe93096c [react_native] JS files from D2012956: [react_native] Never return null from XHR.getAllResponseHeaders if request has completed 2015-04-22 09:05:42 -08:00
Tadeu Zagallo 3595b79ec3 [ReactNative] Move VSync bound events to JS thread 2015-04-22 07:01:48 -08:00
Nick Lockwood 462224727a Reduced prop mapping overhead 2015-04-22 04:13:25 -08:00
Andy Street 0f7ebf23a9 [react_native] JS files from D1999034: [react_native] Fix source maps on Android 2015-04-22 03:38:55 -08:00
Spencer Ahrens 58a550fa06 [ReactNative] use requireNativeComponent to clean up a bunch of boilerplate 2015-04-21 21:06:48 -08:00
James Ide 901c24ebb8 [Text] Ensure that the text background is transparent by default
Summary:
For a very simple view I was observing that the text background was black and had to manually be set to transparent. This ensures that text nodes have a transparent background by default.

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

Test Plan:
 This example component no longer renders what looks like a black block, and instead displays legible text.

    var Example = React.createClass({
      render: function() {
          return (
            <View style={styles.container}>
              <Text>hello</Text>
            </View>
          );
      },
    });

    var styles = StyleSheet.create({
      container: {
        flex: 1,
      },
    };
2015-04-21 19:11:26 -08:00
Nick Lockwood b1a15004de Fixed release builds on UIExplorer 2015-04-21 18:22:34 -08:00
Josh Zana 368e507b38 Implement XmlHttpRequestBase#getAllResponseHeaders and getResponseHeader
Summary:
Used https://github.com/facebook/react-native/pull/382 as inspiration
but modified to return null instead of undefined as per the spec at
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest

This unblocks use of Dropbox.js within a react-native app, as well
as any other libraries that make use of these methods in XHR usage.

Closes https://github.com/facebook/react-native/issues/872
Closes https://github.com/facebook/react-native/pull/892
Github Author: Josh Zana <joshzana@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-21 16:45:32 -08:00
Mike Wilcox 17e5b04d1a Fix Typo
Summary:
* This PR fixes a typo for the NetInfo docs page
Closes https://github.com/facebook/react-native/pull/937
Github Author: Mike Wilcox <mwilcox56@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-21 16:41:34 -08:00
xcatliu 404f7d9dbf Fix AlertIOS Docs
Summary:
The curly braces seems to be redundant.
Closes https://github.com/facebook/react-native/pull/811
Github Author: xcatliu <xcatliu@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-21 16:10:31 -08:00
Nick Lockwood 2ee7ebae1f Fixed broken font weight on iPhone 5 2015-04-21 14:45:12 -08:00
Eric Vicenti 40eeaf5b37 [ReactNative] Navigator contextual popToRoute and imperitive vs contextual docs 2015-04-21 13:27:44 -08:00
Alex Kotliarskyi c6ad7b85d1 [ReactNative] Use network image for new image assets 2015-04-21 12:45:36 -08:00
Martin Konicek c0c2d4ca00 [react_native] JS files from D2009265: Fix resizeMode for images 2015-04-21 12:04:32 -08:00
Eric Vicenti 45c10ffc53 [ReactNative] Navigator touch grant bug from D2001635 2015-04-21 11:26:53 -08:00
Nick Lockwood ee898c24c7 Removed debug code from release builds 2015-04-21 09:47:21 -08:00
Philipp von Weitershausen 25ae5485da [ReactNative][MAdMan] helper for GraphQL-safe pixel size calculation 2015-04-21 08:21:52 -08:00
Philipp von Weitershausen a0db658982 [MAdMan] flowify AdsManagerGeoUtils 2015-04-21 08:11:30 -08:00
Andy Street b0348edcae [react_native] JS files from D2001635: [react_native] Use hardware layers during adsmanager Navigator navigation 2015-04-21 04:10:52 -08:00
Lochlan Wansbrough 765779a4bd Adds `opaque` and `underlayColor` to WebView.
Summary:
Enables overwriting of underlying colors for WebViews. Especially useful if you want to give your WebView a transparent background.
Closes https://github.com/facebook/react-native/pull/767
Github Author: Lochlan Wansbrough <lochie@live.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-20 18:11:37 -08:00
Alex Kotliarskyi a8a1798449 [ReactNative] Fix Chrome debugger 2015-04-20 14:37:24 -08:00
Nick Lockwood 5ce9fa4dda Changed default method queue to a background queue. 2015-04-20 12:02:04 -08:00
Nick Lockwood bbd5259586 Fixed reachability 2015-04-20 08:33:56 -08:00
Andy Street fde476f4e5 [react_native] JS files from D2001617: [react_native] Add support for rendering to hardware textures on Android 2015-04-20 03:10:56 -08:00
Tadeu Zagallo 0e67e33534 [ReactNative] Ensure JS calls scheduled by a deallocated context don't fire 2015-04-20 02:03:22 -08:00
Nick Lockwood 0b21df4a34 Improved logging and dev menu 2015-04-19 12:56:22 -08:00
Brent Vatne ebdc041b4f [Docs] Clarify schema support for LinkingIOS.openURL in Simulator 2015-04-18 16:32:01 -07:00
Andy Street 2186691812 Revert "[ReactNative] implement transform styles" 2015-04-18 11:54:08 -08:00
Nick Lockwood ead0f2e020 Implemented thread control for exported methods 2015-04-18 11:13:39 -08:00
Bill Fisher bd5b12c535 [ReactNative] implement transform styles 2015-04-17 22:30:21 -08:00
Basil Hosmer 17be6ba82a reinstate @flow 2015-04-17 18:17:16 -08:00
Spencer Ahrens ab1efbd4c1 [ReactNative] kill for...in array iteration in deepDiffer 2015-04-17 15:52:54 -08:00
Spencer Ahrens 65b6d209d9 [ReactNative] cleanup some requireNativeComponent cruft 2015-04-17 15:45:12 -08:00
Philipp von Weitershausen dbe8e31c20 [ReactNative][Navigator] Remove another unnecessary use of absolute screen width 2015-04-17 15:02:48 -08:00
Tadeu Zagallo 1883ba535c [ReactNative] Send batched calls from objc to js every frame + add bridge profiling 2015-04-17 04:01:02 -08:00
Andy Street 70a28547dd [react_native] JS files from D1998047: [react_native] Remove modalFullscreenView dimension 2015-04-17 03:42:50 -08:00
Andrei Coman af895bab53 [react_native] JS files from D1994196: [react_native] TextInput fix android viewconfig mixins: [NativeMethodsMixin, TimerMixin], 2015-04-17 02:50:04 -08:00
Spencer Ahrens 915151c5d7 [ReactNative] verifyPropTypes against native exports 2015-04-16 18:15:36 -08:00
Spencer Ahrens 764854c04a [ReactNative] introduce requireNativeComponent 2015-04-16 17:12:12 -08:00
Andy Street baed197a7d [react_native] JS files from D1998038: [react_native] Calculate density independent screen size in JS to prevent loss of precision 2015-04-16 14:44:34 -08:00
Philipp von Weitershausen fd8bc3b5f6 [ReactNative] Get rid of another pair of unnecessary Dimensions.get('window') 2015-04-16 12:10:55 -08:00
Eric Vicenti e382894ef3 [ReactNative] Navigator fix BackAndroid warning on iOS 2015-04-16 10:28:19 -08:00
Eric Vicenti b3a2d6c574 [ReactNative] Navigator initially render all scenes 2015-04-16 10:19:52 -08:00
Krzysztof Magiera 679399289d [react_native] Fix loadSourceMap problem with annotation section that prevents it from being loaded by packager. 2015-04-16 07:28:55 -08:00
Andrei Coman 486d871a7b [react_native] JS files from D1997727: [react_native] TextInput rename value to text 2015-04-16 07:04:02 -08:00
Forbes Lindesay 4f8b2825a0 Replace ES6Promise with Promise 2015-04-15 06:06:29 -08:00
guru inamdar 7a68691686 MapView to support MKPointAnnotation using new attribute annotate in Map...
Summary:
### MapView to support Pin annotation

    var pinLocation = {
			latitude: property.latitude,
			longitude: property.longitude,
			title: property.title
    };
    this.state = {propertyPoint: pinLocation};
    <MapView style={styles.map} region={this.state.region} annotate={this.state.propertyPoint}>
    </MapView>
![mapview-pinannotation](https://cloud.githubusercontent.com/assets/845379/7100280/6c1ffc08-dfe5-11e4-9d1b-8da6a65da1bc.png)

Closes https://github.com/facebook/react-native/pull/810
Github Author: guru inamdar <guru.inamdar@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-14 18:03:37 -08:00
Kevin Gozali e362fb2095 [ReactNative] Move image asset loading to a queue 2015-04-14 18:03:11 -08:00
Blixt f7aeefa521 Fix typo in PanResponder documentation
Summary:
The documentation said the config object expected `onResponderTerminationRequest` but it expects `onPanResponderTerminationRequest`.
Closes https://github.com/facebook/react-native/pull/834
Github Author: Blixt <me@blixt.nyc>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-14 15:03:30 -08:00
Tim Yung 29696a26eb React Native: Fix InteractionManager Race Condition 2015-04-13 11:14:11 -08:00
Nick Lockwood 26fd24dc50 Cleanup 2015-04-11 14:19:49 -08:00
Eric Vicenti 699a9c3e0c [ReactNative] Fix focusing of nested Navigators 2015-04-10 17:58:30 -08:00
Eric Vicenti 75d52b0f33 [ReactNative] Avoid navigator scene renders during transition 2015-04-10 15:13:00 -08:00
Eric Vicenti 50959dd42c [AdsManager|ReactNative] Switch to contextual request pop instead of parentNavigator 2015-04-10 12:54:07 -08:00
Tadeu Zagallo 4616037428 [ReactNative] Fix push notifications on iOS7 2015-04-10 03:09:35 -08:00
Mike Driver b1850f8fca Implemented response headers when using `XMLHttpRequest`
Summary:
I think perhaps these were left out by mistake?
Closes https://github.com/facebook/react-native/pull/382
Github Author: Mike Driver <mikedriver@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-09 19:31:57 -08:00
jcgertig 8d643224ee Link LinkingIOS in SampleApp
Summary:
Closes https://github.com/facebook/react-native/pull/656
Github Author: jcgertig <jcgertig@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-09 17:33:45 -08:00
Will Piers c831328dcf unify use of password and secureTextEntry for TextInput
Summary:
Currently, the documentation shows both `password` and `secureTextEntry` as props for TextInput. However, the `password` prop is only passed to the Android component, so it does not work as expected for iOS developers. This PR prefers `password` over `secureTextEntry` but won't break anybody's code.
Closes https://github.com/facebook/react-native/pull/622
Github Author: Will Piers <wpiers@rallydev.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-09 17:17:44 -08:00
Andrei Coman 96e9ad9aec [react_native] JS files from D1980312: [react_native] Fix webview 2015-04-09 15:21:13 -08:00
Tyler McGinnis e1fb8e64b5 Remove duplicate word
Summary:
Closes https://github.com/facebook/react-native/pull/768
Github Author: Tyler McGinnis <tylermcginnis33@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-09 08:48:22 -08:00
Kureev Alexey 50309c984d NavigatorIOS navigationBarHidden property support
Summary:
Usage example:
```javascript
var AwesomeProject = React.createClass({
  render: function() {
    return (
      <NavigatorIOS
        style={styles.navigator}
        navigationBarHidden={true}
        initialRoute={{
          component: Example,
          title: 'Test'
        }}
      />
    );
  }
});
```
Closes https://github.com/facebook/react-native/pull/374
Github Author: Kureev Alexey <kureev-mail@ya.ru>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-09 08:46:14 -08:00
Alex Akers fcc87916d2 [React Native] Fix RCTText crashes 2015-04-09 07:34:12 -08:00
Brent Vatne 17ab4f2fb3 Ensure that NSLocationWhenInUseUsageDescription is set, throw error if not
Summary:
As per #750, throw error when trying to use the geolocation module and this key is not set. cc @frantic
Closes https://github.com/facebook/react-native/pull/762
Github Author: Brent Vatne <brent.vatne@madriska.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-08 21:28:16 -08:00
Eric Vicenti 839e533955 [ReactNative] Re-configure horizontal swipe animations 2015-04-08 21:13:32 -08:00
Philipp von Weitershausen ae76d3982b [MAdMan] Dimensions.get('window') considered harmful 2015-04-08 18:08:23 -08:00
Josh Levine be46ccf4c4 Navigator: Changed transitioner background color to 'transparent'
Summary:
... for setting the transition background color between scenes. For issue #563
Closes https://github.com/facebook/react-native/pull/654
Github Author: Josh Levine <josh.levine1@gmail.com>

Test Plan: Imported from GitHub, without a `Test Plan:` line.
2015-04-08 16:37:26 -08:00
Spencer Ahrens 9ea0002774 [ReactNative] fixup AnimationExperimental a bit 2015-04-08 14:09:32 -08:00
Alex Akers 8a57c4e980 [React Native] RCT_EXPORT lvl.2 2015-04-08 08:34:10 -08:00
Andrei Coman 341d1a12bf [react_native] JS files from D1955360: [react_native] Implement TextInput end editing 2015-04-08 08:06:12 -08:00
Andrei Coman 805d52198c [react_native] JS files from D1952037: [react_native] Make TextInput focus, blur, dismiss and show keyboard work var autoCapitalize = autoCapitalizeConsts[this.props.autoCapitalize]; style={[this.props.style]} 2015-04-08 06:47:24 -08:00
Nick Lockwood bf4868edda Added non-class-scanning-based approach fror registering js methods 2015-04-08 05:45:20 -08:00
Eric Vicenti 009f8ebe63 [ReactNative] Fix typo/bug in Navigator._completeTransition 2015-04-07 20:35:33 -08:00
Eric Vicenti d63bf428cd [ReactNative] Fix Navigator exception when touching during transition 2015-04-07 19:54:34 -08:00
Tadeu Zagallo 72390239be [ReactNative] Fix and re-add WebView executor 2015-04-07 18:25:38 -08:00
Eric Vicenti ccbd656070 [AdsManager] Correct back button functionality 2015-04-07 16:07:43 -08:00
Eric Vicenti 31b6ff6d1a [ReactNative] Replace Backstack with BackAndroid 2015-04-07 16:07:42 -08:00