From e5d035510c6785234e6f834e767ea67a0822e80a Mon Sep 17 00:00:00 2001 From: Travis CI Date: Tue, 31 Mar 2015 19:34:11 +0000 Subject: [PATCH] update website --- docs/alertios.html | 96 ++++++++++- docs/appstateios.html | 65 +++++++- docs/asyncstorage.html | 101 +++++++++++- docs/geolocation.html | 69 +++++++- docs/image.html | 300 +++++++++++++++++++++++++++++++++- docs/mapview.html | 192 +++++++++++++++++++++- docs/navigatorios.html | 212 +++++++++++++++++++++++- docs/netinfo.html | 133 ++++++++++++++- docs/pushnotificationios.html | 33 ++-- docs/scrollview.html | 98 ++++++++++- docs/sliderios.html | 54 +++++- docs/statusbarios.html | 83 +++++++++- docs/textinput.html | 300 +++++++++++++++++++++++++++++++++- docs/vibrationios.html | 40 ++++- docs/view.html | 127 +++++++++++++- docs/webview.html | 264 +++++++++++++++++++++++++++++- 16 files changed, 2130 insertions(+), 37 deletions(-) diff --git a/docs/alertios.html b/docs/alertios.html index 6b3b15d3c87..a7e76e762cc 100644 --- a/docs/alertios.html +++ b/docs/alertios.html @@ -1,7 +1,101 @@ React Native | A framework for building native apps using React

AlertIOS

AlertIOS manages native iOS alerts, option sheets, and share dialogs

Methods #

static alert(title: string, message?: string, buttons?: Array<{ text: ?string; onPress: ?Function; - }>) #

© 2015 Facebook Inc.

PushNotificationIOS

Handle push notifications for your app, including permission handling and -icon badge number.

To get up and running, configure your notifications with Apple -and your server-side system. To get an idea, this is the Parse guide.

Methods #

static setApplicationIconBadgeNumber(number: number) #

Sets the badge number for the app icon on the home screen

static getApplicationIconBadgeNumber(callback: Function) #

Gets the current badge number for the app icon on the home screen

static addEventListener(type: string, handler: Function) #

Attaches a listener to remote notifications while the app is running in the -foreground or the background.

The handler will get be invoked with an instance of PushNotificationIOS

static requestPermissions() #

Requests all notification permissions from iOS, prompting the user's -dialog box.

static checkPermissions(callback: Function) #

See what push permissions are currently enabled. callback will be -invoked with a permissions object:

  • alert :boolean
  • badge :boolean
  • sound :boolean

static removeEventListener(type: string, handler: Function) #

Removes the event listener. Do this in componentWillUnmount to prevent -memory leaks

static popInitialNotification() #

An initial notification will be available if the app was cold-launched -from a notification.

The first caller of popInitialNotification will get the initial -notification object, or null. Subsequent invocations will return null.

constructor(nativeNotif) #

You will never need to instansiate PushNotificationIOS yourself. -Listening to the notification event and invoking -popInitialNotification is sufficient

getMessage() #

An alias for getAlert to get the notification's main message string

getSound() #

Gets the sound string from the aps object

getAlert() #

Gets the notification's main message from the aps object

getBadgeCount() #

Gets the badge count number from the aps object

getData() #

Gets the data object on the notif

© 2015 Facebook Inc.
\ No newline at end of file +Error: ReferenceError: notification is not defined + at /Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/guard.js:27:12 + at onOutputGenerated (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/index.js:96:9) + at Object.renderReactPage.done (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/DefaultRouter.js:352:7) + at renderReactPage (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/renderReactPage.js:130:17) + at renderComponentPackage (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/DefaultRouter.js:338:3) + at routePackageHandler (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/DefaultRouter.js:281:5) + at onComputePackage (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/index.js:100:9) + at /Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/guard.js:29:10 + at onWarmed (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/Packager.js:270:9) + at /Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/node_modules/async/lib/async.js:116:25 \ No newline at end of file diff --git a/docs/scrollview.html b/docs/scrollview.html index eb7754288fb..ce9f051a32c 100644 --- a/docs/scrollview.html +++ b/docs/scrollview.html @@ -39,7 +39,103 @@ The default value is true.

