diff --git a/releases/next/css/react-native.css b/releases/next/css/react-native.css index e812927d97d..4e8d3694689 100644 --- a/releases/next/css/react-native.css +++ b/releases/next/css/react-native.css @@ -1237,6 +1237,23 @@ div[data-twttr-id] iframe { margin-left: 20px; } +.methodTitle { + font-weight: bold; + font-size: 24px; + color: #E9967A; +} + +.compactProps .methodTitle { + font-size: 14px; + margin-bottom: 0; + margin-top: 0; +} + +.compactProps .methodTitle div { + font-weight: normal; + margin-left: 20px; +} + .prop { padding: 5px 10px; } @@ -1255,6 +1272,16 @@ div[data-twttr-id] iframe { font-size: 13px; } +.methodType { + font-weight: normal; + font-size: 24px; +} + +.compactProps .methodType { + font-weight: normal; + font-size: 13px; +} + .platform { background-color: hsl(198, 100%, 87%); border-radius: 5px; diff --git a/releases/next/docs/actionsheetios.html b/releases/next/docs/actionsheetios.html index 399b830d9f9..2ac5d4e3a9a 100644 --- a/releases/next/docs/actionsheetios.html +++ b/releases/next/docs/actionsheetios.html @@ -1,5 +1,5 @@ -ActionSheetIOS – React Native | A framework for building native apps using React

ActionSheetIOS #

Edit on GitHub

Methods #

static showActionSheetWithOptions(options, callback) #

Display an iOS action sheet. The options object must contain one or more -of:

  • options (array of strings) - a list of button titles (required)
  • cancelButtonIndex (int) - index of cancel button in options
  • destructiveButtonIndex (int) - index of destructive button in options
  • title (string) - a title to show above the action sheet
  • message (string) - a message to show below the title

static showShareActionSheetWithOptions(options, failureCallback, successCallback) #

Display the iOS share sheet. The options object should contain +ActionSheetIOS – React Native | A framework for building native apps using React

ActionSheetIOS #

Edit on GitHub

Methods #

static showActionSheetWithOptions(options, callback) #

Display an iOS action sheet. The options object must contain one or more +of:

  • options (array of strings) - a list of button titles (required)
  • cancelButtonIndex (int) - index of cancel button in options
  • destructiveButtonIndex (int) - index of destructive button in options
  • title (string) - a title to show above the action sheet
  • message (string) - a message to show below the title

static showShareActionSheetWithOptions(options, failureCallback, successCallback) #

Display the iOS share sheet. The options object should contain one or both of message and url and can additionally have a subject or excludedActivityTypes:

  • url (string) - a URL to share
  • message (string) - a message to share
  • subject (string) - a subject for the message
  • excludedActivityTypes (array) - the activites to exclude from the ActionSheet

NOTE: if url points to a local file, or is a base64-encoded uri, the file it points to will be loaded and shared directly. diff --git a/releases/next/docs/alert.html b/releases/next/docs/alert.html index 293c5d8115c..1d0e2d3877c 100644 --- a/releases/next/docs/alert.html +++ b/releases/next/docs/alert.html @@ -13,7 +13,7 @@ of a neutral, negative and a positive button:

  • If you specify one butt {text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, {text: 'OK', onPress: () => console.log('OK Pressed')}, ] -)

Methods #

static alert(title, message?, buttons?, type?) #

Examples #

Edit on GitHub
'use strict'; +)

Methods #

static alert(title, message?, buttons?, type?) #

Examples #

Edit on GitHub
'use strict'; var React = require('react'); var ReactNative = require('react-native'); diff --git a/releases/next/docs/alertios.html b/releases/next/docs/alertios.html index 84c96e68466..cfc8b49566b 100644 --- a/releases/next/docs/alertios.html +++ b/releases/next/docs/alertios.html @@ -7,7 +7,7 @@ message or create a prompt for user input.

Creating an iOS alert:

null, text => console.log("You entered "+text) );

We recommend using the Alert.alert method for -cross-platform support if you don't need to create iOS-only prompts.

Methods #

static alert(title, message?, callbackOrButtons?, type?) #

Create and display a popup alert.

Parameters:
Name and TypeDescription
title

string

The dialog's title.

[message]

string

An optional message that appears below +cross-platform support if you don't need to create iOS-only prompts.

Methods #

static alert(title, message?, callbackOrButtons?, type?) #

Create and display a popup alert.

Parameters:
Name and TypeDescription
title

string

The dialog's title.

[message]

string

