From d9432ec98d51b84333c59c0fa8364bb910de140f Mon Sep 17 00:00:00 2001 From: Radu Popovici Date: Sun, 20 Mar 2016 22:39:30 +0200 Subject: [PATCH] add capture quality constants --- .../com/lwansbrough/RCTCamera/RCTCameraModule.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java b/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java index b4c8570..b73e5d1 100644 --- a/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java +++ b/android/src/main/java/com/lwansbrough/RCTCamera/RCTCameraModule.java @@ -69,6 +69,7 @@ public class RCTCameraModule extends ReactContextBaseJavaModule { { put("Aspect", getAspectConstants()); put("Type", getTypeConstants()); + put("CaptureQuality", getCaptureQualityConstants()); put("CaptureMode", getCaptureModeConstants()); put("CaptureTarget", getCaptureTargetConstants()); put("Orientation", getOrientationConstants()); @@ -95,6 +96,16 @@ public class RCTCameraModule extends ReactContextBaseJavaModule { }); } + private Map getCaptureQualityConstants() { + return Collections.unmodifiableMap(new HashMap() { + { + put("low", "low"); + put("medium", "medium"); + put("high", "high"); + } + }); + } + private Map getCaptureModeConstants() { return Collections.unmodifiableMap(new HashMap() { { @@ -156,6 +167,7 @@ public class RCTCameraModule extends ReactContextBaseJavaModule { promise.reject("No camera found."); return; } + RCTCamera.getInstance().setCaptureQuality(options.getInt("type"), options.getString("quality")); camera.takePicture(null, null, new Camera.PictureCallback() { @Override public void onPictureTaken(byte[] data, Camera camera) {