Pull Request cleanup (#16): Reinstated old interval autofocus bahaviour on Android API Level < 14 (plus minor blank line formatting)
This commit is contained in:
parent
fc6e2ff07c
commit
a70a9bcb03
@ -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
|
|
||||||
|
if (android.os.Build.VERSION.SDK_INT >= 14) {
|
||||||
|
camera.autoFocus(autoFocusCb); // We are not using any of the
|
||||||
// continuous autofocus modes as that does not seem to work
|
// continuous autofocus modes as that does not seem to work
|
||||||
// well with flash setting of "on"... At least with this
|
// well with flash setting of "on"... At least with this
|
||||||
// simple and stupid focus method, we get to turn the flash
|
// simple and stupid focus method, we get to turn the flash
|
||||||
// on during autofocus.
|
// 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());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user