An optional message that appears below the dialog's title.

[callbackOrButtons]

?(() => void) | ButtonsArray

This optional argument should be either a single-argument function or an array of buttons. If passed a function, it will be called when the user taps 'OK'.

If passed an array of button configurations, each button should include @@ -19,7 +19,7 @@ cross-platform support if you don't need to create iOS-only prompts.

{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'}, {text: 'Install', onPress: () => console.log('Install Pressed')}, ], -);

static prompt(title, message?, callbackOrButtons?, type?, defaultValue?) #

Create and display a prompt to enter some text.

Parameters:
Name and TypeDescription
title

string

The dialog's title.

[message]

string

An optional message that appears above the text +);

static prompt(title, message?, callbackOrButtons?, type?, defaultValue?) #

Create and display a prompt to enter some text.

Parameters:
Name and TypeDescription
title

string

The dialog's title.

[message]

string

An optional message that appears above the text input.

[callbackOrButtons]

?((text: string) => void) | ButtonsArray

This optional argument should be either a single-argument function or an array of buttons. If passed a function, it will be called with the prompt's value when the user diff --git a/releases/next/docs/animated.html b/releases/next/docs/animated.html index d80b547bd7e..7d369102d20 100644 --- a/releases/next/docs/animated.html +++ b/releases/next/docs/animated.html @@ -58,18 +58,18 @@ event loop. This does influence the API, so keep that in mind when it seems a little trickier to do something compared to a fully synchronous system. Checkout Animated.Value.addListener as a way to work around some of these limitations, but use it sparingly since it might have performance -implications in the future.

Methods #

static decay(value, config) #

Animates a value from an initial velocity to zero based on a decay -coefficient.

static timing(value, config) #

Animates a value along a timed easing curve. The Easing module has tons -of pre-defined curves, or you can use your own function.

static spring(value, config) #

Spring animation based on Rebound and Origami. Tracks velocity state to -create fluid motions as the toValue updates, and can be chained together.

static add(a, b) #

Creates a new Animated value composed from two Animated values added -together.

static multiply(a, b) #

Creates a new Animated value composed from two Animated values multiplied -together.

static modulo(a, modulus) #

Creates a new Animated value that is the (non-negative) modulo of the -provided Animated value

static delay(time) #

Starts an animation after the given delay.

static sequence(animations) #

Starts an array of animations in order, waiting for each to complete +implications in the future.

Methods #

static decay(value, config) #

Animates a value from an initial velocity to zero based on a decay +coefficient.

static timing(value, config) #

Animates a value along a timed easing curve. The Easing module has tons +of pre-defined curves, or you can use your own function.

static spring(value, config) #

Spring animation based on Rebound and Origami. Tracks velocity state to +create fluid motions as the toValue updates, and can be chained together.

static add(a, b) #

Creates a new Animated value composed from two Animated values added +together.

static multiply(a, b) #

Creates a new Animated value composed from two Animated values multiplied +together.

static modulo(a, modulus) #

Creates a new Animated value that is the (non-negative) modulo of the +provided Animated value

static delay(time) #

Starts an animation after the given delay.

static sequence(animations) #

Starts an array of animations in order, waiting for each to complete before starting the next. If the current running animation is stopped, no -following animations will be started.

static parallel(animations, config?) #

Starts an array of animations all at the same time. By default, if one +following animations will be started.

static parallel(animations, config?) #

Starts an array of animations all at the same time. By default, if one of the animations is stopped, they will all be stopped. You can override -this with the stopTogether flag.

static stagger(time, animations) #

Array of animations may run in parallel (overlap), but are started in -sequence with successive delays. Nice for doing trailing effects.

static event(argMapping, config?) #

Takes an array of mappings and extracts values from each arg accordingly, +this with the stopTogether flag.

static stagger(time, animations) #

Array of animations may run in parallel (overlap), but are started in +sequence with successive delays. Nice for doing trailing effects.

static event(argMapping, config?) #

Takes an array of mappings and extracts values from each arg accordingly, then calls setValue on the mapped outputs. e.g.