style style #

backgroundColor string
borderBottomColor string
borderColor string
borderLeftColor string
borderRadius number
borderRightColor string
borderTopColor string
opacity number
overflow enum('visible', 'hidden')
rotation number
scaleX number
scaleY number
shadowColor string
shadowOffset {h: number, w: number}
shadowOpacity number
shadowRadius number
transformMatrix [number]
translateX number
translateY number

zoomScale number #

The current scale of the scroll view content. The default value is 1.0.

Next →

StatusBarIOS

All rights reserved.

This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant -of patent rights can be found in the PATENTS file in the same directory.

@flow

Methods #

static setStyle(style: number, animated?: boolean) #

static setHidden(hidden: boolean, animation: number) #

© 2015 Facebook Inc.

VibrationIOS

The Vibration API is exposed at VibrationIOS.vibrate(). On iOS, calling this function will trigger a one second vibration. The vibration is asynchronous so this method will return immediately.

There will be no effect on devices that do not support Vibration, eg. the iOS -simulator.

Vibration patterns are currently unsupported.

Methods #

static vibrate() #

© 2015 Facebook Inc.

WebView

Edit on GitHubProps #

automaticallyAdjustContentInsets bool #

contentInset {top: number, left: number, bottom: number, right: number} #

onNavigationStateChange function #

renderError function #

renderLoading function #

shouldInjectAJAXHandler bool #

startInLoadingState bool #

url string #

© 2015 Facebook Inc.

WebView

Edit on GitHubProps #

automaticallyAdjustContentInsets bool #

contentInset {top: number, left: number, bottom: number, right: number} #

onNavigationStateChange function #

renderError function #

renderLoading function #

shouldInjectAJAXHandler bool #

startInLoadingState bool #

url string #

Edit on GitHubExamples #

