Improve supports() shorthands

pull/13/head
Mattia Iavarone 8 years ago
parent d8e95f9e69
commit b5cf4d01ca
  1. 24
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java

@ -132,6 +132,30 @@ public class CameraOptions {
}
/**
* Shorthand for other methods in this class,
* e.g. supports(GestureAction.ZOOM) == isZoomSupported().
*
* @param action value to be checked
* @return whether it's supported
*/
public boolean supports(GestureAction action) {
switch (action) {
case FOCUS:
case FOCUS_WITH_MARKER:
return isAutoFocusSupported();
case CAPTURE:
case NONE:
return true;
case ZOOM:
return isZoomSupported();
case EXPOSURE_CORRECTION:
return isExposureCorrectionSupported();
}
return false;
}
/**
* Set of supported facing values.
*

Loading…
Cancel
Save