From d7a593e07006058073871b6ea2b3aefba1f706ca Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Sat, 22 Dec 2018 19:13:20 +0100 Subject: [PATCH] CameraListeners now must be non null --- .../com/otaliastudios/cameraview/CameraView.java | 12 ++++-------- docs/_posts/2018-12-20-preview-size.md | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java index 39582b37..cb41d077 100644 --- a/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java +++ b/cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java @@ -1189,10 +1189,8 @@ public class CameraView extends FrameLayout implements LifecycleObserver { * * @param cameraListener a listener for events. */ - public void addCameraListener(@Nullable CameraListener cameraListener) { - if (cameraListener != null) { - mListeners.add(cameraListener); - } + public void addCameraListener(@NonNull CameraListener cameraListener) { + mListeners.add(cameraListener); } @@ -1201,10 +1199,8 @@ public class CameraView extends FrameLayout implements LifecycleObserver { * * @param cameraListener a listener for events. */ - public void removeCameraListener(@Nullable CameraListener cameraListener) { - if (cameraListener != null) { - mListeners.remove(cameraListener); - } + public void removeCameraListener(@NonNull CameraListener cameraListener) { + mListeners.remove(cameraListener); } diff --git a/docs/_posts/2018-12-20-preview-size.md b/docs/_posts/2018-12-20-preview-size.md index a81fdce9..4573f591 100644 --- a/docs/_posts/2018-12-20-preview-size.md +++ b/docs/_posts/2018-12-20-preview-size.md @@ -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. +