onScroll={Animated.event( [{nativeEvent: {contentOffset: {x: this._scrollX}}}] {listener}, // Optional async listener @@ -78,21 +78,21 @@ sequence with successive delays. Nice for doing trailing effects.

: Animated.event([ null, // raw event arg ignored {dx: this._panX}, // gestureState arg - ]),

static createAnimatedComponent(Component) #

Make any React component Animatable. Used to create Animated.View, etc.

Properties #

Value: AnimatedValue #

Standard value class for driving animations. Typically initialized with + ]),

static createAnimatedComponent(Component) #

Make any React component Animatable. Used to create Animated.View, etc.

Properties #

Value: AnimatedValue #

Standard value class for driving animations. Typically initialized with new Animated.Value(0);

ValueXY: AnimatedValueXY #

2D value class for driving 2D animations, such as pan gestures.

class AnimatedValue #

    Standard value for driving animations. One Animated.Value can drive multiple properties in a synchronized fashion, but can only be driven by one mechanism at a time. Using a new mechanism (e.g. starting a new animation, -or calling setValue) will stop any previous ones.

    Methods #

    constructor(value) #

    setValue(value) #

    Directly set the value. This will stop any animations running on the value -and update all the bound properties.

    setOffset(offset) #

    Sets an offset that is applied on top of whatever value is set, whether via +or calling setValue) will stop any previous ones.

    Methods #

    constructor(value) #

    setValue(value) #

    Directly set the value. This will stop any animations running on the value +and update all the bound properties.

    setOffset(offset) #

    Sets an offset that is applied on top of whatever value is set, whether via setValue, an animation, or Animated.event. Useful for compensating -things like the start of a pan gesture.

    flattenOffset(0) #

    Merges the offset value into the base value and resets the offset to zero. -The final output of the value is unchanged.

    addListener(callback) #

    Adds an asynchronous listener to the value so you can observe updates from +things like the start of a pan gesture.

    flattenOffset(0) #

    Merges the offset value into the base value and resets the offset to zero. +The final output of the value is unchanged.

    addListener(callback) #

    Adds an asynchronous listener to the value so you can observe updates from animations. This is useful because there is no way to -synchronously read the value because it might be driven natively.

    removeListener(id) #

    removeAllListeners(0) #

    stopAnimation(callback?) #

    Stops any running animation or tracking. callback is invoked with the +synchronously read the value because it might be driven natively.

    removeListener(id) #

    removeAllListeners(0) #

    stopAnimation(callback?) #

    Stops any running animation or tracking. callback is invoked with the final value after stopping the animation, which is useful for updating -state to match the animation position with layout.

    interpolate(config) #

    Interpolates the value before updating the property, e.g. mapping 0-1 to -0-10.

    animate(animation, callback) #

    Typically only used internally, but could be used by a custom Animation -class.

    stopTracking(0) #

    Typically only used internally.

    track(tracking) #

    Typically only used internally.

class AnimatedValueXY #

    2D Value for driving 2D animations, such as pan gestures. Almost identical +state to match the animation position with layout.

interpolate(config) #

Interpolates the value before updating the property, e.g. mapping 0-1 to +0-10.

animate(animation, callback) #

Typically only used internally, but could be used by a custom Animation +class.

stopTracking(0) #

Typically only used internally.

track(tracking) #

Typically only used internally.

class AnimatedValueXY #

    2D Value for driving 2D animations, such as pan gestures. Almost identical API to normal Animated.Value, but multiplexed. Contains two regular Animated.Values under the hood. Example:

    class DraggableView extends React.Component { constructor(props) { @@ -123,7 +123,7 @@ API to normal Animated.Value, but multiplexed. Contains two regula </Animated.View> ); } - }

    Methods #

    constructor(valueIn?) #

    setValue(value) #

    setOffset(offset) #

    flattenOffset(0) #

    stopAnimation(callback?) #

    addListener(callback) #

    removeListener(id) #

    getLayout(0) #

    Converts {x, y} into {left, top} for use in style, e.g.

    style={this.state.anim.getLayout()}

    getTranslateTransform(0) #

    Converts {x, y} into a useable translation transform, e.g.

    style={{ + }

    Methods #

    constructor(valueIn?) #

    setValue(value) #

    setOffset(offset) #

    flattenOffset(0) #

    stopAnimation(callback?) #

    addListener(callback) #

    removeListener(id) #

    getLayout(0) #

    Converts {x, y} into {left, top} for use in style, e.g.

    style={this.state.anim.getLayout()}

    getTranslateTransform(0) #

    Converts {x, y} into a useable translation transform, e.g.

    style={{ transform: this.state.anim.getTranslateTransform() }}

Examples #

Edit on GitHub
'use strict'; diff --git a/releases/next/docs/appregistry.html b/releases/next/docs/appregistry.html index 8750ff3e649..7e2f4d6dc4d 100644 --- a/releases/next/docs/appregistry.html +++ b/releases/next/docs/appregistry.html @@ -6,7 +6,7 @@ for the app and then actually run the app when it's ready by invoking 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) #

static registerComponent(appKey, getComponentFunc) #

static registerRunnable(appKey, func) #

static getAppKeys(0) #

static runApplication(appKey, appParameters) #

static unmountApplicationComponentAtRootTag(rootTag) #

© 2016 Facebook Inc.

CameraRoll #

Edit on GitHub

CameraRoll provides access to the local camera roll / gallery.

Methods #

static saveImageWithTag(tag) #

static saveToCameraRoll(tag, type?) #

Saves the photo or video to the camera roll / gallery.

On Android, the tag must be a local image or video URI, such as "file:///sdcard/img.png".

On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs) +CameraRoll – React Native | A framework for building native apps using React

