Added TORCH flash mode (to be used with video)

pull/1/head
Andrei Diaconu 8 years ago
parent 63fe1e6cbf
commit b81dd66f4f
  1. 1
      camerakit/src/main/api16/com/flurgle/camerakit/ConstantMapper.java
  2. 1
      camerakit/src/main/java/com/flurgle/camerakit/CameraKit.java
  3. 2
      camerakit/src/main/java/com/flurgle/camerakit/CameraView.java
  4. 3
      camerakit/src/main/types/com/flurgle/camerakit/Flash.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_OFF, Camera.Parameters.FLASH_MODE_OFF);
FLASH_MODES.put(CameraKit.Constants.FLASH_ON, Camera.Parameters.FLASH_MODE_ON); 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_AUTO, Camera.Parameters.FLASH_MODE_AUTO);
FLASH_MODES.put(CameraKit.Constants.FLASH_TORCH, Camera.Parameters.FLASH_MODE_TORCH);
} }
protected Flash(int cameraKitConstant) { protected Flash(int cameraKitConstant) {

@ -21,6 +21,7 @@ public class CameraKit {
public static final int FLASH_OFF = 0; public static final int FLASH_OFF = 0;
public static final int FLASH_ON = 1; public static final int FLASH_ON = 1;
public static final int FLASH_AUTO = 2; 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_OFF = 0;
public static final int FOCUS_CONTINUOUS = 1; public static final int FOCUS_CONTINUOUS = 1;

@ -30,6 +30,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_AUTO;
import static com.flurgle.camerakit.CameraKit.Constants.FLASH_OFF; 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_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.METHOD_STANDARD;
import static com.flurgle.camerakit.CameraKit.Constants.PERMISSIONS_LAZY; import static com.flurgle.camerakit.CameraKit.Constants.PERMISSIONS_LAZY;
import static com.flurgle.camerakit.CameraKit.Constants.PERMISSIONS_PICTURE; import static com.flurgle.camerakit.CameraKit.Constants.PERMISSIONS_PICTURE;
@ -303,6 +304,7 @@ public class CameraView extends FrameLayout {
break; break;
case FLASH_AUTO: case FLASH_AUTO:
case FLASH_TORCH:
setFlash(FLASH_OFF); setFlash(FLASH_OFF);
break; break;
} }

@ -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_AUTO;
import static com.flurgle.camerakit.CameraKit.Constants.FLASH_OFF; 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_ON;
import static com.flurgle.camerakit.CameraKit.Constants.FLASH_TORCH;
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
@IntDef({FLASH_OFF, FLASH_ON, FLASH_AUTO}) @IntDef({FLASH_OFF, FLASH_ON, FLASH_AUTO, FLASH_TORCH})
public @interface Flash { public @interface Flash {
} }
Loading…
Cancel
Save