make sure we have a valid capture session at focusing and zooming

This commit is contained in:
tibbi 2018-06-07 13:42:22 +02:00
parent a037fd5761
commit 31d7ee2663
1 changed files with 2 additions and 1 deletions

View File

@ -112,13 +112,14 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
mDownEventAtY = event.y
} else if (event.action == MotionEvent.ACTION_UP) {
if (mIsFocusSupported && System.currentTimeMillis() - mDownEventAtMS < CLICK_MS &&
mCaptureSession != null &&
Math.abs(event.x - mDownEventAtX) < CLICK_DIST &&
Math.abs(event.y - mDownEventAtY) < CLICK_DIST) {
focusArea(event.x, event.y)
}
}
if (mIsZoomSupported && event.pointerCount > 1) {
if (mIsZoomSupported && event.pointerCount > 1 && mCaptureSession != null) {
handleZoom(event)
}
true