Javadocs for gestures

pull/1/head
Mattia Iavarone 7 years ago
parent 2227210a78
commit b7f2152fc5
  1. 1
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java
  2. 38
      cameraview/src/main/java/com/otaliastudios/cameraview/Gesture.java

@ -39,7 +39,6 @@ import static android.view.View.MeasureSpec.UNSPECIFIED;
import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
/**
* TODO: docs for gestures
* TODO: README for gestures
* TODO: deprecate setFocus, CONTINUOUS should be the default
*

@ -6,13 +6,51 @@ import java.util.List;
import static com.otaliastudios.cameraview.CameraConstants.*;
/**
* Gestures listen to finger gestures over the {@link CameraView} bounds and can be mapped
* to one or more camera controls using XML attributes or {@link CameraView#mapGesture(Gesture, int)}.
*
* Not every gesture can control a certain action. For example, pinch gestures can only control
* continuous values, such as zoom or AE correction. Single point gestures, on the other hand,
* can only control point actions such as focusing or capturing a picture.
*/
public enum Gesture {
/**
* Pinch gesture, typically assigned to the zoom control.
* This gesture can be mapped to:
*
* - {@link CameraConstants#GESTURE_ACTION_ZOOM}
* - {@link CameraConstants#GESTURE_ACTION_AE_CORRECTION}
* - {@link CameraConstants#GESTURE_ACTION_NONE}
*/
PINCH(GESTURE_ACTION_ZOOM, GESTURE_ACTION_AE_CORRECTION),
/**
* Single tap gesture, typically assigned to the focus control.
* This gesture can be mapped to:
*
* - {@link CameraConstants#GESTURE_ACTION_FOCUS}
* - {@link CameraConstants#GESTURE_ACTION_FOCUS_WITH_MARKER}
* - {@link CameraConstants#GESTURE_ACTION_CAPTURE}
* - {@link CameraConstants#GESTURE_ACTION_NONE}
*/
TAP(GESTURE_ACTION_FOCUS, GESTURE_ACTION_FOCUS_WITH_MARKER, GESTURE_ACTION_CAPTURE),
// DOUBLE_TAP(GESTURE_ACTION_FOCUS, GESTURE_ACTION_FOCUS_WITH_MARKER, GESTURE_ACTION_CAPTURE),
/**
* Long tap gesture.
* This gesture can be mapped to:
*
* - {@link CameraConstants#GESTURE_ACTION_FOCUS}
* - {@link CameraConstants#GESTURE_ACTION_FOCUS_WITH_MARKER}
* - {@link CameraConstants#GESTURE_ACTION_CAPTURE}
* - {@link CameraConstants#GESTURE_ACTION_NONE}
*/
LONG_TAP(GESTURE_ACTION_FOCUS, GESTURE_ACTION_FOCUS_WITH_MARKER, GESTURE_ACTION_CAPTURE);
Gesture(@GestureAction Integer... controls) {
mControls = Arrays.asList(controls);
}

Loading…
Cancel
Save