|
|
@ -6,8 +6,6 @@ import android.support.annotation.Nullable; |
|
|
|
import android.util.Log; |
|
|
|
import android.util.Log; |
|
|
|
import android.view.SurfaceHolder; |
|
|
|
import android.view.SurfaceHolder; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.github.florent37.camerafragment.configuration.Configuration; |
|
|
|
import com.github.florent37.camerafragment.configuration.Configuration; |
|
|
|
import com.github.florent37.camerafragment.configuration.ConfigurationProvider; |
|
|
|
import com.github.florent37.camerafragment.configuration.ConfigurationProvider; |
|
|
|
import com.github.florent37.camerafragment.internal.controller.CameraController; |
|
|
|
import com.github.florent37.camerafragment.internal.controller.CameraController; |
|
|
@ -23,6 +21,8 @@ import com.github.florent37.camerafragment.internal.utils.CameraHelper; |
|
|
|
import com.github.florent37.camerafragment.internal.utils.Size; |
|
|
|
import com.github.florent37.camerafragment.internal.utils.Size; |
|
|
|
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener; |
|
|
|
import com.github.florent37.camerafragment.listeners.CameraFragmentResultListener; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.File; |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
|
* Created by memfis on 7/7/16. |
|
|
|
* Created by memfis on 7/7/16. |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -101,14 +101,15 @@ public class Camera1Controller implements CameraController<Integer>, |
|
|
|
public void switchCamera(@Configuration.CameraFace final int cameraFace) { |
|
|
|
public void switchCamera(@Configuration.CameraFace final int cameraFace) { |
|
|
|
final Integer backCameraId = cameraManager.getFaceBackCameraId(); |
|
|
|
final Integer backCameraId = cameraManager.getFaceBackCameraId(); |
|
|
|
final Integer frontCameraId = cameraManager.getFaceFrontCameraId(); |
|
|
|
final Integer frontCameraId = cameraManager.getFaceFrontCameraId(); |
|
|
|
|
|
|
|
final Integer currentCameraId = cameraManager.getCurrentCameraId(); |
|
|
|
|
|
|
|
|
|
|
|
if(cameraManager.getCurrentCameraId().equals(frontCameraId)){ |
|
|
|
if (cameraFace == Configuration.CAMERA_FACE_REAR && backCameraId != null && !backCameraId.equals(currentCameraId)) { |
|
|
|
setCurrentCameraId(backCameraId); |
|
|
|
setCurrentCameraId(backCameraId); |
|
|
|
} else { |
|
|
|
cameraManager.closeCamera(this); |
|
|
|
|
|
|
|
} else if (frontCameraId != null && !frontCameraId.equals(currentCameraId)) { |
|
|
|
setCurrentCameraId(frontCameraId); |
|
|
|
setCurrentCameraId(frontCameraId); |
|
|
|
|
|
|
|
cameraManager.closeCamera(this); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
cameraManager.closeCamera(this); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|