diff --git a/Example/Example.js b/Example/Example.js index 8470596..89f2117 100644 --- a/Example/Example.js +++ b/Example/Example.js @@ -1,11 +1,5 @@ import React from 'react'; -import { - Image, - StatusBar, - StyleSheet, - TouchableOpacity, - View, -} from 'react-native'; +import { Image, StatusBar, StyleSheet, TouchableOpacity, View } from 'react-native'; import Camera from 'react-native-camera'; const styles = StyleSheet.create({ @@ -68,37 +62,39 @@ export default class Example extends React.Component { orientation: Camera.constants.Orientation.auto, flashMode: Camera.constants.FlashMode.auto, }, - isRecording: false + isRecording: false, }; } takePicture = () => { if (this.camera) { - this.camera.capture() - .then((data) => console.log(data)) + this.camera + .capture() + .then(data => console.log(data)) .catch(err => console.error(err)); } - } + }; startRecording = () => { if (this.camera) { - this.camera.capture({mode: Camera.constants.CaptureMode.video}) - .then((data) => console.log(data)) - .catch(err => console.error(err)); + this.camera + .capture({ mode: Camera.constants.CaptureMode.video }) + .then(data => console.log(data)) + .catch(err => console.error(err)); this.setState({ - isRecording: true + isRecording: true, }); } - } + }; stopRecording = () => { if (this.camera) { this.camera.stopCapture(); this.setState({ - isRecording: false + isRecording: false, }); } - } + }; switchType = () => { let newType; @@ -116,7 +112,7 @@ export default class Example extends React.Component { type: newType, }, }); - } + }; get typeIcon() { let icon; @@ -149,7 +145,7 @@ export default class Example extends React.Component { flashMode: newFlashMode, }, }); - } + }; get flashIcon() { let icon; @@ -169,12 +165,9 @@ export default class Example extends React.Component { render() { return ( -