Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export class BarcodeScanner extends Component<Props> {
<RNCamera
testID={this.props.name}
style={{ flex: 1, justifyContent: "center", alignItems: "center" }}
type={this.props.cameraType === 'front' ? RNCamera.Constants.Type.front : RNCamera.Constants.Type.back}
captureAudio={false}
onBarCodeRead={this.onBarCodeReadHandler}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
<description />
</property>
</propertyGroup>
<propertyGroup caption="Camera">
<property key="cameraType" type="enumeration" required="true" defaultValue="back">
<caption>Camera type</caption>
<description>Select camera to use for the scanner.</description>
<enumerationValues>
<enumerationValue key="front">Front</enumerationValue>
<enumerationValue key="back">Back</enumerationValue>
</enumerationValues>
</property>
</propertyGroup>
<propertyGroup caption="Events">
<property key="onDetect" type="action" required="false">
<caption>On detect</caption>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
import { CSSProperties } from "react";
import { ActionValue, EditableValue } from "mendix";

export type CameraTypeEnum = "front" | "back";

export interface BarcodeScannerProps<Style> {
name: string;
style: Style[];
barcode: EditableValue<string>;
showMask: boolean;
showAnimatedLine: boolean;
cameraType: CameraTypeEnum;
onDetect?: ActionValue;
}

Expand All @@ -27,5 +30,6 @@ export interface BarcodeScannerPreviewProps {
barcode: string;
showMask: boolean;
showAnimatedLine: boolean;
cameraType: CameraTypeEnum;
onDetect: {} | null;
}