diff --git a/docs/next/touchableopacity.html b/docs/next/touchableopacity.html index 60d82d9e649..c67847c1e6d 100644 --- a/docs/next/touchableopacity.html +++ b/docs/next/touchableopacity.html @@ -69,20 +69,8 @@ } });
Edit

TouchableOpacity

A wrapper for making views respond properly to touches. On press down, the opacity of the wrapped view is decreased, dimming it.

-

Opacity is controlled by wrapping the children in an Animated.View, which is added to the view hierarchy. Be aware that this can affect layout.

-

Example:

-
renderButton: function() {
-  return (
-    <TouchableOpacity onPress={this._onPressButton}>
-      <Image
-        style={styles.button}
-        source={require('./myButton.png')}
-      />
-    </TouchableOpacity>
-  );
-},
-
-

Example

+

Opacity is controlled by wrapping the children in an Animated.View, which is added to the view hierarchy. Be aware that this can affect layout.

+

Example

-
Edit

TouchableOpacity

A wrapper for making views respond properly to touches. On press down, the opacity of the wrapped view is decreased, dimming it.

-

Opacity is controlled by wrapping the children in an Animated.View, which is added to the view hierarchy. Be aware that this can affect layout.

-

Example:

-
renderButton: function() {
-  return (
-    <TouchableOpacity onPress={this._onPressButton}>
-      <Image
-        style={styles.button}
-        source={require('./myButton.png')}
-      />
-    </TouchableOpacity>
-  );
-},
-
-

Example

+

Opacity is controlled by wrapping the children in an Animated.View, which is added to the view hierarchy. Be aware that this can affect layout.

+

Example

-
Edit

Vibration

The Vibration API is exposed at Vibration.vibrate(). The vibration is synchronous 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

-

The vibration duration in iOS is not configurable, so there are some differences with Android. In Android, if pattern is a number, it specifies the vibration duration in ms. If pattern is an array, those odd indices are the vibration duration, while the even ones are the separation time.

-

In iOS, invoking vibrate(duration) will ignore the duration and vibrate for a fixed time. While the pattern array is used to define the duration between each vibration. See below example for more.

-

Repeatable vibration is also supported, the vibration will repeat with defined pattern until cancel() is called.

-

Example:

-
const DURATION = 10000;
-const PATTERN = [1000, 2000, 3000];
+        
Edit

Vibration

Vibrates the device.

+

Example

+
+

Android apps should request the android.permission.VIBRATE permission by adding <uses-permission android:name="android.permission.VIBRATE"/> to AndroidManifest.xml.

+
+
+

The Vibration API is implemented as a AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) call on iOS.

+

Reference

Methods

vibrate()

-
Vibration.vibrate(pattern: number, Array<number>, repeat: boolean)
+
Vibration.vibrate(?pattern: number | Array<number>, ?repeat: boolean)
 
-

Trigger a vibration with specified pattern.

+

Triggers a vibration with a fixed duration.

+

On Android, the vibration duration defaults to 400 milliseconds, and an arbitrary vibration duration can be specified by passing a number as the value for the pattern argument. On iOS, the vibration duration is fixed at roughly 400 milliseconds.

+

The vibrate() method can take a pattern argument with an array of numbers that represent time in milliseconds. You may set repeat to true to run through the vibration pattern in a loop until cancel() is called.

+

On Android, the odd indices of the pattern array represent the vibration duration, while the even ones represent the separation time. On iOS, the numbers in the pattern array represent the separation time, as the vibration duration is fixed.

Parameters:

- + - - + + +
NameTypeRequiredDescription
NameTypeRequiredDescriptionPlatform
patternnumber or ArrayYesVibration pattern, accept a number or an array of numbers. Default to 400ms.
repeatbooleanNoRepeat vibration pattern until cancel(), default to false.
patternnumberNoVibration duration in milliseconds. Defaults to 400 ms.Android
patternArray of numbersNoVibration pattern as an array of numbers in milliseconds.Android, iOS
repeatbooleanNoRepeat vibration pattern until cancel(), default to false.Android, iOS

cancel()

Vibration.cancel();
 
-

Stop vibration.

-
Vibration.cancel()
-
-
Edit

Vibration

The Vibration API is exposed at Vibration.vibrate(). The vibration is synchronous 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

-

The vibration duration in iOS is not configurable, so there are some differences with Android. In Android, if pattern is a number, it specifies the vibration duration in ms. If pattern is an array, those odd indices are the vibration duration, while the even ones are the separation time.

-

In iOS, invoking vibrate(duration) will ignore the duration and vibrate for a fixed time. While the pattern array is used to define the duration between each vibration. See below example for more.

-

Repeatable vibration is also supported, the vibration will repeat with defined pattern until cancel() is called.

-

Example:

-
const DURATION = 10000;
-const PATTERN = [1000, 2000, 3000];
+        
Edit

Vibration

Vibrates the device.

+

Example

+
+

Android apps should request the android.permission.VIBRATE permission by adding <uses-permission android:name="android.permission.VIBRATE"/> to AndroidManifest.xml.

+
+
+

The Vibration API is implemented as a AudioServicesPlaySystemSound(kSystemSoundID_Vibrate) call on iOS.

+

Reference

Methods

vibrate()

-
Vibration.vibrate(pattern: number, Array<number>, repeat: boolean)
+
Vibration.vibrate(?pattern: number | Array<number>, ?repeat: boolean)
 
-

Trigger a vibration with specified pattern.

+

Triggers a vibration with a fixed duration.

+

On Android, the vibration duration defaults to 400 milliseconds, and an arbitrary vibration duration can be specified by passing a number as the value for the pattern argument. On iOS, the vibration duration is fixed at roughly 400 milliseconds.

+

The vibrate() method can take a pattern argument with an array of numbers that represent time in milliseconds. You may set repeat to true to run through the vibration pattern in a loop until cancel() is called.

+

On Android, the odd indices of the pattern array represent the vibration duration, while the even ones represent the separation time. On iOS, the numbers in the pattern array represent the separation time, as the vibration duration is fixed.

Parameters:

- + - - + + +
NameTypeRequiredDescription
NameTypeRequiredDescriptionPlatform
patternnumber or ArrayYesVibration pattern, accept a number or an array of numbers. Default to 400ms.
repeatbooleanNoRepeat vibration pattern until cancel(), default to false.
patternnumberNoVibration duration in milliseconds. Defaults to 400 ms.Android
patternArray of numbersNoVibration pattern as an array of numbers in milliseconds.Android, iOS
repeatbooleanNoRepeat vibration pattern until cancel(), default to false.Android, iOS

cancel()

Vibration.cancel();
 
-

Stop vibration.

-
Vibration.cancel()
-
-