Package 

Class CameraListener

    • Method Summary

      Modifier and Type Method Description
      void onCameraOpened(@NonNull() CameraOptions options) Notifies that the camera was opened.
      void onCameraClosed() Notifies that the camera session was closed.
      void onCameraError(@NonNull() CameraException exception) Notifies about an error during the camera setup or configuration.
      void onPictureTaken(@NonNull() PictureResult result) Notifies that a picture previously captured with takePicture or takePictureSnapshot is ready to be shown or saved to file.
      void onVideoTaken(@NonNull() VideoResult result) Notifies that a video capture has just ended.
      void onOrientationChanged(int orientation) Notifies that the device was tilted or the window offset changed.The orientation passed is exactly the counter-clockwise rotation that a View should have,in order to appear correctly oriented to the user, considering the way she isholding the device, and the native activity orientation.This is meant to be used for aligning views (e.g.
      void onAutoFocusStart(@NonNull() PointF point) Notifies that user interacted with the screen and started metering with a gesture,and touch metering routine is trying to focus around that area.This callback can be used to draw things on screen.
      void onAutoFocusEnd(boolean successful, @NonNull() PointF point) Notifies that a touch metering event just ended, and the camera convergedto a new focus, exposure and possibly white balance.This might succeed or not.
      void onZoomChanged(float newValue, @NonNull() Array<float> bounds, @Nullable() Array<PointF> fingers) Notifies that a finger gesture just caused the camera zoomto be changed.
      void onExposureCorrectionChanged(float newValue, @NonNull() Array<float> bounds, @Nullable() Array<PointF> fingers) Noitifies that a finger gesture just caused the camera exposure correctionto be changed.
      void onVideoRecordingStart() Notifies that the actual video recording has started.This is the time when actual frames recording starts.This can be used to show some UI indicator for video recording or counting time.
      void onVideoRecordingEnd() Notifies that the actual video recording has ended.At this point recording has ended, though the file might still be processed.
      void onPictureShutter() Notifies that the picture capture has started.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onCameraError

        @UiThread() void onCameraError(@NonNull() CameraException exception)

        Notifies about an error during the camera setup or configuration.At this point you should inspect the CameraException reason using getReason and see what should be done, if anything.If the error is unrecoverable, this is the right moment to show an error dialog, for example.

        Parameters:
        exception - the error
      • onOrientationChanged

        @UiThread() void onOrientationChanged(int orientation)

        Notifies that the device was tilted or the window offset changed.The orientation passed is exactly the counter-clockwise rotation that a View should have,in order to appear correctly oriented to the user, considering the way she isholding the device, and the native activity orientation.This is meant to be used for aligning views (e.g. buttons) to the current camera viewport.

        Parameters:
        orientation - either 0, 90, 180 or 270
      • onAutoFocusStart

        @UiThread() void onAutoFocusStart(@NonNull() PointF point)

        Notifies that user interacted with the screen and started metering with a gesture,and touch metering routine is trying to focus around that area.This callback can be used to draw things on screen.Can also be triggered by startAutoFocus.

        Parameters:
        point - coordinates with respect to CameraView.getWidth() and CameraView.
      • onAutoFocusEnd

        @UiThread() void onAutoFocusEnd(boolean successful, @NonNull() PointF point)

        Notifies that a touch metering event just ended, and the camera convergedto a new focus, exposure and possibly white balance.This might succeed or not.Can also be triggered by startAutoFocus.

        Parameters:
        successful - whether metering succeeded
        point - coordinates with respect to CameraView.getWidth() and CameraView.
      • onZoomChanged

        @UiThread() void onZoomChanged(float newValue, @NonNull() Array<float> bounds, @Nullable() Array<PointF> fingers)

        Notifies that a finger gesture just caused the camera zoomto be changed. This can be used to draw, for example, a seek bar.

        Parameters:
        newValue - the new zoom value
        bounds - min and max bounds for newValue (fixed to 0 ...
        fingers - finger positions that caused the event, null if not caused by touch
      • onExposureCorrectionChanged

        @UiThread() void onExposureCorrectionChanged(float newValue, @NonNull() Array<float> bounds, @Nullable() Array<PointF> fingers)

        Noitifies that a finger gesture just caused the camera exposure correctionto be changed. This can be used to draw, for example, a seek bar.

        Parameters:
        newValue - the new correction value
        bounds - min and max bounds for newValue, as returned by CameraOptions
        fingers - finger positions that caused the event, null if not caused by touch
      • onVideoRecordingStart

        @UiThread() void onVideoRecordingStart()

        Notifies that the actual video recording has started.This is the time when actual frames recording starts.This can be used to show some UI indicator for video recording or counting time.

      • onVideoRecordingEnd

        @UiThread() void onVideoRecordingEnd()

        Notifies that the actual video recording has ended.At this point recording has ended, though the file might still be processed.The onVideoTaken callback will be called soon.This can be used to remove UI indicators for video recording.

      • onPictureShutter

        @UiThread() void onPictureShutter()

        Notifies that the picture capture has started. Can be used to update the UI for visualconfirmation or sound effects.