From bd3a3a4c8de94b27460e4cdf9b4b41f0eebe2156 Mon Sep 17 00:00:00 2001 From: Travis CI Date: Thu, 10 Dec 2015 02:13:33 +0000 Subject: [PATCH] update website --- docs/actionsheetios.html | 40 +++++++- docs/appregistry.html | 6 +- docs/embedded-app-ios.html | 1 + docs/linux-windows-support.html | 2 +- docs/navigatorios.html | 4 +- docs/netinfo.html | 174 +++++++++++++++++++++++++++++++- docs/pickerios.html | 3 +- 7 files changed, 220 insertions(+), 10 deletions(-) diff --git a/docs/actionsheetios.html b/docs/actionsheetios.html index efe30a615fc..ea9739f3e91 100644 --- a/docs/actionsheetios.html +++ b/docs/actionsheetios.html @@ -12,7 +12,7 @@ 'Option 0', 'Option 1', 'Option 2', - 'Destruct', + 'Delete', 'Cancel', ]; var DESTRUCTIVE_INDEX = 3; @@ -50,6 +50,40 @@ } }); +var ActionSheetTintExample = React.createClass({ + getInitialState() { + return { + clicked: 'none', + }; + }, + + render() { + return ( + <View> + <Text onPress={this.showActionSheet} style={style.button}> + Click to show the ActionSheet + </Text> + <Text> + Clicked button: {this.state.clicked} + </Text> + </View> + ); + }, + + showActionSheet() { + ActionSheetIOS.showActionSheetWithOptions({ + options: BUTTONS, + cancelButtonIndex: CANCEL_INDEX, + destructiveButtonIndex: DESTRUCTIVE_INDEX, + tintColor: 'green', + }, + (buttonIndex) => { + this.setState({ clicked: BUTTONS[buttonIndex] }); + }); + } +}); + + var ShareActionSheetExample = React.createClass({ getInitialState() { return { @@ -108,6 +142,10 @@ exports.examples : 'Show Action Sheet', render(): ReactElement { return <ActionSheetExample />; } }, + { + title: 'Show Action Sheet with tinted buttons', + render(): ReactElement { return <ActionSheetTintExample />; } + }, { title: 'Show Share Action Sheet', render(): ReactElement { return <ShareActionSheetExample />; } diff --git a/docs/appregistry.html b/docs/appregistry.html index 2666f7e5642..74912ada117 100644 --- a/docs/appregistry.html +++ b/docs/appregistry.html @@ -2,9 +2,11 @@ root components should register themselves with AppRegistry.registerComponent, then the native system can load the bundle for the app and then actually run the app when it's ready by invoking -AppRegistry.runApplication.

AppRegistry should be required early in the require sequence to make +AppRegistry.runApplication.

To "stop" an application when a view should be destroyed, call +AppRegistry.unmountApplicationComponentAtRootTag with the tag that was +pass into runApplication. These should always be used as a pair.

AppRegistry should be required early in the require sequence to make sure the JS execution environment is setup before other modules are -required.

Methods #

static registerConfig(config: Array<AppConfig>) #

static registerComponent(appKey: string, getComponentFunc: ComponentProvider) #

static registerRunnable(appKey: string, func: Function) #

static getAppKeys() #

static runApplication(appKey: string, appParameters: any) #

Next →

Linux and Windows Support

NOTE: This guide focuses on Android development. You'll need a Mac to build iOS apps.

As React Native on iOS requires a Mac and most of the engineers at Facebook and contributors use Macs, support for OS X is a top priority. However, we would like to support developers using Linux and Windows too. We believe we'll get the best Linux and Windows support from people using these operating systems on a daily basis.

Therefore, Linux and Windows support for the development environment is an ongoing community responsibility. This can mean filing issues and submitting PRs, and we'll help review and merge them. We are looking forward to your contributions and appreciate your patience.

As of version 0.14 Android development with React native is mostly possible on Linux and Windows. You'll need to install Node.js 4.0 or newer. On Linux we recommend installing watchman, otherwise you might hit a node file watching bug.

What's missing on Windows #

On Windows the packager won't be started automatically when you run react-native run-android. You can start it manually using:

cd MyAwesomeApp -node node_modules/react-native/packager/packager.js
© 2015 Facebook Inc.

NavigatorIOS

NavigatorIOS wraps UIKit navigation and allows you to add back-swipe -functionality across your app.

Routes #

A route is an object used to describe each page in the navigator. The first +functionality across your app.

NOTE: This Component is not maintained by Facebook

This component is under community responsibility. +If a pure JavaScript solution fits your needs you may try the Navigator +component instead.

Routes #

A route is an object used to describe each page in the navigator. The first route is provided to NavigatorIOS as initialRoute:

render: function() { return ( <NavigatorIOS diff --git a/docs/netinfo.html b/docs/netinfo.html index 23f172472c9..48c55b5b3d8 100644 --- a/docs/netinfo.html +++ b/docs/netinfo.html @@ -13,10 +13,10 @@ NetInfo.addE handleFirstConnectivityChange );

IOS #

Asynchronously determine if the device is online and on a cellular network.

  • none - device is offline
  • wifi - device is online and connected via wifi, or is the iOS simulator
  • cell - device is connected via Edge, 3G, WiMax, or LTE
  • unknown - error case and the network status is unknown

Android #

To request network info, you need to add the following line to your app's AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> -Asynchronously determine if the device is connected and details about that connection.

Android Connectivity Types.

  • NONE - device is offline
  • BLUETOOTH - The Bluetooth data connection.
  • DUMMY - Dummy data connection.
  • ETHERNET - The Ethernet data connection.
  • MOBILE - The Mobile data connection.
  • MOBILE_DUN - A DUN-specific Mobile data connection.
  • MOBILE_HIPRI - A High Priority Mobile data connection.
  • MOBILE_MMS - An MMS-specific Mobile data connection.
  • MOBILE_SUPL - A SUPL-specific Mobile data connection.
  • VPN - A virtual network using one or more native bearers. Requires API Level 21
  • WIFI - The WIFI data connection.
  • WIMAX - The WiMAX data connection.
  • UNKNOWN - Unknown data connection.

The rest ConnectivityStates are hidden by the Android API, but can be used if necessary.

isConnectionMetered #

Available on Android. Detect if the current active connection is metered or not. A network is +Asynchronously determine if the device is connected and details about that connection.

Android Connectivity Types.

  • NONE - device is offline
  • BLUETOOTH - The Bluetooth data connection.
  • DUMMY - Dummy data connection.
  • ETHERNET - The Ethernet data connection.
  • MOBILE - The Mobile data connection.
  • MOBILE_DUN - A DUN-specific Mobile data connection.
  • MOBILE_HIPRI - A High Priority Mobile data connection.
  • MOBILE_MMS - An MMS-specific Mobile data connection.
  • MOBILE_SUPL - A SUPL-specific Mobile data connection.
  • VPN - A virtual network using one or more native bearers. Requires API Level 21
  • WIFI - The WIFI data connection.
  • WIMAX - The WiMAX data connection.
  • UNKNOWN - Unknown data connection.

The rest ConnectivityStates are hidden by the Android API, but can be used if necessary.

isConnectionExpensive #

Available on Android. Detect if the current active connection is metered or not. A network is classified as metered when the user is sensitive to heavy data usage on that connection due to -monetary costs, data limitations or battery/performance issues.

NetInfo.isConnectionMetered((isConnectionMetered) => { - console.log('Connection is ' + (isConnectionMetered ? 'Metered' : 'Not Metered')); +monetary costs, data limitations or battery/performance issues.

NetInfo.isConnectionExpensive((isConnectionExpensive) => { + console.log('Connection is ' + (isConnectionExpensive ? 'Expensive' : 'Not Expensive')); });

isConnected #

Available on all platforms. Asynchronously fetch a boolean to determine internet connectivity.

NetInfo.isConnected.fetch().done((isConnected) => { console.log('First, is ' + (isConnected ? 'online' : 'offline')); @@ -31,7 +31,173 @@ internet connectivity.

NetInfo.isConnected.addEventListener( 'change', handleFirstConnectivityChange -);

Methods #

static addEventListener(eventName: ChangeEventName, handler: Function) #

static removeEventListener(eventName: ChangeEventName, handler: Function) #

static fetch() #

Properties #

isConnected: ObjectExpression #

isConnectionMetered: TypeCastExpression #

© 2015 Facebook Inc.