CameraRoll #

Edit on GitHub

CameraRoll provides access to the local camera roll / gallery.

Methods #

static saveImageWithTag(tag) #

static saveToCameraRoll(tag, type?) #

Saves the photo or video to the camera roll / gallery.

On Android, the tag must be a local image or video URI, such as "file:///sdcard/img.png".

On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs) or a local video file URI (remote or data URIs are not supported for saving video at this time).

If the tag has a file extension of .mov or .mp4, it will be inferred as a video. Otherwise it will be treated as a photo. To override the automatic choice, you can pass an optional -type parameter that must be one of 'photo' or 'video'.

Returns a Promise which will resolve with the new URI.

static getPhotos(params) #

Returns a Promise with photo identifier objects from the local camera +type parameter that must be one of 'photo' or 'video'.

Returns a Promise which will resolve with the new URI.

static getPhotos(params) #

Returns a Promise with photo identifier objects from the local camera roll of the device matching shape defined by getPhotosReturnChecker.

@param {object} params See getPhotosParamChecker.

Returns a Promise which when resolved will be of shape getPhotosReturnChecker.

Examples #

Edit on GitHub
'use strict'; const React = require('react'); diff --git a/releases/next/docs/clipboard.html b/releases/next/docs/clipboard.html index f65d22b493e..c7530d1bdc8 100644 --- a/releases/next/docs/clipboard.html +++ b/releases/next/docs/clipboard.html @@ -1,6 +1,6 @@ -Clipboard – React Native | A framework for building native apps using React

Clipboard #

Edit on GitHub

Clipboard gives you an interface for setting and getting content from Clipboard on both iOS and Android

Methods #

static getString(0) #

Get content of string type, this method returns a Promise, so you can use following code to get clipboard content

async _getContent() { +Clipboard – React Native | A framework for building native apps using React

Clipboard #

Edit on GitHub

Clipboard gives you an interface for setting and getting content from Clipboard on both iOS and Android

Methods #

static getString(0) #

Get content of string type, this method returns a Promise, so you can use following code to get clipboard content

async _getContent() { var content = await Clipboard.getString(); -}

static setString(content) #

Set content of string type. You can use following code to set clipboard content

_setContent() { +}

static setString(content) #

Set content of string type. You can use following code to set clipboard content

_setContent() { Clipboard.setString('hello world'); }

@param the content to be stored in the clipboard.

Examples #

Edit on GitHub
'use strict'; diff --git a/releases/next/docs/datepickerandroid.html b/releases/next/docs/datepickerandroid.html index 53c06ed36c5..b505f31fd6d 100644 --- a/releases/next/docs/datepickerandroid.html +++ b/releases/next/docs/datepickerandroid.html @@ -9,14 +9,14 @@ } } catch ({code, message}) { console.warn('Cannot open date picker', message); -}

Methods #

static open(options) #

Opens the standard Android date picker dialog.

The available keys for the options object are: +}

Methods #

static open(options) #

Opens the standard Android date picker dialog.

The available keys for the options object are: date (Date object or timestamp in milliseconds) - date to show by default minDate (Date or timestamp in milliseconds) - minimum date that can be selected * maxDate (Date object or timestamp in milliseconds) - minimum date that can be selected

Returns a Promise which will be invoked an object containing action, year, month (0-11), day if the user picked a date. If the user dismissed the dialog, the Promise will still be resolved with action being DatePickerAndroid.dismissedAction and all the other keys being undefined. Always check whether the action before reading the values.

Note the native date picker dialog has some UI glitches on Android 4 and lower -when using the minDate and maxDate options.

static dateSetAction(0) #

A date has been selected.

static dismissedAction(0) #

The dialog has been dismissed.

Examples #

Edit on GitHub
'use strict'; +when using the minDate and maxDate options.

