2015-03-17 20:42:44 +00:00
|
|
|
/**
|
2017-05-06 03:50:47 +00:00
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
2016-07-12 12:51:57 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2015-03-23 22:07:33 +00:00
|
|
|
* @flow
|
2017-02-25 11:05:32 +00:00
|
|
|
* @providesModule VibrationIOSExample
|
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');
|
2015-03-17 20:42:44 +00:00
|
|
|
var {
|
|
|
|
StyleSheet,
|
|
|
|
View,
|
|
|
|
Text,
|
|
|
|
TouchableHighlight,
|
|
|
|
VibrationIOS
|
2016-04-09 03:36:40 +00:00
|
|
|
} = ReactNative;
|
2015-03-17 20:42:44 +00:00
|
|
|
|
|
|
|
exports.framework = 'React';
|
|
|
|
exports.title = 'VibrationIOS';
|
|
|
|
exports.description = 'Vibration API for iOS';
|
|
|
|
exports.examples = [{
|
|
|
|
title: 'VibrationIOS.vibrate()',
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
<TouchableHighlight
|
|
|
|
style={styles.wrapper}
|
|
|
|
onPress={() => VibrationIOS.vibrate()}>
|
|
|
|
<View style={styles.button}>
|
|
|
|
<Text>Vibrate</Text>
|
|
|
|
</View>
|
|
|
|
</TouchableHighlight>
|
|
|
|
);
|
|
|
|
},
|
|
|
|
}];
|
|
|
|
|
|
|
|
var styles = StyleSheet.create({
|
|
|
|
wrapper: {
|
|
|
|
borderRadius: 5,
|
|
|
|
marginBottom: 5,
|
|
|
|
},
|
|
|
|
button: {
|
|
|
|
backgroundColor: '#eeeeee',
|
|
|
|
padding: 10,
|
|
|
|
},
|
|
|
|
});
|