From 2828c64fafecc1e49b2b73c7c84a39a5baa1c709 Mon Sep 17 00:00:00 2001 From: Suneet Agrawal Date: Tue, 2 Jul 2019 15:52:18 +0530 Subject: [PATCH] implemented zoom for camera2 --- .../java/com/otaliastudios/cameraview/CameraOptions.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java index 9953c899..ca9dd397 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java @@ -200,7 +200,10 @@ public class CameraOptions { if (value != null) supportedHdr.add(value); } - // TODO zoom + //zoom + Float maxZoom = cameraCharacteristics.get(CameraCharacteristics.SCALER_AVAILABLE_MAX_DIGITAL_ZOOM); + zoomSupported = maxZoom != null && maxZoom > 1; + // autofocus int[] afModes = cameraCharacteristics.get(CameraCharacteristics.CONTROL_AF_AVAILABLE_MODES); @@ -219,8 +222,7 @@ public class CameraOptions { exposureCorrectionMaxValue = exposureRange.getUpper(); } - exposureCorrectionSupported = exposureCorrectionMinValue != 0 - || exposureCorrectionMaxValue != 0; + exposureCorrectionSupported = exposureCorrectionMinValue != 0 && exposureCorrectionMaxValue != 0; // Picture Sizes