Remove DisableOverlayFor

pull/502/head
Mattia Iavarone 6 years ago
parent c7edfe9408
commit a577fbe653
  1. 23
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java
  2. 57
      cameraview/src/main/java/com/otaliastudios/cameraview/DisableOverlayFor.java

@ -55,7 +55,6 @@ public class CameraOptions {
private Set<Size> supportedVideoSizes = new HashSet<>(5);
private Set<AspectRatio> supportedPictureAspectRatio = new HashSet<>(4);
private Set<AspectRatio> supportedVideoAspectRatio = new HashSet<>(3);
private Set<DisableOverlayFor> supportedDisableOverlayFor = new HashSet<>(3);
private boolean zoomSupported;
private boolean exposureCorrectionSupported;
@ -148,12 +147,6 @@ public class CameraOptions {
supportedVideoAspectRatio.add(AspectRatio.of(width, height));
}
}
// Disable overlay for
supportedDisableOverlayFor.add(DisableOverlayFor.NONE);
supportedDisableOverlayFor.add(DisableOverlayFor.PICTURE);
supportedDisableOverlayFor.add(DisableOverlayFor.VIDEO);
}
// Camera2Engine constructor.
@ -319,8 +312,6 @@ public class CameraOptions {
return (Collection<T>) Arrays.asList(Engine.values());
} else if (controlClass.equals(Preview.class)) {
return (Collection<T>) Arrays.asList(Preview.values());
} else if (controlClass.equals(DisableOverlayFor.class)) {
return (Collection<T>) getSupportedDisableOverlayFor();
}
// Unrecognized control.
return Collections.emptyList();
@ -495,18 +486,4 @@ public class CameraOptions {
public float getExposureCorrectionMaxValue() {
return exposureCorrectionMaxValue;
}
/**
* Set of supported mode values for which the overlay can be disabled.
*
* @see DisableOverlayFor#NONE
* @see DisableOverlayFor#PICTURE
* @see DisableOverlayFor#VIDEO
* @return a collection of supported values.
*/
@SuppressWarnings("WeakerAccess")
@NonNull
public Collection<DisableOverlayFor> getSupportedDisableOverlayFor() {
return Collections.unmodifiableSet(supportedDisableOverlayFor);
}
}

@ -1,57 +0,0 @@
package com.otaliastudios.cameraview;
import androidx.annotation.Nullable;
import com.otaliastudios.cameraview.controls.Control;
/**
* DisableOverlayFor value allow the user to prevent the overlay from being recorded.
*
* @see CameraView#setDisableOverlayFor(DisableOverlayFor)
*/
public enum DisableOverlayFor implements Control {
/**
* Record the overlay both in picture and video snapshots.
*/
NONE(0),
/**
* The picture snapshots will not contain the overlay.
*
* @see CameraOptions#getSupportedDisableOverlayFor()
*/
PICTURE(1),
/**
* The picture snapshots will not contain the overlay.
*
* @see CameraOptions#getSupportedDisableOverlayFor()
*/
VIDEO(2);
static final DisableOverlayFor DEFAULT = NONE;
private int value;
DisableOverlayFor(int value) {
this.value = value;
}
int value() {
return value;
}
@Nullable
static DisableOverlayFor fromValue(int value) {
DisableOverlayFor[] list = DisableOverlayFor.values();
for (DisableOverlayFor action : list) {
if (action.value() == value) {
return action;
}
}
return null;
}
}
Loading…
Cancel
Save