How to use the expo-barcode-scanner.BarCodeScanner.Constants function in expo-barcode-scanner

To help you get started, we’ve selected a few expo-barcode-scanner 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 expo / expo / apps / native-component-list / src / screens / Camera / CameraScreen.tsx View on Github external
onCameraReady={this.collectPictureSizes}
        type={this.state.type}
        flashMode={this.state.flash}
        autoFocus={this.state.autoFocus}
        zoom={this.state.zoom}
        whiteBalance={this.state.whiteBalance}
        ratio={this.state.ratio}
        pictureSize={this.state.pictureSize}
        onMountError={this.handleMountError}
        onFacesDetected={this.state.faceDetecting ? this.onFacesDetected : undefined}
        faceDetectorSettings={{
          tracking: true,
        }}
        barCodeScannerSettings={{
          barCodeTypes: [
            BarCodeScanner.Constants.BarCodeType.qr,
            BarCodeScanner.Constants.BarCodeType.pdf417,
          ],
        }}
        onBarCodeScanned={this.state.barcodeScanning ? this.onBarCodeScanned : undefined}>
        {this.renderTopBar()}
        {this.renderBottomBar()}
      
      {this.state.faceDetecting && this.renderFaces()}
      {this.state.faceDetecting && this.renderLandmarks()}
      {this.state.showMoreOptions && this.renderMoreOptions()}
    
  );
github janaagaard75 / expo-and-typescript / src / BarCodeScannerScreen.tsx View on Github external
case PermissionState.Denied:
        return ;

      case PermissionState.Granted:
        return (
          
        );

      default:
        const _: never = this.state.cameraPermission;
        return _;
    }
  }
github expo / expo / home / screens / CameraScreen.js View on Github external
ref={ref => (this.camera = ref)}
        style={styles.camera}
        onCameraReady={this.collectPictureSizes}
        type={this.state.type}
        flashMode={this.state.flash}
        autoFocus={this.state.autoFocus}
        zoom={this.state.zoom}
        whiteBalance={this.state.whiteBalance}
        ratio={this.state.ratio}
        pictureSize={this.state.pictureSize}
        onMountError={this.handleMountError}
        onFacesDetected={this.state.faceDetecting ? this.onFacesDetected : undefined}
        barCodeScannerSettings={{
          barCodeTypes: [
            BarCodeScanner.Constants.BarCodeType.qr,
            BarCodeScanner.Constants.BarCodeType.pdf417,
          ],
        }}
        onBarCodeScanned={this.state.barcodeScanning ? this.onBarCodeScanned : undefined}>
        {this.renderTopBar()}
        {this.renderBottomBar()}
      
      {this.state.faceDetecting && this.renderFaces()}
      {this.state.faceDetecting && this.renderLandmarks()}
      {this.state.showMoreOptions && this.renderMoreOptions()}
    
  );
github bastiRe / eLadder / app / components / base / LeagueScanner.js View on Github external
Requesting camera permission to scan a league code.
        
      );
    } else if (this.state.hasCameraPermission === false) {
      content = (
        
          eLadder needs camera permission to scan a league code.
        
      );
    } else {
      content = (
        
          
          
            
          
        
      );
    }

    return {content};
  }
}
github expo / expo / apps / native-component-list / src / screens / BarCodeScannerScreen.tsx View on Github external
toggleType = () =>
    this.setState({
      type:
        this.state.type === BarCodeScanner.Constants.Type.back
          ? BarCodeScanner.Constants.Type.front
          : BarCodeScanner.Constants.Type.back,
    })
github expo / expo / apps / native-component-list / src / screens / BarCodeScannerScreen.tsx View on Github external
width: number;
      height: number;
    };
  };
}

export default class BarcodeScannerExample extends React.Component<{}, State> {
  static navigationOptions = {
    title: '',
  };

  canChangeOrientation = false;

  readonly state: State = {
    isPermissionsGranted: false,
    type: BarCodeScanner.Constants.Type.back,
    alerting: false,
    haveDimensions: false,
  };

  componentDidFocus = async () => {
    const { status } = await Permissions.askAsync(Permissions.CAMERA);
    this.setState({ isPermissionsGranted: status === 'granted' });
  }

  toggleAlertingAboutResult = () => {
    this.setState({ alerting: !this.state.alerting });
  }

  toggleScreenOrientationState = () => {
    if (this.canChangeOrientation) {
      ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP);
github expo / expo / apps / native-component-list / src / screens / Camera / CameraScreen.tsx View on Github external
type={this.state.type}
        flashMode={this.state.flash}
        autoFocus={this.state.autoFocus}
        zoom={this.state.zoom}
        whiteBalance={this.state.whiteBalance}
        ratio={this.state.ratio}
        pictureSize={this.state.pictureSize}
        onMountError={this.handleMountError}
        onFacesDetected={this.state.faceDetecting ? this.onFacesDetected : undefined}
        faceDetectorSettings={{
          tracking: true,
        }}
        barCodeScannerSettings={{
          barCodeTypes: [
            BarCodeScanner.Constants.BarCodeType.qr,
            BarCodeScanner.Constants.BarCodeType.pdf417,
          ],
        }}
        onBarCodeScanned={this.state.barcodeScanning ? this.onBarCodeScanned : undefined}>
        {this.renderTopBar()}
        {this.renderBottomBar()}
      
      {this.state.faceDetecting && this.renderFaces()}
      {this.state.faceDetecting && this.renderLandmarks()}
      {this.state.showMoreOptions && this.renderMoreOptions()}
    
  );
github expo / expo / apps / native-component-list / src / screens / BarCodeScannerScreen.tsx View on Github external
r={2}
            strokeWidth={0.1}
            stroke="gray"
            fill="green"
          />
        );
      }
    }

    return (
github lightninglabs / lightning-app / src / component / qrcode-scanner.js View on Github external
} else if (hasCameraPermission === false) {
      return (
        
      );
    } else {
      return (
        
      );
    }
  }
}

expo-barcode-scanner

Allows scanning variety of supported barcodes both as standalone module and as extension for expo-camera. It also allows scanning barcodes from existing images.

MIT
Latest version published 8 months ago

Package Health Score

85 / 100
Full package analysis