cameraview icon indicating copy to clipboard operation
cameraview copied to clipboard

autoFocus is lost after switching camera facing

Open siralam opened this issue 7 years ago • 1 comments

OMG... How come such an apparent bug.

In updateAutoFocus(), mAutoFocus is set to false if the camera does not support autoFocus.

So: (1) mAutoFocus is now true (2) Switch to front camera, which does not support auto focus (3) mAutoFocus is now false (4) Switch back to back camera (5) in updateAutoFocus, since mAutoFocus is false, the camera is directly set to not auto focus.

The best approach to solve this problem is to separate autoFocus from setting, and whether we need to auto focus now.

siralam avatar Dec 13 '17 03:12 siralam

For those who want to solve this problem, you may take a look at my commits. Just 4 lines of code to change in total:

https://github.com/siralam/CameraViewPlus/commit/8890f5f9e84a77c63122649fac16b3150509113b

https://github.com/siralam/CameraViewPlus/commit/5e1d4a83681a3cf689982c943358cea0f6dee59b

siralam avatar Dec 13 '17 03:12 siralam