mirror of
https://github.com/status-im/react-native-camera.git
synced 2025-02-23 09:18:07 +00:00
Merge branch 'master' of github.com:lwansbrough/react-native-camera
This commit is contained in:
commit
84809401a5
@ -159,6 +159,8 @@ public class RCTCameraModule extends ReactContextBaseJavaModule {
|
|||||||
camera.takePicture(null, null, new Camera.PictureCallback() {
|
camera.takePicture(null, null, new Camera.PictureCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onPictureTaken(byte[] data, Camera camera) {
|
public void onPictureTaken(byte[] data, Camera camera) {
|
||||||
|
camera.stopPreview();
|
||||||
|
camera.startPreview();
|
||||||
switch (options.getInt("target")) {
|
switch (options.getInt("target")) {
|
||||||
case RCT_CAMERA_CAPTURE_TARGET_MEMORY:
|
case RCT_CAMERA_CAPTURE_TARGET_MEMORY:
|
||||||
String encoded = Base64.encodeToString(data, Base64.DEFAULT);
|
String encoded = Base64.encodeToString(data, Base64.DEFAULT);
|
||||||
|
@ -144,6 +144,3 @@ public class RCTCameraView extends ViewGroup {
|
|||||||
this.postInvalidate(this.getLeft(), this.getTop(), this.getRight(), this.getBottom());
|
this.postInvalidate(this.getLeft(), this.getTop(), this.getRight(), this.getBottom());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,6 +89,9 @@ class RCTCameraViewFinder extends TextureView implements TextureView.SurfaceText
|
|||||||
_isStarting = true;
|
_isStarting = true;
|
||||||
try {
|
try {
|
||||||
_camera = RCTCamera.getInstance().acquireCameraInstance(_cameraType);
|
_camera = RCTCamera.getInstance().acquireCameraInstance(_cameraType);
|
||||||
|
Camera.Parameters parameters = _camera.getParameters();
|
||||||
|
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE);
|
||||||
|
_camera.setParameters(parameters);
|
||||||
_camera.setPreviewTexture(_surfaceTexture);
|
_camera.setPreviewTexture(_surfaceTexture);
|
||||||
_camera.startPreview();
|
_camera.startPreview();
|
||||||
} catch (NullPointerException e) {
|
} catch (NullPointerException e) {
|
||||||
@ -120,6 +123,3 @@ class RCTCameraViewFinder extends TextureView implements TextureView.SurfaceText
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user