Commit Graph

11 Commits

Author SHA1 Message Date
Alexey Lang bbeaac5d3b Automatically adjust content inset after view controller did layout subviews 2015-09-04 07:00:21 -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
Nick Lockwood 88e0bbc469 Ran Convert > To Modern Objective C Syntax 2015-08-25 01:08:49 -08:00
Nick Lockwood 48af214216 Simplified event registration
Summary:
Our events all follow a common pattern, so there's no good reason why the configuration should be so verbose. This diff eliminates that redundancy, and gives us the freedom to simplify the underlying mechanism in future without further churning the call sites.
2015-08-11 06:41:04 -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
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
Nick Lockwood 650fc9de4c Increased warning levels to -Wall -Wextra, and fixed Xcode 7 beta issues
Summary:
@public

I've increased the warning levels in the OSS frameworks, which caught a bunch of minor issues. I also fixed some new errors in Xcode 7 relating to designated initializers and TLS security.

Test Plan:
* Test the sample apps and make sure they still work.
* Run tests.
2015-06-15 07:52:50 -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
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
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
Tadeu Zagallo 20291a02df [ReactNative] s/ReactKit/React/g 2015-03-26 02:42:24 -08:00