make sure we have a valid capture session at focusing and zooming
This commit is contained in:
parent
a037fd5761
commit
31d7ee2663
|
@ -112,13 +112,14 @@ class PreviewCameraTwo : ViewGroup, TextureView.SurfaceTextureListener, MyPrevie
|
||||||
mDownEventAtY = event.y
|
mDownEventAtY = event.y
|
||||||
} else if (event.action == MotionEvent.ACTION_UP) {
|
} else if (event.action == MotionEvent.ACTION_UP) {
|
||||||
if (mIsFocusSupported && System.currentTimeMillis() - mDownEventAtMS < CLICK_MS &&
|
if (mIsFocusSupported && System.currentTimeMillis() - mDownEventAtMS < CLICK_MS &&
|
||||||
|
mCaptureSession != null &&
|
||||||
Math.abs(event.x - mDownEventAtX) < CLICK_DIST &&
|
Math.abs(event.x - mDownEventAtX) < CLICK_DIST &&
|
||||||
Math.abs(event.y - mDownEventAtY) < CLICK_DIST) {
|
Math.abs(event.y - mDownEventAtY) < CLICK_DIST) {
|
||||||
focusArea(event.x, event.y)
|
focusArea(event.x, event.y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mIsZoomSupported && event.pointerCount > 1) {
|
if (mIsZoomSupported && event.pointerCount > 1 && mCaptureSession != null) {
|
||||||
handleZoom(event)
|
handleZoom(event)
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
|
Loading…
Reference in New Issue