public abstract class CameraListener
extends java.lang.Object
| Constructor and Description |
|---|
CameraListener() |
| Modifier and Type | Method and Description |
|---|---|
void |
onCameraClosed()
Notifies that the camera session was closed.
|
void |
onCameraError(CameraException exception)
Notifies about an error during the camera setup or configuration.
|
void |
onCameraOpened(CameraOptions options)
Notifies that the camera was opened.
|
void |
onExposureCorrectionChanged(float newValue,
float[] bounds,
android.graphics.PointF[] fingers)
Noitifies that a finger gesture just caused the camera exposure correction
to be changed.
|
void |
onFocusEnd(boolean successful,
android.graphics.PointF point)
Notifies that a gesture focus event just ended, and the camera converged
to a new focus (and possibly exposure and white balance).
|
void |
onFocusStart(android.graphics.PointF point)
Notifies that user interacted with the screen and started focus with a gesture,
and the autofocus is trying to focus around that area.
|
void |
onOrientationChanged(int orientation)
Notifies that the device was tilted or the window offset changed.
|
void |
onPictureTaken(byte[] jpeg)
Notifies that a picture previously captured with
CameraView.capturePicture()
or CameraView.captureSnapshot() is ready to be shown or saved. |
void |
onVideoTaken(java.io.File video)
Notifies that a video capture has just ended.
|
void |
onZoomChanged(float newValue,
float[] bounds,
android.graphics.PointF[] fingers)
Noitifies that a finger gesture just caused the camera zoom
to be changed.
|
@UiThread public void onCameraOpened(CameraOptions options)
CameraOptions object collects all supported options by the current camera.options - camera supported options@UiThread public void onCameraClosed()
@UiThread
public void onCameraError(@NonNull
CameraException exception)
CameraException instance.exception - the error@UiThread public void onPictureTaken(byte[] jpeg)
CameraView.capturePicture()
or CameraView.captureSnapshot() is ready to be shown or saved.
If planning to get a bitmap, you can use CameraUtils.decodeBitmap(byte[], CameraUtils.BitmapCallback)
to decode the byte array taking care about orientation.jpeg - captured picture@UiThread public void onVideoTaken(java.io.File video)
CameraView.startCapturingVideo(File), if any.
If not, the camera fallsback to:
new File(getContext().getExternalFilesDir(null), "video.mp4");
video - file hosting the mp4 video@UiThread public void onOrientationChanged(int orientation)
orientation - either 0, 90, 180 or 270@UiThread public void onFocusStart(android.graphics.PointF point)
CameraView.startAutoFocus(float, float).point - coordinates with respect to CameraView.getWidth() and CameraView.getHeight()@UiThread
public void onFocusEnd(boolean successful,
android.graphics.PointF point)
CameraView.startAutoFocus(float, float).successful - whether camera succeededpoint - coordinates with respect to CameraView.getWidth() and CameraView.getHeight()@UiThread
public void onZoomChanged(float newValue,
float[] bounds,
android.graphics.PointF[] fingers)
newValue - the new zoom valuebounds - min and max bounds for newValue (fixed to 0 ... 1)fingers - finger positions that caused the event@UiThread
public void onExposureCorrectionChanged(float newValue,
float[] bounds,
android.graphics.PointF[] fingers)
newValue - the new correction valuebounds - min and max bounds for newValue, as returned by CameraOptionsfingers - finger positions that caused the event