Do not lock for normal gestures

pull/580/head
Mattia Iavarone 6 years ago
parent 5e66e6d560
commit fcc35056c7
  1. 19
      cameraview/src/main/java/com/otaliastudios/cameraview/engine/Camera2Engine.java

@ -1279,7 +1279,16 @@ public class Camera2Engine extends CameraEngine implements ImageReader.OnImageAv
"gesture:", mMeteringGesture, "gesture:", mMeteringGesture,
"needsFlash:", mMeteringNeedsFlash, "needsFlash:", mMeteringNeedsFlash,
"success:", success); "success:", success);
lockMetering(point); if (point != null) {
mCallback.dispatchOnFocusEnd(mMeteringGesture, success, point);
mHandler.remove(mMeteringResetRunnable);
if (shouldResetAutoFocus()) {
mHandler.post(getAutoFocusResetDelay(), mMeteringResetRunnable);
}
} else {
// Continue with picture capturing.
lockMetering(null);
}
} }
/** /**
@ -1332,13 +1341,7 @@ public class Camera2Engine extends CameraEngine implements ImageReader.OnImageAv
public void onLocked(@Nullable PointF point, boolean success) { public void onLocked(@Nullable PointF point, boolean success) {
LOG.w("onLocked - point:", point, "gesture:", mMeteringGesture, "success:", success); LOG.w("onLocked - point:", point, "gesture:", mMeteringGesture, "success:", success);
mLocker = null; mLocker = null;
if (point != null) { if (point == null) {
mCallback.dispatchOnFocusEnd(mMeteringGesture, success, point);
mHandler.remove(mMeteringResetRunnable);
if (shouldResetAutoFocus()) {
mHandler.post(getAutoFocusResetDelay(), mMeteringResetRunnable);
}
} else {
LOG.w("onLocked - restoring the picture capturing. isSnapshot:", mDelayedPictureStub.isSnapshot); LOG.w("onLocked - restoring the picture capturing. isSnapshot:", mDelayedPictureStub.isSnapshot);
if (mDelayedPictureStub.isSnapshot) { if (mDelayedPictureStub.isSnapshot) {
onTakePictureSnapshot(mDelayedPictureStub, mDelayedPictureRatio, false); onTakePictureSnapshot(mDelayedPictureStub, mDelayedPictureRatio, false);

Loading…
Cancel
Save