-
Notifications
You must be signed in to change notification settings - Fork 399
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: retry v8 * chore: remove stc bigint patches * fit: specify cmake 3.18.1 * Revert "fit: specify cmake 3.18.1" This reverts commit 4f883b9. * chore: install cmake 3.18.1 on eas * chore: use @onekeyfe/react-native-reanimated * chore: update podfile.lock Co-authored-by: ll__ <[email protected]>
- Loading branch information
Showing
12 changed files
with
108 additions
and
121 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
module.exports = { | ||
// dependencies: { | ||
// // disable frameprocessor and vision-camera-code-scanner | ||
// // until reanimated v3 offcially supports v8 | ||
// 'vision-camera-code-scanner': { | ||
// platforms: { | ||
// android: null, // disable Android platform, other platforms will still autolink if provided | ||
// }, | ||
// }, | ||
// 'react-native-vision-camera': { | ||
// platforms: { | ||
// android: null, // disable Android platform, other platforms will still autolink if provided | ||
// }, | ||
// }, | ||
// }, | ||
dependencies: { | ||
// disable frameprocessor and vision-camera-code-scanner | ||
// until reanimated v3 offcially supports v8 | ||
'vision-camera-code-scanner': { | ||
platforms: { | ||
android: null, // disable Android platform, other platforms will still autolink if provided | ||
}, | ||
}, | ||
'react-native-vision-camera': { | ||
platforms: { | ||
android: null, // disable Android platform, other platforms will still autolink if provided | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import React, { FC } from 'react'; | ||
|
||
import { runOnJS } from 'react-native-reanimated'; | ||
import { | ||
Camera, | ||
useCameraDevices, | ||
useFrameProcessor, | ||
} from 'react-native-vision-camera'; | ||
import { BarcodeFormat, scanBarcodes } from 'vision-camera-code-scanner'; | ||
|
||
import { ScanCameraProps } from './types'; | ||
|
||
const ScanCamera: FC<ScanCameraProps> = ({ | ||
style, | ||
isActive, | ||
children, | ||
onQrcodeScanned, | ||
}) => { | ||
const devices = useCameraDevices(); | ||
const device = devices.back; | ||
const frameProcessor = useFrameProcessor((frame) => { | ||
'worklet'; | ||
|
||
const detectedBarcodes = scanBarcodes(frame, [BarcodeFormat.QR_CODE], { | ||
checkInverted: true, | ||
}); | ||
runOnJS(onQrcodeScanned)(detectedBarcodes[0]?.rawValue); | ||
}, []); | ||
return device ? ( | ||
<> | ||
<Camera | ||
style={style} | ||
device={device} | ||
isActive={isActive} | ||
frameProcessor={frameProcessor} | ||
frameProcessorFps={5} | ||
/> | ||
{children} | ||
</> | ||
) : null; | ||
}; | ||
ScanCamera.displayName = 'ScanCamera'; | ||
|
||
export default ScanCamera; |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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