Pull Request cleanup (#16): Reinstated old interval autofocus bahaviour on Android API Level < 14 (plus minor blank line formatting)

This commit is contained in:
TJ Woon 2015-04-19 23:58:45 +08:00
parent fc6e2ff07c
commit a70a9bcb03

View File

@ -253,6 +253,7 @@ implements SurfaceHolder.Callback {
} }
// Continuously auto-focus ----------------------------------------- // Continuously auto-focus -----------------------------------------
// For API Level < 14
private AutoFocusCallback autoFocusCb = new AutoFocusCallback() private AutoFocusCallback autoFocusCb = new AutoFocusCallback()
{ {
@ -385,11 +386,14 @@ implements SurfaceHolder.Callback {
camera.setPreviewDisplay(holder); camera.setPreviewDisplay(holder);
camera.setPreviewCallback(previewCb); camera.setPreviewCallback(previewCb);
camera.startPreview(); camera.startPreview();
//camera.autoFocus(autoFocusCb); // We are not using any of the
// continuous autofocus modes as that does not seem to work if (android.os.Build.VERSION.SDK_INT >= 14) {
// well with flash setting of "on"... At least with this camera.autoFocus(autoFocusCb); // We are not using any of the
// simple and stupid focus method, we get to turn the flash // continuous autofocus modes as that does not seem to work
// on during autofocus. // well with flash setting of "on"... At least with this
// simple and stupid focus method, we get to turn the flash
// on during autofocus.
}
} catch (IOException e) { } catch (IOException e) {
die("Could not start camera preview: " + e.getMessage()); die("Could not start camera preview: " + e.getMessage());
} }