add capture quality constants
This commit is contained in:
parent
5659cc7809
commit
d9432ec98d
|
@ -69,6 +69,7 @@ public class RCTCameraModule extends ReactContextBaseJavaModule {
|
||||||
{
|
{
|
||||||
put("Aspect", getAspectConstants());
|
put("Aspect", getAspectConstants());
|
||||||
put("Type", getTypeConstants());
|
put("Type", getTypeConstants());
|
||||||
|
put("CaptureQuality", getCaptureQualityConstants());
|
||||||
put("CaptureMode", getCaptureModeConstants());
|
put("CaptureMode", getCaptureModeConstants());
|
||||||
put("CaptureTarget", getCaptureTargetConstants());
|
put("CaptureTarget", getCaptureTargetConstants());
|
||||||
put("Orientation", getOrientationConstants());
|
put("Orientation", getOrientationConstants());
|
||||||
|
@ -95,6 +96,16 @@ public class RCTCameraModule extends ReactContextBaseJavaModule {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Map<String, Object> getCaptureQualityConstants() {
|
||||||
|
return Collections.unmodifiableMap(new HashMap<String, Object>() {
|
||||||
|
{
|
||||||
|
put("low", "low");
|
||||||
|
put("medium", "medium");
|
||||||
|
put("high", "high");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private Map<String, Object> getCaptureModeConstants() {
|
private Map<String, Object> getCaptureModeConstants() {
|
||||||
return Collections.unmodifiableMap(new HashMap<String, Object>() {
|
return Collections.unmodifiableMap(new HashMap<String, Object>() {
|
||||||
{
|
{
|
||||||
|
@ -156,6 +167,7 @@ public class RCTCameraModule extends ReactContextBaseJavaModule {
|
||||||
promise.reject("No camera found.");
|
promise.reject("No camera found.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
RCTCamera.getInstance().setCaptureQuality(options.getInt("type"), options.getString("quality"));
|
||||||
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) {
|
||||||
|
|
Loading…
Reference in New Issue