139 Commits

Author SHA1 Message Date
Tadeu Zagallo
736d860571 [ReactNative] Fix RCTScrollView setContentInset 2015-05-07 16:56:02 -08:00
Jiajie Zhu
7b4ea51bf0 [madman] map - fix bug that onRegionChangeComplete stopped emitting 2015-05-07 16:16:27 -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
Tadeu Zagallo
6b38fad219 [ReactNative] Fix ref to eventDispatcher on RCTBridge 2015-05-07 09:05:29 -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
James Ide
b8bf4d0957 [Loader] Post a notification when the JS fails to load
Summary:
This provides a way to get notified when a bridge fails to load JS, allowing apps to handle the error.

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

Test Plan: run the UIExplorer app with the packager server not running, and verify that the notification is posted.
2015-05-07 04:26:24 -08:00
Nick Lockwood
205c22b915 Fixed dev menu loop 2015-05-07 03:55:43 -08:00
Nick Lockwood
47164baaec Fixed redbox error loop when camera access is disabled 2015-05-06 17:21:10 -08:00
Tadeu Zagallo
8d83b7ff63 [ReactNative] RCTWebViewExecutor - Fix string containing script tag support 2015-05-06 17:08:33 -08:00
Nick Lockwood
790cee6e26 Fixed broken listview header alignment 2015-05-06 10:48:24 -08:00
Tadeu Zagallo
ea470408e2 [ReactNative] Allow JSON fragments on RCTJSONStringify 2015-05-06 05:44:40 -08:00
Nick Lockwood
88a83084e4 Fixed UIExplorer in Catalyst shell 2015-05-06 00:08:08 -08:00
Nick Lockwood
54974d6333 +[RCTConvert UIFont:] tests 2015-05-05 17:37:59 -08:00
Iragne
88715e5c93 Update RCTNavigator.m
Summary:
Related to this issue
I created the PR.
Feel free to talk about it.

https://github.com/facebook/react-native/issues/65#issuecomment-93240332

Thanks
Closes https://github.com/facebook/react-native/pull/1131
Github Author: Iragne <adelskott@gmail.com>

Test Plan: Open NavigatorIOS example in UIExplorer, push recurse navigation several times. Press back and observe that it no longer breaks.
2015-05-05 08:32:14 -08:00
Tadeu Zagallo
3ab4d32538 [ReactNative] Fix DevMenu crash when launching the app with WebView executor 2015-05-05 07:30:55 -08:00
Alex Akers
08246b77df [React Native] Fix immediate animation crash 2015-05-05 07:21:43 -08:00
Nick Lockwood
acafa7e921 [ReactNative] Properly transition RCTTouchHandler state
Summary:
When touches end or cancel, update self.state in
RCTTouchHandler to let iOS know that we are in an ended/canceled state.
This way we won't eat other touches because it still thinks we're in a
began/changed state.

@public

Test Plan:
Scrolling in the back swipe area no longer busts gesture
recognition in Wilde.
2015-05-05 06:21:55 -08:00
Alex Akers
5eca2e1d3c [React Native] Added RCTSettings 2015-05-05 05:46:52 -08:00
Tadeu Zagallo
65a3da3003 [ReactNative] Fix chrome debugger 2015-05-05 05:36:05 -08:00
Tadeu Zagallo
d713a711c4 [ReactNative] Fix packager assets 2015-05-05 02:54:51 -08:00
Andrew Rasmussen
af921542b5 [ReactNative] update Layout
Summary:
I made some changes to css-layout that changes how layout is
computed for absolutely positioned nodes inside absolutely positioned
parents that have borders/padding. There were also some other changes
made to css-layout that haven't been merged in yet.

@public

Test Plan:
Made a node as described above, saw that the layout is
computed differently than in the browser, updated Layout, saw that the
Layout is not computed correctly.
2015-05-04 20:08:49 -08:00
Tadeu Zagallo
132a9170f1 [ReactNative] Create private underlying bridge to prevent retain cycles 2015-05-04 10:36:20 -08:00
Nick Lockwood
c5a6ec5b53 Disable React Native dev menu in release mode 2015-05-03 15:57:26 -08:00
Nick Lockwood
d29a0c6768 Fix for nil array crash 2015-05-02 18:40:04 -08:00
Tadeu Zagallo
09460cf21b [ReactNative] Use explicit doubles on RCTLocationOptions to avoid NSInvocation bug 2015-05-02 14:19:56 -08:00
Tadeu Zagallo
17262db5a9 [ReactNative] Fix JS calls being lost 2015-05-02 13:14:19 -08:00
Nick Lockwood
ba501a1bf5 Upgraded dev menu 2015-05-01 06:36:49 -08:00
Tadeu Zagallo
67196b36bb [ReactNative] Fix WebView executor 2015-05-01 06:11:36 -08:00
Kevin Gozali
b6646d1c4c [ReactNative] Honor fontWeight once again 2015-04-30 11:33:36 -08:00
Nick Lockwood
eb0476074f Improved debug and fixed macros 2015-04-30 09:59:16 -08:00
Alex Akers
d82aaa7fb3 [React Native] Remove RKCustomTabBarController
Summary:
@public
Closes GitHub issue #1064

Test Plan: @nicklockwood approves.
2015-04-30 07:59:59 -08:00
Tadeu Zagallo
483077d4da [ReactNative] Don't log invalid utf8 strings 2015-04-29 12:24:52 -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
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
Tadeu Zagallo
2f4430cf51 [ReactNative] Fix bridge event dedupe 2015-04-28 07:58:35 -08:00
Alex Akers
f7276b0ae4 [React Native] Fix borderWidth setter bug 2015-04-28 07:53:28 -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
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
Alex Akers
826b56a41b [React Native] Update RCTView border implementation 2015-04-27 04:10:43 -08:00
Tadeu Zagallo
136431cc2f [ReactNative] Fix struct args on exported methods 2015-04-27 04:01:37 -08:00
Tadeu Zagallo
8aeb33d44c [ReactNative] Make so each RCTContextExecutor has its own thread 2015-04-27 03:46:27 -08:00
Nick Lockwood
77e38b26c5 Improved RCTActivityIndicatorView and fixed some flow errors 2015-04-26 02:17:13 -08:00
Tadeu Zagallo
dd6bce78e1 [ReactNative] Allow bridge modules to run on the JavaScript thread 2015-04-25 19:29:00 -08:00
Nick Lockwood
8a3b0fa9e8 Fix edge cases and add tests for +[RCTConvert NSURL:] 2015-04-25 15:11:23 -08:00
Tadeu Zagallo
bd5736414a [ReactNative] Fix error when reload during profile 2015-04-25 13:23:09 -08:00
Spencer Ahrens
1cc0c96508 [React Native] Bring back console.error redboxes with disable flag 2015-04-24 17:54:16 -08:00
Tadeu Zagallo
d293bed5ab [ReactNative] Fix analyze errors on oss 2015-04-24 08:28:35 -08:00
Kevin Gozali
34a5aa1d0a [ReactNative][madman] Revert D2001353 2015-04-23 13:39:56 -08:00
Philipp von Weitershausen
e88ba1a6a3 [ReactNative] Back out D2014163 entirely 2015-04-23 12:02:47 -08:00