diff --git a/README.md b/README.md index 339d2c1..5a8a9b9 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ Attribute | Values onReadQRCode={((event) => Alert.alert("Qr code found"))} //optional hideControls={false} //(default false) optional, hide buttons and additional controls on top and bottom of screen - isShowFrameForScanner={true} //(default false) optional, show frame with transparent layer (qr code or barcode will be read on this area ONLY), start animation for scanner,that stoped when find any code. Frame always at center of the screen + showFrame={true} //(default false) optional, show frame with transparent layer (qr code or barcode will be read on this area ONLY), start animation for scanner,that stoped when find any code. Frame always at center of the screen offsetForScannerFrame = {10} //(default 30) optional, offset from left and right side of the screen heightForScannerFrame = {300} //(default 200) optional, change height of the scanner frame colorForScannerFrame = {'red'} //(default white) optional, change colot of the scanner frame diff --git a/android/src/main/java/com/wix/RNCameraKit/camera/CameraViewManager.java b/android/src/main/java/com/wix/RNCameraKit/camera/CameraViewManager.java index af064d2..05be099 100644 --- a/android/src/main/java/com/wix/RNCameraKit/camera/CameraViewManager.java +++ b/android/src/main/java/com/wix/RNCameraKit/camera/CameraViewManager.java @@ -279,7 +279,7 @@ public class CameraViewManager extends SimpleViewManager { @Override public void handleResult(Result rawResult) { WritableMap event = Arguments.createMap(); - event.putString("qrcodeStringValue", rawResult.getText()); + event.putString("codeStringValue", rawResult.getText()); reactContext.getJSModule(RCTEventEmitter.class).receiveEvent(cameraViews.peek().getId(), "onReadCode", event); } }); diff --git a/example/src/BarcodeScreen.js b/example/src/BarcodeScreen.js index 1ef48e6..92bf19d 100644 --- a/example/src/BarcodeScreen.js +++ b/example/src/BarcodeScreen.js @@ -37,7 +37,6 @@ export default class CameraScreen extends Component { onReadCode={((event) => Alert.alert(`Qr code found ${event.nativeEvent.codeStringValue} `))} hideControls={true} - isShowFrameForScanner={true} // offsetForScannerFrame = {10} // heightForScannerFrame = {300} colorForScannerFrame = {'blue'} diff --git a/ios/lib/ReactNativeCameraKit/CKCamera.m b/ios/lib/ReactNativeCameraKit/CKCamera.m index d589c9d..26b6942 100644 --- a/ios/lib/ReactNativeCameraKit/CKCamera.m +++ b/ios/lib/ReactNativeCameraKit/CKCamera.m @@ -95,7 +95,7 @@ RCT_ENUM_CONVERTER(CKCameraZoomMode, (@{ // frame for Scanner @property (nonatomic, strong) NSDictionary *scannerOptions; -@property (nonatomic) BOOL isShowFrameForScanner; +@property (nonatomic) BOOL showFrame; @property (nonatomic) UIView *greenScanner; @property (nonatomic) CGFloat frameOffset; @@ -363,7 +363,7 @@ RCT_ENUM_CONVERTER(CKCameraZoomMode, (@{ [self addObservers]; [self.session startRunning]; self.sessionRunning = self.session.isRunning; - if (self.isShowFrameForScanner) { + if (self.showFrame) { dispatch_async(dispatch_get_main_queue(), ^{ [self addFrameForScanner]; }); diff --git a/ios/lib/ReactNativeCameraKit/CKCameraManager.m b/ios/lib/ReactNativeCameraKit/CKCameraManager.m index 5d68a89..858a27e 100644 --- a/ios/lib/ReactNativeCameraKit/CKCameraManager.m +++ b/ios/lib/ReactNativeCameraKit/CKCameraManager.m @@ -29,7 +29,7 @@ RCT_EXPORT_VIEW_PROPERTY(cameraOptions, NSDictionary) RCT_EXPORT_VIEW_PROPERTY(onReadCode, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(scannerOptions, NSDictionary) -RCT_EXPORT_VIEW_PROPERTY(isShowFrameForScanner, BOOL) +RCT_EXPORT_VIEW_PROPERTY(showFrame, BOOL) diff --git a/src/CameraScreen/CameraKitCameraScreenBase.js b/src/CameraScreen/CameraKitCameraScreenBase.js index f6ec1de..4dbb72c 100644 --- a/src/CameraScreen/CameraKitCameraScreenBase.js +++ b/src/CameraScreen/CameraKitCameraScreenBase.js @@ -164,7 +164,6 @@ export default class CameraScreenBase extends Component { onReadCode = {this.props.onReadCode} scannerOptions = {this.state.scannerOptions} - isShowFrameForScanner = {this.props.isShowFrameForScanner} /> }