static dateSetAction(0) #

A date has been selected.

static dismissedAction(0) #

The dialog has been dismissed.

Examples #

Edit on GitHub
'use strict'; var React = require('react'); var ReactNative = require('react-native'); diff --git a/releases/next/docs/dimensions.html b/releases/next/docs/dimensions.html index a97c21be4be..5844c9f7c9f 100644 --- a/releases/next/docs/dimensions.html +++ b/releases/next/docs/dimensions.html @@ -1,5 +1,5 @@ -Dimensions – React Native | A framework for building native apps using React

Dimensions #

Edit on GitHub

Methods #

static set(dims) #

This should only be called from native code by sending the -didUpdateDimensions event.

@param {object} dims Simple string-keyed object of dimensions to set

static get(dim) #

Initial dimensions are set before runApplication is called so they should +Dimensions – React Native | A framework for building native apps using React

Dimensions #

Edit on GitHub

Methods #

static set(dims) #

This should only be called from native code by sending the +didUpdateDimensions event.

@param {object} dims Simple string-keyed object of dimensions to set

static get(dim) #

Initial dimensions are set before runApplication is called so they should be available before any other require's are run, but may be updated later.

Note: Although dimensions are available immediately, they may change (e.g due to device rotation) so any rendering logic or styles that depend on these constants should try to call this function on every render, rather diff --git a/releases/next/docs/drawerlayoutandroid.html b/releases/next/docs/drawerlayoutandroid.html index a953c24b6b9..26d19f18d1c 100644 --- a/releases/next/docs/drawerlayoutandroid.html +++ b/releases/next/docs/drawerlayoutandroid.html @@ -37,7 +37,7 @@ from the edge of the window.

renderNavigationView function #

The navigation view that will be rendered to the side of the screen and can be pulled in.

statusBarBackgroundColor color #

Make the drawer take the entire screen and draw the background of the status bar to allow it to open over the status bar. It will only have an -effect on API 21+.

Methods #

openDrawer(0) #

Opens the drawer.

closeDrawer(0) #

Closes the drawer.

© 2016 Facebook Inc.

LayoutAnimation #

Edit on GitHub

Automatically animates views to their new positions when the next layout happens.

A common way to use this API is to call LayoutAnimation.configureNext -before calling setState.

Methods #

static configureNext(config, onAnimationDidEnd?) #

Schedules an animation to happen on the next layout.

@param config Specifies animation properties:

  • duration in milliseconds
  • create, config for animating in new views (see Anim type)
  • update, config for animating views that have been updated +before calling setState.

Methods #

static configureNext(config, onAnimationDidEnd?) #

Schedules an animation to happen on the next layout.

@param config Specifies animation properties:

  • duration in milliseconds
  • create, config for animating in new views (see Anim type)
  • update, config for animating views that have been updated (see Anim type)

@param onAnimationDidEnd Called when the animation finished. Only supported on iOS. -@param onError Called on error. Only supported on iOS.

static create(duration, type, creationProp) #

Helper for creating a config for configureNext.

Properties #

Types: CallExpression #

Properties: CallExpression #

configChecker: CallExpression #

Presets: ObjectExpression #

easeInEaseOut: CallExpression #

linear: CallExpression #

spring: CallExpression #

Examples #

Edit on GitHub
'use strict'; +@param onError Called on error. Only supported on iOS.

static create(duration, type, creationProp) #

Helper for creating a config for configureNext.

Properties #

Types: CallExpression #

Properties: CallExpression #

configChecker: CallExpression #

Presets: ObjectExpression #

easeInEaseOut: CallExpression #

linear: CallExpression #

spring: CallExpression #

Examples #

Edit on GitHub
'use strict'; const React = require('react'); const ReactNative = require('react-native'); diff --git a/releases/next/docs/linking.html b/releases/next/docs/linking.html index 7d65a3c63fd..537a583396f 100644 --- a/releases/next/docs/linking.html +++ b/releases/next/docs/linking.html @@ -46,11 +46,11 @@ execution you'll need to add the following lines to you *AppDelegate. } else { return Linking.openURL(url); } -}).catch(err => console.error('An error occurred', err));

Methods #

constructor(0) #

addEventListener(type, handler) #

Add a handler to Linking changes by listening to the url event type -and providing the handler

removeEventListener(type, handler) #

Remove a handler by passing the url event type and the handler

openURL(url) #

Try to open the given url with any of the installed apps.

