Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Commit

Permalink
Move BarCodeScanner to unimodule (#2922)
Browse files Browse the repository at this point in the history
fbshipit-source-id: f26dc89
  • Loading branch information
bbarthec authored and expbot committed Aug 22, 2018
1 parent 0702826 commit dcbbdc2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions App.js
@@ -1,4 +1,4 @@
import { Constants, Camera, FileSystem, Permissions } from 'expo';
import { Constants, Camera, FileSystem, Permissions, BarCodeScanner } from 'expo';
import React from 'react';
import {
Alert,
Expand Down Expand Up @@ -131,7 +131,7 @@ export default class CameraScreen extends React.Component {
this.setState({ newPhotos: true });
}

onBarCodeRead = code => {
onBarCodeScanned = code => {
this.setState(
{ barcodeScanning: !this.state.barcodeScanning },
Alert.alert(`Barcode found: ${code.data}`)
Expand Down Expand Up @@ -331,7 +331,13 @@ export default class CameraScreen extends React.Component {
onMountError={this.handleMountError}
onFacesDetected={this.state.faceDetecting ? this.onFacesDetected : undefined}
onFaceDetectionError={this.onFaceDetectionError}
onBarCodeRead={this.state.barcodeScanning ? this.onBarCodeRead : undefined}
barCodeScannerSettings={{
barCodeTypes: [
BarCodeScanner.Constants.BarCodeType.qr,
BarCodeScanner.Constants.BarCodeType.pdf417,
],
}}
onBarCodeScanned={this.state.barcodeScanning ? this.onBarCodeScanned : undefined}
>
{this.renderTopBar()}
{this.renderBottomBar()}
Expand Down

0 comments on commit dcbbdc2

Please sign in to comment.