Better conformance to existing standards and conventions

pull/435/head
Craig Neuwirt 6 years ago
parent 315784df5c
commit f869699944
  1. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraController.java
  2. 4
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java
  3. 2
      cameraview/src/main/res/values/attrs.xml
  4. 8
      docs/_posts/2018-12-20-more-features.md

@ -72,7 +72,7 @@ abstract class CameraController implements
protected Size mCaptureSize; protected Size mCaptureSize;
protected Size mPreviewStreamSize; protected Size mPreviewStreamSize;
protected int mPreviewFormat; protected int mPreviewFormat;
protected long mAutoFocusResetDelayMillis = CameraView.DEFAULT_AUTOFOCUS_RESET_DELAY_MILLIS; protected long mAutoFocusResetDelayMillis;
protected int mSensorOffset; protected int mSensorOffset;
private int mDisplayOffset; private int mDisplayOffset;

@ -47,8 +47,8 @@ public class CameraView extends FrameLayout implements LifecycleObserver {
private static final CameraLogger LOG = CameraLogger.create(TAG); private static final CameraLogger LOG = CameraLogger.create(TAG);
public final static int PERMISSION_REQUEST_CODE = 16; 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; final static boolean DEFAULT_PLAY_SOUNDS = true;
// Self managed parameters // Self managed parameters
@ -114,7 +114,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver {
int videoMaxDuration = a.getInteger(R.styleable.CameraView_cameraVideoMaxDuration, 0); int videoMaxDuration = a.getInteger(R.styleable.CameraView_cameraVideoMaxDuration, 0);
int videoBitRate = a.getInteger(R.styleable.CameraView_cameraVideoBitRate, 0); int videoBitRate = a.getInteger(R.styleable.CameraView_cameraVideoBitRate, 0);
int audioBitRate = a.getInteger(R.styleable.CameraView_cameraAudioBitRate, 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 // Picture size selector
List<SizeSelector> pictureConstraints = new ArrayList<>(3); List<SizeSelector> pictureConstraints = new ArrayList<>(3);

@ -124,7 +124,7 @@
<attr name="cameraExperimental" format="boolean" /> <attr name="cameraExperimental" format="boolean" />
<attr name="cameraAutoFocusResetDelay" format="float"/> <attr name="cameraAutoFocusResetDelay" format="integer|reference"/>
</declare-styleable> </declare-styleable>
</resources> </resources>

@ -65,10 +65,10 @@ This is useful for low end devices that have slow auto-focus capabilities.
Defaults to 3 seconds. Defaults to 3 seconds.
```java ```java
cameraView.cameraAutoFocusResetDelay(1000); // 1 second cameraView.setCameraAutoFocusResetDelay(1000); // 1 second
cameraView.cameraAutoFocusResetDelay(0); // NO reset cameraView.setCameraAutoFocusResetDelay(0); // NO reset
cameraView.cameraAutoFocusResetDelay(-1); // NO reset cameraView.setCameraAutoFocusResetDelay(-1); // NO reset
cameraView.cameraAutoFocusResetDelay(Long.MAX_VALUE); // NO reset cameraView.setCameraAutoFocusResetDelay(Long.MAX_VALUE); // NO reset
### UI Orientation ### UI Orientation

Loading…
Cancel
Save