diff --git a/Example/.babelrc b/Example/.babelrc deleted file mode 100644 index a9ce136..0000000 --- a/Example/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["react-native"] -} diff --git a/Example/.buckconfig b/Example/.buckconfig deleted file mode 100644 index 934256c..0000000 --- a/Example/.buckconfig +++ /dev/null @@ -1,6 +0,0 @@ - -[android] - target = Google Inc.:Google APIs:23 - -[maven_repositories] - central = https://repo1.maven.org/maven2 diff --git a/Example/.flowconfig b/Example/.flowconfig deleted file mode 100644 index 2f13324..0000000 --- a/Example/.flowconfig +++ /dev/null @@ -1,48 +0,0 @@ -[ignore] -; We fork some components by platform -.*/*[.]android.js - -; Ignore "BUCK" generated dirs -/\.buckd/ - -; Ignore unexpected extra "@providesModule" -.*/node_modules/.*/node_modules/fbjs/.* - -; Ignore duplicate module providers -; For RN Apps installed via npm, "Libraries" folder is inside -; "node_modules/react-native" but in the source repo it is in the root -.*/Libraries/react-native/React.js - -; Ignore polyfills -.*/Libraries/polyfills/.* - -[include] - -[libs] -node_modules/react-native/Libraries/react-native/react-native-interface.js -node_modules/react-native/flow/ - -[options] -emoji=true - -module.system=haste - -munge_underscores=true - -module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub' - -suppress_type=$FlowIssue -suppress_type=$FlowFixMe -suppress_type=$FlowFixMeProps -suppress_type=$FlowFixMeState -suppress_type=$FixMe - -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-7]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ -suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy -suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError - -unsafe.enable_getters_and_setters=true - -[version] -^0.57.0 diff --git a/Example/.gitattributes b/Example/.gitattributes deleted file mode 100644 index d42ff18..0000000 --- a/Example/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -*.pbxproj -text diff --git a/Example/.gitignore b/Example/.gitignore deleted file mode 100644 index 0826423..0000000 --- a/Example/.gitignore +++ /dev/null @@ -1,53 +0,0 @@ -# OSX -# -.DS_Store - -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate -project.xcworkspace - -# Android/IntelliJ -# -build/ -.idea -.gradle -local.properties -*.iml - -# node.js -# -node_modules/ -npm-debug.log -yarn-error.log - -# BUCK -buck-out/ -\.buckd/ -*.keystore - -# fastlane -# -# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the -# screenshots whenever they are needed. -# For more information about the recommended setup visit: -# https://docs.fastlane.tools/best-practices/source-control/ - -*/fastlane/report.xml -*/fastlane/Preview.html -*/fastlane/screenshots diff --git a/Example/.watchmanconfig b/Example/.watchmanconfig deleted file mode 100644 index 9e26dfe..0000000 --- a/Example/.watchmanconfig +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/Example/Example.js b/Example/Example.js deleted file mode 100644 index 9ff7a7f..0000000 --- a/Example/Example.js +++ /dev/null @@ -1,215 +0,0 @@ -import React from 'react'; -import { Image, StatusBar, StyleSheet, TouchableOpacity, View } from 'react-native'; -import Camera from 'react-native-camera'; - -const styles = StyleSheet.create({ - container: { - flex: 1, - }, - preview: { - flex: 1, - justifyContent: 'flex-end', - alignItems: 'center' - }, - overlay: { - position: 'absolute', - padding: 16, - right: 0, - left: 0, - alignItems: 'center', - }, - topOverlay: { - top: 0, - flex: 1, - flexDirection: 'row', - justifyContent: 'space-between', - alignItems: 'center', - }, - bottomOverlay: { - bottom: 0, - backgroundColor: 'rgba(0,0,0,0.4)', - flexDirection: 'row', - justifyContent: 'center', - alignItems: 'center', - }, - captureButton: { - padding: 15, - backgroundColor: 'white', - borderRadius: 40, - }, - typeButton: { - padding: 5, - }, - flashButton: { - padding: 5, - }, - buttonsSpace: { - width: 10, - }, -}); - -export default class Example extends React.Component { - constructor(props) { - super(props); - - this.camera = null; - - this.state = { - camera: { - aspect: Camera.constants.Aspect.fill, - captureTarget: Camera.constants.CaptureTarget.cameraRoll, - type: Camera.constants.Type.back, - orientation: Camera.constants.Orientation.auto, - flashMode: Camera.constants.FlashMode.auto, - }, - isRecording: false, - }; - } - - takePicture = () => { - if (this.camera) { - 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.setState({ - isRecording: true, - }); - } - }; - - stopRecording = () => { - if (this.camera) { - this.camera.stopCapture(); - this.setState({ - isRecording: false, - }); - } - }; - - switchType = () => { - let newType; - const { back, front } = Camera.constants.Type; - - if (this.state.camera.type === back) { - newType = front; - } else if (this.state.camera.type === front) { - newType = back; - } - - this.setState({ - camera: { - ...this.state.camera, - type: newType, - }, - }); - }; - - get typeIcon() { - let icon; - const { back, front } = Camera.constants.Type; - - if (this.state.camera.type === back) { - icon = require('./assets/ic_camera_rear_white.png'); - } else if (this.state.camera.type === front) { - icon = require('./assets/ic_camera_front_white.png'); - } - - return icon; - } - - switchFlash = () => { - let newFlashMode; - const { auto, on, off } = Camera.constants.FlashMode; - - if (this.state.camera.flashMode === auto) { - newFlashMode = on; - } else if (this.state.camera.flashMode === on) { - newFlashMode = off; - } else if (this.state.camera.flashMode === off) { - newFlashMode = auto; - } - - this.setState({ - camera: { - ...this.state.camera, - flashMode: newFlashMode, - }, - }); - }; - - get flashIcon() { - let icon; - const { auto, on, off } = Camera.constants.FlashMode; - - if (this.state.camera.flashMode === auto) { - icon = require('./assets/ic_flash_auto_white.png'); - } else if (this.state.camera.flashMode === on) { - icon = require('./assets/ic_flash_on_white.png'); - } else if (this.state.camera.flashMode === off) { - icon = require('./assets/ic_flash_off_white.png'); - } - - return icon; - } - - render() { - return ( - -