You can use other URLs, like a location (e.g. "geo:37.484847,-122.148386"), a contact, +}).catch(err => console.error('An error occurred', err));

Methods #

constructor(0) #

addEventListener(type, handler) #

Add a handler to Linking changes by listening to the url event type +and providing the handler

removeEventListener(type, handler) #

Remove a handler by passing the url event type and the handler

openURL(url) #

Try to open the given url with any of the installed apps.

You can use other URLs, like a location (e.g. "geo:37.484847,-122.148386"), a contact, or any other URL that can be opened with the installed apps.

NOTE: This method will fail if the system doesn't know how to open the specified URL. -If you're passing in a non-http(s) URL, it's best to check {@code canOpenURL} first.

NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly!

canOpenURL(url) #

Determine whether or not an installed app can handle a given URL.

NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly!

NOTE: As of iOS 9, your app needs to provide the LSApplicationQueriesSchemes key -inside Info.plist or canOpenURL will always return false.

@param URL the URL to open

getInitialURL(0) #

If the app launch was triggered by an app link, +If you're passing in a non-http(s) URL, it's best to check {@code canOpenURL} first.

NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly!

canOpenURL(url) #

Determine whether or not an installed app can handle a given URL.

NOTE: For web URLs, the protocol ("http://", "https://") must be set accordingly!

NOTE: As of iOS 9, your app needs to provide the LSApplicationQueriesSchemes key +inside Info.plist or canOpenURL will always return false.

@param URL the URL to open

getInitialURL(0) #

If the app launch was triggered by an app link, it will give the link url, otherwise it will give null

NOTE: To support deep linking on Android, refer http://developer.android.com/training/app-indexing/deep-linking.html#handling-intents

Examples #

Edit on GitHub
'use strict'; var React = require('react'); diff --git a/releases/next/docs/listview.html b/releases/next/docs/listview.html index 3c1b184a8db..d518c3b7409 100644 --- a/releases/next/docs/listview.html +++ b/releases/next/docs/listview.html @@ -67,7 +67,7 @@ pixels.

Methods #

getMetrics(0) #

Exports some data, e.g. for perf investigations or analytics.

scrollTo(...args) #

Scrolls to a given x, y offset, either immediately or with a smooth animation.

See ScrollView#scrollTo.

Examples #

Edit on GitHub
'use strict'; +with horizontal={true}.

Methods #

getMetrics(0) #

Exports some data, e.g. for perf investigations or analytics.

scrollTo(...args) #

Scrolls to a given x, y offset, either immediately or with a smooth animation.

See ScrollView#scrollTo.

Examples #

Edit on GitHub
'use strict'; var React = require('react'); var ReactNative = require('react-native'); diff --git a/releases/next/docs/listviewdatasource.html b/releases/next/docs/listviewdatasource.html index 6114c2853c8..abfdcedecc8 100644 --- a/releases/next/docs/listviewdatasource.html +++ b/releases/next/docs/listviewdatasource.html @@ -20,10 +20,10 @@ it.

getInitialStatethis.setState({ ds: this.state.ds.cloneWithRows(this._data) }); -}

Methods #

constructor(params) #

You can provide custom extraction and hasChanged functions for section +}

Methods #

constructor(params) #

You can provide custom extraction and hasChanged functions for section headers and rows. If absent, data will be extracted with the defaultGetRowData and defaultGetSectionHeaderData functions.

The default extractor expects data of one of the following forms:

{ sectionID_1: { rowID_1: <rowData1>, ... }, ... }

or

{ sectionID_1: [ <rowData1>, <rowData2>, ... ], ... }

or

[ [ <rowData1>, <rowData2>, ... ], ... ]

The constructor takes in a params argument that can contain any of the -following:

  • getRowData(dataBlob, sectionID, rowID);
  • getSectionHeaderData(dataBlob, sectionID);
  • rowHasChanged(prevRowData, nextRowData);
  • sectionHeaderHasChanged(prevSectionData, nextSectionData);

cloneWithRows(dataBlob, rowIdentities) #

Clones this ListViewDataSource with the specified dataBlob and +following:

  • getRowData(dataBlob, sectionID, rowID);
  • getSectionHeaderData(dataBlob, sectionID);
  • rowHasChanged(prevRowData, nextRowData);
  • sectionHeaderHasChanged(prevSectionData, nextSectionData);

cloneWithRows(dataBlob, rowIdentities) #

Clones this ListViewDataSource with the specified dataBlob and rowIdentities. The dataBlob is just an arbitrary blob of data. At construction an extractor to get the interesting information was defined (or the default was used).

