Woonivers / react-native-document-scanner

Document scanner, features live border detection, perspective correction, image filters and more ! 📲📸
MIT License
85 stars 71 forks source link

how i can auto take photo in android ?? #33

Open minh-dai opened 4 years ago

armin23615 commented 4 years ago

It takes photo automatically by default, unless you use Manual capture. https://github.com/Woonivers/react-native-document-scanner#manual-capture

minh-dai commented 4 years ago

No, In android it not auto take photo, but ios is success

luechenchris commented 4 years ago

For my device (Oneplus), I found that autofocus keeps failing. Thus, commenting out the conditional at line 553 (https://github.com/Woonivers/react-native-document-scanner/blob/master/android/src/main/java/com/documentscanner/views/OpenNoteCameraView.java) allows the image to be captured.

public void onAutoFocus(boolean success, Camera camera) { Log.d(TAG, "onAutoFocusSuccess: " + success); if (success) { takePicture(); <--- only keep this. } else { onPictureFailed(); } }