Merge pull request #45 from muratgu/master

Ignore tap-to-focus if not supported
pull/1/head
Dylan McIntyre 8 years ago committed by GitHub
commit ae99e6fb56
  1. 4
      camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java

@ -448,7 +448,9 @@ public class Camera1 extends CameraImpl {
Camera.Parameters parameters = mCamera.getParameters(); Camera.Parameters parameters = mCamera.getParameters();
if (parameters.getMaxNumMeteringAreas() > 0) { if (parameters.getMaxNumMeteringAreas() > 0) {
Rect rect = calculateFocusArea(event.getX(), event.getY()); Rect rect = calculateFocusArea(event.getX(), event.getY());
if(!parameters.getSupportedFocusModes().contains(Camera.Parameters.FOCUS_MODE_AUTO)) {
return false; //cannot autoFocus
}
parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO); parameters.setFocusMode(Camera.Parameters.FOCUS_MODE_AUTO);
List<Camera.Area> meteringAreas = new ArrayList<>(); List<Camera.Area> meteringAreas = new ArrayList<>();
meteringAreas.add(new Camera.Area(rect, getFocusMeteringAreaWeight())); meteringAreas.add(new Camera.Area(rect, getFocusMeteringAreaWeight()));

Loading…
Cancel
Save