diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java index 555fa336..027e4a5d 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java @@ -72,7 +72,7 @@ abstract class CameraController implements protected Size mCaptureSize; protected Size mPreviewStreamSize; protected int mPreviewFormat; - protected long mAutoFocusResetDelayMillis = CameraView.DEFAULT_AUTOFOCUS_RESET_DELAY_MILLIS; + protected long mAutoFocusResetDelayMillis; protected int mSensorOffset; private int mDisplayOffset; diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java index 5c796e02..35317995 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java @@ -47,8 +47,8 @@ public class CameraView extends FrameLayout implements LifecycleObserver { private static final CameraLogger LOG = CameraLogger.create(TAG); public final static int PERMISSION_REQUEST_CODE = 16; - public final static long DEFAULT_AUTOFOCUS_RESET_DELAY_MILLIS = 3000; + final static long DEFAULT_AUTOFOCUS_RESET_DELAY_MILLIS = 3000; final static boolean DEFAULT_PLAY_SOUNDS = true; // Self managed parameters @@ -114,7 +114,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver { int videoMaxDuration = a.getInteger(R.styleable.CameraView_cameraVideoMaxDuration, 0); int videoBitRate = a.getInteger(R.styleable.CameraView_cameraVideoBitRate, 0); int audioBitRate = a.getInteger(R.styleable.CameraView_cameraAudioBitRate, 0); - long autoFocusResetDelay = (long) a.getFloat(R.styleable.CameraView_cameraAutoFocusResetDelay, DEFAULT_AUTOFOCUS_RESET_DELAY_MILLIS); + long autoFocusResetDelay = (long) a.getInteger(R.styleable.CameraView_cameraAutoFocusResetDelay, (int) DEFAULT_AUTOFOCUS_RESET_DELAY_MILLIS); // Picture size selector List pictureConstraints = new ArrayList<>(3); diff --git a/cameraview/src/main/res/values/attrs.xml b/cameraview/src/main/res/values/attrs.xml index 7fa4dd0f..c687a7d0 100644 --- a/cameraview/src/main/res/values/attrs.xml +++ b/cameraview/src/main/res/values/attrs.xml @@ -124,7 +124,7 @@ - + \ No newline at end of file diff --git a/docs/_posts/2018-12-20-more-features.md b/docs/_posts/2018-12-20-more-features.md index 3252699a..0cbc969e 100644 --- a/docs/_posts/2018-12-20-more-features.md +++ b/docs/_posts/2018-12-20-more-features.md @@ -65,10 +65,10 @@ This is useful for low end devices that have slow auto-focus capabilities. Defaults to 3 seconds. ```java -cameraView.cameraAutoFocusResetDelay(1000); // 1 second -cameraView.cameraAutoFocusResetDelay(0); // NO reset -cameraView.cameraAutoFocusResetDelay(-1); // NO reset -cameraView.cameraAutoFocusResetDelay(Long.MAX_VALUE); // NO reset +cameraView.setCameraAutoFocusResetDelay(1000); // 1 second +cameraView.setCameraAutoFocusResetDelay(0); // NO reset +cameraView.setCameraAutoFocusResetDelay(-1); // NO reset +cameraView.setCameraAutoFocusResetDelay(Long.MAX_VALUE); // NO reset ### UI Orientation