protected override MobileBarcodeScanner GetInstance() { var scanner = new MobileBarcodeScanner(this.getTopActivity()); if (BarCodes.CustomOverlayFactory != null) { var overlay = BarCodes.CustomOverlayFactory(); if (overlay != null) { scanner.UseCustomOverlay = true; scanner.CustomOverlay = overlay; } } return(scanner); }
protected override MobileBarcodeScanner GetInstance() { var scanner = new MobileBarcodeScanner(Deployment.Current.Dispatcher); if (BarCodes.CustomOverlayFactory != null) { var overlay = BarCodes.CustomOverlayFactory(); if (overlay != null) { scanner.UseCustomOverlay = true; scanner.CustomOverlay = overlay; } } return(scanner); }
//public void CheckScannerAvailability() { // var frontCamera = UIImagePickerController.IsCameraDeviceAvailable(UIImagePickerControllerCameraDevice.Front); // var rearCamera = UIImagePickerController.IsCameraDeviceAvailable(UIImagePickerControllerCameraDevice.Rear); // if (!frontCamera && !rearCamera) // throw; // return await AVCaptureDevice.RequestAccessForMediaTypeAsync(AVMediaType.Video); //} protected override MobileBarcodeScanner GetInstance() { var controller = this.GetTopViewController(); var scanner = new MobileBarcodeScanner(controller); if (BarCodes.CustomOverlayFactory != null) { var overlay = BarCodes.CustomOverlayFactory(); if (overlay != null) { scanner.UseCustomOverlay = true; scanner.CustomOverlay = overlay; } } return(scanner); }