The rowIdentities is a 2D array of identifiers for rows. @@ -32,13 +32,13 @@ assumed that the keys of the section data are the row identities.

Note: Th passes the functions defined at construction to a new data source with the data specified. If you wish to maintain the existing data you must handle merging of old and new data separately and then pass that into -this function as the dataBlob.

cloneWithRowsAndSections(dataBlob, sectionIdentities, rowIdentities) #

This performs the same function as the cloneWithRows function but here +this function as the dataBlob.

cloneWithRowsAndSections(dataBlob, sectionIdentities, rowIdentities) #

This performs the same function as the cloneWithRows function but here you also specify what your sectionIdentities are. If you don't care about sections you should safely be able to use cloneWithRows.

sectionIdentities is an array of identifiers for sections. ie. ['s1', 's2', ...]. If not provided, it's assumed that the -keys of dataBlob are the section identities.

Note: this returns a new object!

getRowCount(0) #

getRowAndSectionCount(0) #

rowShouldUpdate(sectionIndex, rowIndex) #

Returns if the row is dirtied and needs to be rerendered

getRowData(sectionIndex, rowIndex) #

Gets the data required to render the row.

getRowIDForFlatIndex(index) #

Gets the rowID at index provided if the dataSource arrays were flattened, -or null of out of range indexes.

getSectionIDForFlatIndex(index) #

Gets the sectionID at index provided if the dataSource arrays were flattened, -or null for out of range indexes.

getSectionLengths(0) #

Returns an array containing the number of rows in each section

sectionHeaderShouldUpdate(sectionIndex) #

Returns if the section header is dirtied and needs to be rerendered

getSectionHeaderData(sectionIndex) #

Gets the data required to render the section header

© 2016 Facebook Inc.

ToastAndroid #

Edit on GitHub

This exposes the native ToastAndroid module as a JS module. This has a function 'show' -which takes the following parameters:

  1. String message: A string with the text to toast
  2. int duration: The duration of the toast. May be ToastAndroid.SHORT or ToastAndroid.LONG

Methods #

static show(message, duration) #

Properties #

SHORT: MemberExpression #

LONG: MemberExpression #

Examples #

Edit on GitHub
'use strict'; +which takes the following parameters:

  1. String message: A string with the text to toast
  2. int duration: The duration of the toast. May be ToastAndroid.SHORT or ToastAndroid.LONG

Methods #

static show(message, duration) #

Properties #

SHORT: MemberExpression #

LONG: MemberExpression #

Examples #

Edit on GitHub
'use strict'; var React = require('react'); var ReactNative = require('react-native'); diff --git a/releases/next/docs/touchablenativefeedback.html b/releases/next/docs/touchablenativefeedback.html index fcd41948183..088df5c7176 100644 --- a/releases/next/docs/touchablenativefeedback.html +++ b/releases/next/docs/touchablenativefeedback.html @@ -16,10 +16,10 @@ of RCTView node with some additional properties set.

Background drawable o },

Props #

background backgroundPropType #

Determines the type of background drawable that's going to be used to display feedback. It takes an object with type property and extra data depending on the type. It's recommended to use one of the static -methods to generate that dictionary.

Methods #

static SelectableBackground(0) #

Creates an object that represents android theme's default background for -selectable elements (?android:attr/selectableItemBackground).

static SelectableBackgroundBorderless(0) #

Creates an object that represent android theme's default background for borderless +methods to generate that dictionary.

Methods #

static SelectableBackground(0) #

Creates an object that represents android theme's default background for +selectable elements (?android:attr/selectableItemBackground).

static SelectableBackgroundBorderless(0) #

Creates an object that represent android theme's default background for borderless selectable elements (?android:attr/selectableItemBackgroundBorderless). -Available on android API level 21+.

static Ripple(color, borderless) #

Creates an object that represents ripple drawable with specified color (as a +Available on android API level 21+.

static Ripple(color, borderless) #

Creates an object that represents ripple drawable with specified color (as a string). If property borderless evaluates to true the ripple will render outside of the view bounds (see native actionbar buttons as an example of that behavior). This background type is available on Android diff --git a/releases/next/docs/touchableopacity.html b/releases/next/docs/touchableopacity.html index ab5fd6d8757..15e6b1db1fa 100644 --- a/releases/next/docs/touchableopacity.html +++ b/releases/next/docs/touchableopacity.html @@ -11,7 +11,7 @@ easy to add to an app without weird side-effects.

Example:

/TouchableOpacity> ); },

