|
|
|
@ -48,6 +48,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
|
|
|
|
|
|
public final static int PERMISSION_REQUEST_CODE = 16; |
|
|
|
|
|
|
|
|
|
final static long DEFAULT_AUTOFOCUS_RESET_DELAY_MILLIS = 3000; |
|
|
|
|
final static boolean DEFAULT_PLAY_SOUNDS = true; |
|
|
|
|
|
|
|
|
|
// Self managed parameters
|
|
|
|
@ -113,6 +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.getInteger(R.styleable.CameraView_cameraAutoFocusResetDelay, (int) DEFAULT_AUTOFOCUS_RESET_DELAY_MILLIS); |
|
|
|
|
|
|
|
|
|
// Picture size selector
|
|
|
|
|
List<SizeSelector> pictureConstraints = new ArrayList<>(3); |
|
|
|
@ -219,6 +221,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
|
setVideoMaxSize(videoMaxSize); |
|
|
|
|
setVideoMaxDuration(videoMaxDuration); |
|
|
|
|
setVideoBitRate(videoBitRate); |
|
|
|
|
setAutoFocusResetDelay(autoFocusResetDelay); |
|
|
|
|
|
|
|
|
|
// Apply gestures
|
|
|
|
|
mapGesture(Gesture.TAP, tapGesture); |
|
|
|
@ -1049,6 +1052,24 @@ public class CameraView extends FrameLayout implements LifecycleObserver { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sets the current delay in milliseconds to reset the focus after an autofocus process. |
|
|
|
|
* |
|
|
|
|
* @param delayMillis desired delay (in milliseconds). If the delay |
|
|
|
|
* is less than or equal to 0 or equal to Long.MAX_VALUE, |
|
|
|
|
* the autofocus will not be reset. |
|
|
|
|
*/ |
|
|
|
|
public void setAutoFocusResetDelay(long delayMillis) { |
|
|
|
|
mCameraController.setAutoFocusResetDelay(delayMillis); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the current delay in milliseconds to reset the focus after an autofocus process. |
|
|
|
|
* @return the current autofocus reset delay in milliseconds. |
|
|
|
|
*/ |
|
|
|
|
public long getAutoFocusResetDelay() { return mCameraController.getAutoFocusResetDelay(); } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Starts an autofocus process at the given coordinates, with respect |
|
|
|
|
* to the view width and height. |
|
|
|
|