commit
43e11e61fe
|
@ -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
|
||||
|
|
|
@ -279,7 +279,7 @@ public class CameraViewManager extends SimpleViewManager<CameraView> {
|
|||
@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);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -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'}
|
||||
|
|
|
@ -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];
|
||||
});
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -164,7 +164,6 @@ export default class CameraScreenBase extends Component {
|
|||
|
||||
onReadCode = {this.props.onReadCode}
|
||||
scannerOptions = {this.state.scannerOptions}
|
||||
isShowFrameForScanner = {this.props.isShowFrameForScanner}
|
||||
/>
|
||||
}
|
||||
</View>
|
||||
|
|
Loading…
Reference in New Issue