Merge branch '346-some-cameras-can-t-focus-on-qr-codes' into 'master'

Set focus mode properly when scanning QR codes

This simple fix contributed by @m8r-v9bo74 fixed the issue on my Xperia
Pro that could never focus on the QR code before. Focusing and scanning
still works on my other test devices.

Closes #346

See merge request !243
This commit is contained in:
Ernir Erlingsson
2016-07-12 08:37:48 +00:00

View File

@@ -159,7 +159,8 @@ public class CameraView extends SurfaceView implements SurfaceHolder.Callback,
if (sceneModes.contains(SCENE_MODE_BARCODE)) {
LOG.info("Setting scene mode to barcode");
params.setSceneMode(SCENE_MODE_BARCODE);
} else if (Build.VERSION.SDK_INT >= 14 &&
}
if (Build.VERSION.SDK_INT >= 14 &&
focusModes.contains(FOCUS_MODE_CONTINUOUS_PICTURE)) {
LOG.info("Setting focus mode to continuous picture");
params.setFocusMode(FOCUS_MODE_CONTINUOUS_PICTURE);