How to use the react-native-camera.RNCamera.Constants function in react-native-camera

To help you get started, we’ve selected a few react-native-camera examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Rocketseat / blog-adonis-reactjs-react-native-airbnb-app / src / pages / main / index.js View on Github external
renderCameraModal = () => (
    
      
        
           {
              this.camera = camera;
            }}
            style={{ flex: 1 }}
            type={RNCamera.Constants.Type.back}
            autoFocus={RNCamera.Constants.AutoFocus.on}
            flashMode={RNCamera.Constants.FlashMode.off}
            permissionDialogTitle={"Permission to use camera"}
            permissionDialogMessage={
              "We need your permission to use your camera phone"
            }
          />
          
            
          
        
        { this.renderImagesList() }
        
          
            Cancelar
github thinger-io / Mobile-App / src / components / screens / QRScanner.js View on Github external
renderCamera() {
    const { scanning } = this.state;
    return (
       {
          if (!scanning) this.handleOnBarCodeRead(data);
        }}
      />
    );
  }
github gaoxiaosong / react-native-full-image-picker / src / CameraView.js View on Github external
_clickTakePicture = async () => {
        if (this.camera) {
            const item = await this.camera.takePictureAsync({
                mirrorImage: this.state.sideType === RNCamera.Constants.Type.front,
                fixOrientation: true,
                forceUpOrientation: true,
                ...this.props.pictureOptions
            });
            if (Platform.OS === 'ios') {
                if (item.uri.startsWith('file://')) {
                    item.uri = item.uri.substring(7);
                }
            }
            if (this.props.maxSize > 1) {
                if (this.state.data.length >= this.props.maxSize) {
                    Alert.alert('', this.props.maxSizeTakeAlert(this.props.maxSize));
                } else {
                    this.setState({
                        data: [...this.state.data, item],
                    });
github Doha26 / Instagram-clone / src / screens / Root / index.tsx View on Github external
switchFlash = () => {
        let newFlashMode;
        const {auto, on, off} = RNCamera.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,
            },
        });
    };
github Rocketseat / blog-adonis-reactjs-react-native-airbnb-app / src / pages / main / index.js View on Github external
renderCameraModal = () => (
    
      
        
           {
              this.camera = camera;
            }}
            style={{ flex: 1 }}
            type={RNCamera.Constants.Type.back}
            autoFocus={RNCamera.Constants.AutoFocus.on}
            flashMode={RNCamera.Constants.FlashMode.off}
            permissionDialogTitle={"Permission to use camera"}
            permissionDialogMessage={
              "We need your permission to use your camera phone"
            }
          />
          
            
          
        
        { this.renderImagesList() }
        
          
            Cancelar
github Doha26 / Instagram-clone / src / screens / Search / index.tsx View on Github external
super(props);
        this.state = {
            refreshing: false,
            setRefreshing: false,
            isModalOpen: false,
            orderedStories: null,
            selectedStory: null,
            tmpImages: null,
            images: [],
            search: '',

            camera: {
                //captureTarget: RNCamera.Constants.CaptureTarget.cameraRoll,
                type: RNCamera.Constants.Type.back,
                orientation: RNCamera.Constants.Orientation.auto,
                flashMode: RNCamera.Constants.FlashMode.auto,
            },
        };
    }
github MarnoDev / react-native-qrcode-scanner-view / lib / QRScanner.js View on Github external
render(){
    const { renderHeaderView, renderFooterView, torchOn, userFront } = this.props;
    
    return (
       this.rnCamera = ref }
        captureAudio={ false }
        onBarCodeRead={ this.onScanResult }
        type={ userFront ? RNCamera.Constants.Type.front : RNCamera.Constants.Type.back }
        flashMode={ torchOn ? RNCamera.Constants.FlashMode.torch : RNCamera.Constants.FlashMode.off }
        style={ { flex: 1 } }
      >
        
        {/*绘制扫描遮罩*/ }
github aryaminus / nazar / src / screens / Realtime / index.js View on Github external
switchCamera() {
    if (this.state.type === RNCamera.Constants.Type.back) {
      this.setState({
        type: RNCamera.Constants.Type.front
      });
    } else {
      this.setState({
        type: RNCamera.Constants.Type.back
      });
    }
  }
github gaoxiaosong / react-native-full-image-picker / src / CameraView.js View on Github external
constructor(props) {
        super(props);
        this.flashModes = [
            RNCamera.Constants.FlashMode.auto,
            RNCamera.Constants.FlashMode.off,
            RNCamera.Constants.FlashMode.on,
        ];
        this.state = {
            data: [],
            isPreview: false,
            sideType: this.props.sideType,
            flashMode: this.props.flashMode,
            isRecording: false,
        };
    }