2015-03-17 20:42:44 +00:00
|
|
|
/**
|
2018-09-11 22:27:47 +00:00
|
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
2016-07-12 12:51:57 +00:00
|
|
|
*
|
2018-02-17 02:24:55 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-07-12 12:51:57 +00:00
|
|
|
*
|
2018-05-11 20:32:37 +00:00
|
|
|
* @format
|
2018-08-09 15:32:04 +00:00
|
|
|
* @flow strict-local
|
2015-03-17 20:42:44 +00:00
|
|
|
*/
|
2018-05-11 20:32:37 +00:00
|
|
|
|
2015-03-17 20:42:44 +00:00
|
|
|
'use strict';
|
|
|
|
|
2016-04-09 03:36:40 +00:00
|
|
|
var React = require('react');
|
|
|
|
var ReactNative = require('react-native');
|
2018-05-11 20:32:37 +00:00
|
|
|
var {StyleSheet, View, Text, TouchableHighlight, VibrationIOS} = ReactNative;
|
2015-03-17 20:42:44 +00:00
|
|
|
|
|
|
|
exports.framework = 'React';
|
|
|
|
exports.title = 'VibrationIOS';
|
|
|
|
exports.description = 'Vibration API for iOS';
|
2018-05-11 20:32:37 +00:00
|
|
|
exports.examples = [
|
|
|
|
{
|
|
|
|
title: 'VibrationIOS.vibrate()',
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<TouchableHighlight
|
|
|
|
style={styles.wrapper}
|
|
|
|
onPress={() => VibrationIOS.vibrate()}>
|
|
|
|
<View style={styles.button}>
|
|
|
|
<Text>Vibrate</Text>
|
|
|
|
</View>
|
|
|
|
</TouchableHighlight>
|
|
|
|
);
|
|
|
|
},
|
2015-03-17 20:42:44 +00:00
|
|
|
},
|
2018-05-11 20:32:37 +00:00
|
|
|
];
|
2015-03-17 20:42:44 +00:00
|
|
|
|
|
|
|
var styles = StyleSheet.create({
|
|
|
|
wrapper: {
|
|
|
|
borderRadius: 5,
|
|
|
|
marginBottom: 5,
|
|
|
|
},
|
|
|
|
button: {
|
|
|
|
backgroundColor: '#eeeeee',
|
|
|
|
padding: 10,
|
|
|
|
},
|
|
|
|
});
|