Props #

activeOpacity number #

Determines what the opacity of the wrapped view should be when touch is -active. Defaults to 0.2.

Methods #

setOpacityTo(value) #

Animate the touchable to a new opacity.

© 2016 Facebook Inc.

Vibration #

Edit on GitHub

The Vibration API is exposed at Vibration.vibrate(). The vibration is asynchronous so this method will return immediately.

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

Note for android -add <uses-permission android:name="android.permission.VIBRATE"/> to AndroidManifest.xml

Vibration patterns are currently unsupported.

Methods #

static vibrate(pattern, repeat) #

static cancel(0) #

Stop vibration

@platform android

Examples #

Edit on GitHub
'use strict'; +add <uses-permission android:name="android.permission.VIBRATE"/> to AndroidManifest.xml

Vibration patterns are currently unsupported.

Methods #

static vibrate(pattern, repeat) #

static cancel(0) #

Stop vibration

@platform android

Examples #

Edit on GitHub
'use strict'; var React = require('react'); var ReactNative = require('react-native'); diff --git a/releases/next/docs/vibrationios.html b/releases/next/docs/vibrationios.html index 15635133835..7d74afab265 100644 --- a/releases/next/docs/vibrationios.html +++ b/releases/next/docs/vibrationios.html @@ -1,7 +1,7 @@ VibrationIOS – React Native | A framework for building native apps using React

VibrationIOS #

Edit on GitHub

NOTE: VibrationIOS is being deprecated. Use Vibration instead.

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(0) #

@deprecated

Examples #

Edit on GitHub
'use strict'; +simulator.

Vibration patterns are currently unsupported.

Methods #

static vibrate(0) #

@deprecated

Examples #

Edit on GitHub
'use strict'; var React = require('react'); var ReactNative = require('react-native'); diff --git a/releases/next/docs/viewpagerandroid.html b/releases/next/docs/viewpagerandroid.html index 0d1642eaa98..ede06ad1366 100644 --- a/releases/next/docs/viewpagerandroid.html +++ b/releases/next/docs/viewpagerandroid.html @@ -44,8 +44,8 @@ The page scrolling state can be in 3 states: callback will have following fields: - position - index of page that has been selected

pageMargin number #

Blank space to show between pages. This is only visible while scrolling, pages are still edge-to-edge.

scrollEnabled bool #

When false, the content does not scroll. -The default value is true.

Methods #

setPage(selectedPage) #

A helper function to scroll to a specific page in the ViewPager. -The transition between pages will be animated.

setPageWithoutAnimation(selectedPage) #

A helper function to scroll to a specific page in the ViewPager. +The default value is true.

Methods #

setPage(selectedPage) #

A helper function to scroll to a specific page in the ViewPager. +The transition between pages will be animated.

setPageWithoutAnimation(selectedPage) #

A helper function to scroll to a specific page in the ViewPager. The transition between pages will not be animated.

Type Definitions #

ViewPagerScrollState #

Type:
$Enum

Constants:
ValueDescription
idle
dragging
settling

Examples #

Edit on GitHub
'use strict'; var React = require('react'); diff --git a/releases/next/docs/webview.html b/releases/next/docs/webview.html index b3574433ab5..590e9055fce 100644 --- a/releases/next/docs/webview.html +++ b/releases/next/docs/webview.html @@ -32,7 +32,7 @@ settings for UIScrollViewDecelerationRateNormal and UIScrollViewDecelerationRateFast respectively:

  • normal: 0.998
  • fast: 0.99 (the default for iOS web view)

iosonShouldStartLoadWithRequest function #

Function that allows custom handling of any web view requests. Return true from the function to continue loading the request and false to stop loading.

iosscrollEnabled bool #

Boolean value that determines whether scrolling is enabled in the -WebView. The default value is true.

Methods #

goForward(0) #

Go forward one page in the web view's history.

goBack(0) #

Go back one page in the web view's history.

reload(0) #

Reloads the current page.

stopLoading(0) #

Stop loading the current page.

getWebViewHandle(0): #

Returns the native WebView node.

Examples #

Edit on GitHub
'use strict'; +WebView. The default value is true.

Methods #

goForward(0) #

Go forward one page in the web view's history.

goBack(0) #

Go back one page in the web view's history.

reload(0) #

Reloads the current page.

stopLoading(0) #

Stop loading the current page.

getWebViewHandle(0): #

Returns the native WebView node.

Examples #

Edit on GitHub
'use strict'; var React = require('react'); var ReactNative = require('react-native');