Added cameratype (front/back) to properties of BarcodeScanner Native#34
Open
magnusgreennl wants to merge 5 commits intomendix:mainfrom
Open
Added cameratype (front/back) to properties of BarcodeScanner Native#34magnusgreennl wants to merge 5 commits intomendix:mainfrom
magnusgreennl wants to merge 5 commits intomendix:mainfrom
Conversation
Contributor
|
@jdiehl Can you check if this feature is something we should include in the widget? |
| <RNCamera | ||
| testID={this.props.name} | ||
| style={{ flex: 1, justifyContent: "center", alignItems: "center" }} | ||
| type={this.props.cameraType == 'back' ? RNCamera.Constants.Type.back : RNCamera.Constants.Type.front} |
Contributor
There was a problem hiding this comment.
Could you invert the condition like this:
type={this.props.cameraType === 'front' ? RNCamera.Constants.Type.front : RNCamera.Constants.Type.back}
This is for the sake of being future proof. If the names change or have other types of cameras, this way it can fallback to back instead of front.
Also, please use three equals :)
There was a problem hiding this comment.
Looks good to me - @furkanarabaci what do you think?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On request of a customer we had to add an option to use the front camera for the BarcodeScanner (hanging tablet on a wall, where barcodes were presented to the tablet). This is a standard option on react-native-camera (see doc).
Note that the front camera often is of less quality, so barcodes will be harder to scan.
Checklist
[XX-000]: description)? ✅ ❌Feature specific
Please remove unnecessary emojis and sections and this comment before proceeding
This PR contains
What is the purpose of this PR?
...
Relevant changes
Please add a high level explanation of what was changed and how the initial problem was solved
What should be covered while testing?
...
Extra comments (optional)
Please add extra comments or delete the section if not required