CameraListeners now must be non null

v2
Mattia Iavarone 6 years ago
parent 78dc6def63
commit 468c57cbe3
  1. 8
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java
  2. 1
      docs/_posts/2018-12-20-preview-size.md

@ -1189,11 +1189,9 @@ public class CameraView extends FrameLayout implements LifecycleObserver {
*
* @param cameraListener a listener for events.
*/
public void addCameraListener(@Nullable CameraListener cameraListener) {
if (cameraListener != null) {
public void addCameraListener(@NonNull CameraListener cameraListener) {
mListeners.add(cameraListener);
}
}
/**
@ -1201,11 +1199,9 @@ public class CameraView extends FrameLayout implements LifecycleObserver {
*
* @param cameraListener a listener for events.
*/
public void removeCameraListener(@Nullable CameraListener cameraListener) {
if (cameraListener != null) {
public void removeCameraListener(@NonNull CameraListener cameraListener) {
mListeners.remove(cameraListener);
}
}
/**

@ -86,3 +86,4 @@ After the preview size is determined, if it has changed since list time, the `Ca
another call to `onMeasure` so the `WRAP_CONTENT` magic can take place.
To understand how SizeSelectors work and the available utilities, please read the [Capture Size](capture-size.html) document.

Loading…
Cancel
Save