'use strict'; + +var React = require('react-native'); +var StyleSheet = require('StyleSheet'); +var { + ActivityIndicatorIOS, + StyleSheet, + Text, + TextInput, + TouchableOpacity, + View, + WebView +} = React; + +var HEADER = '#3b5998'; +var BGWASH = 'rgba(255,255,255,0.8)'; +var DISABLED_WASH = 'rgba(255,255,255,0.25)'; + +var TEXT_INPUT_REF = 'urlInput'; +var WEBVIEW_REF = 'webview'; +var DEFAULT_URL = 'https://m.facebook.com'; + +var WebViewExample = React.createClass({ + + getInitialState: function() { + return { + url: DEFAULT_URL, + status: 'No Page Loaded', + backButtonEnabled: false, + forwardButtonEnabled: false, + loading: true, + }; + }, + + inputText: '', + + handleTextInputChange: function(event) { + this.inputText = event.nativeEvent.text; + }, + + render: function() { + this.inputText = this.state.url; + + return ( + <View style={[styles.container]}> + <View style={[styles.addressBarRow]}> + <TouchableOpacity onPress={this.goBack}> + <View style={this.state.backButtonEnabled ? styles.navButton : styles.disabledButton}> + <Text> + {'<'} + </Text> + </View> + </TouchableOpacity> + <TouchableOpacity onPress={this.goForward}> + <View style={this.state.forwardButtonEnabled ? styles.navButton : styles.disabledButton}> + <Text> + {'>'} + </Text> + </View> + </TouchableOpacity> + <TextInput + ref={TEXT_INPUT_REF} + autoCapitalize="none" + value={this.state.url} + onSubmitEditing={this.onSubmitEditing} + onChange={this.handleTextInputChange} + clearButtonMode="while-editing" + style={styles.addressBarTextInput} + /> + <TouchableOpacity onPress={this.pressGoButton}> + <View style={styles.goButton}> + <Text> + Go! + </Text> + </View> + </TouchableOpacity> + </View> + <WebView + ref={WEBVIEW_REF} + automaticallyAdjustContentInsets={false} + style={styles.webView} + url={this.state.url} + renderError={this.renderError} + renderLoading={this.renderLoading} + onNavigationStateChange={this.onNavigationStateChange} + startInLoadingState={true} + /> + <View style={styles.statusBar}> + <Text style={styles.statusBarText}>{this.state.status}</Text> + </View> + </View> + ); + }, + + goBack: function() { + this.refs[WEBVIEW_REF].goBack(); + }, + + goForward: function() { + this.refs[WEBVIEW_REF].goForward(); + }, + + reload: function() { + this.refs[WEBVIEW_REF].reload(); + }, + + onNavigationStateChange: function(navState) { + this.setState({ + backButtonEnabled: navState.canGoBack, + forwardButtonEnabled: navState.canGoForward, + url: navState.url, + status: navState.title, + loading: navState.loading, + }); + }, + + renderError: function(errorDomain, errorCode, errorDesc) { + return ( + <View style={styles.errorContainer}> + <Text style={styles.errorTextTitle}> + Error loading page + </Text> + <Text style={styles.errorText}> + {'Domain: ' + errorDomain} + </Text> + <Text style={styles.errorText}> + {'Error Code: ' + errorCode} + </Text> + <Text style={styles.errorText}> + {'Description: ' + errorDesc} + </Text> + </View> + ); + }, + + renderLoading: function() { + return ( + <View style={styles.loadingView}> + <ActivityIndicatorIOS /> + </View> + ); + }, + + onSubmitEditing: function(event) { + this.pressGoButton(); + }, + + pressGoButton: function() { + var url = this.inputText.toLowerCase(); + if (url === this.state.url) { + this.reload(); + } else { + this.setState({ + url: url, + }); + } + // dismiss keyoard + this.refs[TEXT_INPUT_REF].blur(); + }, + +}); + +var styles = StyleSheet.create({ + container: { + flex: 1, + backgroundColor: HEADER, + }, + addressBarRow: { + flexDirection: 'row', + padding: 8, + }, + webView: { + backgroundColor: BGWASH, + height: 350, + }, + addressBarTextInput: { + backgroundColor: BGWASH, + borderColor: 'transparent', + borderRadius: 3, + borderWidth: 1, + height: 24, + paddingLeft: 10, + paddingTop: 3, + paddingBottom: 3, + flex: 1, + fontSize: 14, + }, + navButton: { + width: 20, + padding: 3, + marginRight: 3, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: BGWASH, + borderColor: 'transparent', + borderRadius: 3, + }, + disabledButton: { + width: 20, + padding: 3, + marginRight: 3, + alignItems: 'center', + justifyContent: 'center', + backgroundColor: DISABLED_WASH, + borderColor: 'transparent', + borderRadius: 3, + }, + goButton: { + height: 24, + padding: 3, + marginLeft: 8, + alignItems: 'center', + backgroundColor: BGWASH, + borderColor: 'transparent', + borderRadius: 3, + alignSelf: 'stretch', + }, + loadingView: { + backgroundColor: BGWASH, + flex: 1, + justifyContent: 'center', + alignItems: 'center', + }, + errorContainer: { + flex: 1, + justifyContent: 'center', + alignItems: 'center', + backgroundColor: BGWASH, + }, + errorTextTitle: { + fontSize: 15, + fontWeight: '500', + marginBottom: 10, + }, + errorText: { + fontSize: 14, + textAlign: 'center', + marginBottom: 2, + }, + statusBar: { + flexDirection: 'row', + alignItems: 'center', + paddingLeft: 5, + height: 22, + }, + statusBarText: { + color: 'white', + fontSize: 13, + }, + spinner: { + width: 20, + marginRight: 6, + }, +}); + +exports.title = '<WebView>'; +exports.description = 'Base component to display web content'; +exports.examples = [ + { + title: 'WebView', + render(): ReactElement { return <WebViewExample />; } + } +];
© 2015 Facebook Inc.