Merge pull request #17 from mbernier85/master

Fix issue #10 properly for front camera opening by default instead of back camera
pull/19/head
Florent CHAMPIGNY 8 years ago committed by GitHub
commit 1d5a2ba78a
  1. 2
      build.gradle
  2. 2
      camerafragment/src/main/java/com/github/florent37/camerafragment/internal/controller/impl/Camera1Controller.java

@ -20,7 +20,7 @@ allprojects {
ext {
sdk = 25
buildTools = "24.0.3"
buildTools = "25.0.2"
minSdk = 10
libraryVersion = "1.0.3"
supportVersion = "25.1.0"

@ -113,7 +113,7 @@ public class Camera1Controller implements CameraController<Integer>,
final Integer frontCameraId = cameraManager.getFaceFrontCameraId();
final Integer currentCameraId = cameraManager.getCurrentCameraId();
if (cameraFace == Configuration.CAMERA_FACE_REAR && backCameraId != null && !backCameraId.equals(currentCameraId)) {
if (cameraFace == Configuration.CAMERA_FACE_REAR && backCameraId != null) {
setCurrentCameraId(backCameraId);
cameraManager.closeCamera(this);
} else if (frontCameraId != null && !frontCameraId.equals(currentCameraId)) {

Loading…
Cancel
Save