diff --git a/camerakit/src/main/api16/com/flurgle/camerakit/ConstantMapper.java b/camerakit/src/main/api16/com/flurgle/camerakit/ConstantMapper.java index 4e73e7c8..6b92febf 100644 --- a/camerakit/src/main/api16/com/flurgle/camerakit/ConstantMapper.java +++ b/camerakit/src/main/api16/com/flurgle/camerakit/ConstantMapper.java @@ -28,6 +28,7 @@ public class ConstantMapper { FLASH_MODES.put(CameraKit.Constants.FLASH_OFF, Camera.Parameters.FLASH_MODE_OFF); FLASH_MODES.put(CameraKit.Constants.FLASH_ON, Camera.Parameters.FLASH_MODE_ON); FLASH_MODES.put(CameraKit.Constants.FLASH_AUTO, Camera.Parameters.FLASH_MODE_AUTO); + FLASH_MODES.put(CameraKit.Constants.FLASH_TORCH, Camera.Parameters.FLASH_MODE_TORCH); } protected Flash(int cameraKitConstant) { diff --git a/camerakit/src/main/java/com/flurgle/camerakit/CameraKit.java b/camerakit/src/main/java/com/flurgle/camerakit/CameraKit.java index 1ea8da85..bce758db 100644 --- a/camerakit/src/main/java/com/flurgle/camerakit/CameraKit.java +++ b/camerakit/src/main/java/com/flurgle/camerakit/CameraKit.java @@ -21,6 +21,7 @@ public class CameraKit { public static final int FLASH_OFF = 0; public static final int FLASH_ON = 1; public static final int FLASH_AUTO = 2; + public static final int FLASH_TORCH = 3; public static final int FOCUS_OFF = 0; public static final int FOCUS_CONTINUOUS = 1; diff --git a/camerakit/src/main/java/com/flurgle/camerakit/CameraView.java b/camerakit/src/main/java/com/flurgle/camerakit/CameraView.java index 5930e2e3..bba800e6 100644 --- a/camerakit/src/main/java/com/flurgle/camerakit/CameraView.java +++ b/camerakit/src/main/java/com/flurgle/camerakit/CameraView.java @@ -36,6 +36,7 @@ import static com.flurgle.camerakit.CameraKit.Constants.FACING_FRONT; import static com.flurgle.camerakit.CameraKit.Constants.FLASH_AUTO; import static com.flurgle.camerakit.CameraKit.Constants.FLASH_OFF; import static com.flurgle.camerakit.CameraKit.Constants.FLASH_ON; +import static com.flurgle.camerakit.CameraKit.Constants.FLASH_TORCH; import static com.flurgle.camerakit.CameraKit.Constants.METHOD_STANDARD; import static com.flurgle.camerakit.CameraKit.Constants.PERMISSIONS_LAZY; import static com.flurgle.camerakit.CameraKit.Constants.PERMISSIONS_PICTURE; @@ -406,6 +407,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver { break; case FLASH_AUTO: + case FLASH_TORCH: setFlash(FLASH_OFF); break; } diff --git a/camerakit/src/main/types/com/flurgle/camerakit/Flash.java b/camerakit/src/main/types/com/flurgle/camerakit/Flash.java index 08055486..e42800b0 100644 --- a/camerakit/src/main/types/com/flurgle/camerakit/Flash.java +++ b/camerakit/src/main/types/com/flurgle/camerakit/Flash.java @@ -8,8 +8,9 @@ import java.lang.annotation.RetentionPolicy; import static com.flurgle.camerakit.CameraKit.Constants.FLASH_AUTO; import static com.flurgle.camerakit.CameraKit.Constants.FLASH_OFF; import static com.flurgle.camerakit.CameraKit.Constants.FLASH_ON; +import static com.flurgle.camerakit.CameraKit.Constants.FLASH_TORCH; @Retention(RetentionPolicy.SOURCE) -@IntDef({FLASH_OFF, FLASH_ON, FLASH_AUTO}) +@IntDef({FLASH_OFF, FLASH_ON, FLASH_AUTO, FLASH_TORCH}) public @interface Flash { } \ No newline at end of file