private void startAutofocus() { if (isHaveAutoFocus()) { autoFocusHandler.postDelayed(runAutoFocus, AUTOFOCUS_REFRESH_DELAY); cameraView.getCamera().autoFocus(autoFocusCallback); } }
private void stopAutofocus() { if (isHaveAutoFocus() && cameraView.getCamera() != null) { autoFocusHandler.removeCallbacks(runAutoFocus); cameraView.getCamera().cancelAutoFocus(); } }