Update docs

pull/484/head
Mattia Iavarone 6 years ago
parent 1ff2525608
commit f45cdaea19
  1. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraOptions.java
  2. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java
  3. 4
      cameraview/src/main/java/com/otaliastudios/cameraview/gesture/Gesture.java
  4. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/gesture/GestureAction.java
  5. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/markers/AutoFocusTrigger.java
  6. 2
      demo/src/main/java/com/otaliastudios/cameraview/demo/Control.java
  7. 12
      docs/_posts/2018-12-20-gestures.md
  8. 18
      docs/_posts/2018-12-20-more-features.md

@ -150,7 +150,7 @@ public class CameraOptions {
*/
public boolean supports(@NonNull GestureAction action) {
switch (action) {
case AUTOFOCUS:
case AUTO_FOCUS:
return isAutoFocusSupported();
case TAKE_PICTURE:
case NONE:

@ -543,7 +543,7 @@ public class CameraView extends FrameLayout implements LifecycleObserver {
takePicture();
break;
case AUTOFOCUS:
case AUTO_FOCUS:
mCameraEngine.startAutoFocus(gesture, points[0]);
break;

@ -30,7 +30,7 @@ public enum Gesture {
* Single tap gesture, typically assigned to the focus control.
* This gesture can be mapped to one shot actions:
*
* - {@link GestureAction#AUTOFOCUS}
* - {@link GestureAction#AUTO_FOCUS}
* - {@link GestureAction#TAKE_PICTURE}
* - {@link GestureAction#NONE}
*/
@ -40,7 +40,7 @@ public enum Gesture {
* Long tap gesture.
* This gesture can be mapped to one shot actions:
*
* - {@link GestureAction#AUTOFOCUS}
* - {@link GestureAction#AUTO_FOCUS}
* - {@link GestureAction#TAKE_PICTURE}
* - {@link GestureAction#NONE}
*/

@ -31,7 +31,7 @@ public enum GestureAction {
*
* To control marker drawing, please see {@link CameraView#setAutoFocusMarker(AutoFocusMarker)}
*/
AUTOFOCUS(1, GestureType.ONE_SHOT),
AUTO_FOCUS(1, GestureType.ONE_SHOT),
/**
* When triggered, this action will fire a picture shoot.

@ -9,7 +9,7 @@ import com.otaliastudios.cameraview.gesture.GestureAction;
public enum AutoFocusTrigger {
/**
* Autofocus was triggered by {@link GestureAction#AUTOFOCUS}.
* Autofocus was triggered by {@link GestureAction#AUTO_FOCUS}.
*/
GESTURE,

@ -101,7 +101,7 @@ public enum Control {
ArrayList<GestureAction> list2 = new ArrayList<>();
addIfSupported(options, list2, GestureAction.NONE);
addIfSupported(options, list2, GestureAction.TAKE_PICTURE);
addIfSupported(options, list2, GestureAction.AUTOFOCUS);
addIfSupported(options, list2, GestureAction.AUTO_FOCUS);
return list2;
case GRID_COLOR:
ArrayList<GridColor> list3 = new ArrayList<>();

@ -15,8 +15,8 @@ This lets you emulate typical behaviors in a single line:
```java
cameraView.mapGesture(Gesture.PINCH, GestureAction.ZOOM); // Pinch to zoom!
cameraView.mapGesture(Gesture.TAP, GestureAction.FOCUS_WITH_MARKER); // Tap to focus!
cameraView.mapGesture(Gesture.LONG_TAP, GestureAction.CAPTURE); // Long tap to shoot!
cameraView.mapGesture(Gesture.TAP, GestureAction.AUTO_FOCUS); // Tap to focus!
cameraView.mapGesture(Gesture.LONG_TAP, GestureAction.TAKE_PICTURE); // Long tap to shoot!
```
Simple as that. There are two things to be noted:
@ -27,8 +27,8 @@ Simple as that. There are two things to be noted:
|Gesture|Description|Can be mapped to|
|-------------|-----------|----------------|
|`PINCH`|Pinch gesture, typically assigned to the zoom control.|`zoom` `exposureCorrection` `none`|
|`TAP`|Single tap gesture, typically assigned to the focus control.|`focus` `focusWithMarker` `capture` `none`|
|`LONG_TAP`|Long tap gesture.|`focus` `focusWithMarker` `capture` `none`|
|`TAP`|Single tap gesture, typically assigned to the focus control.|`autoFocus` `takePicture` `none`|
|`LONG_TAP`|Long tap gesture.|`autoFocus` `takePicture` `none`|
|`SCROLL_HORIZONTAL`|Horizontal movement gesture.|`zoom` `exposureCorrection` `none`|
|`SCROLL_VERTICAL`|Vertical movement gesture.|`zoom` `exposureCorrection` `none`|
@ -37,8 +37,8 @@ Simple as that. There are two things to be noted:
```xml
<com.otaliastudios.cameraview.CameraView
app:cameraGesturePinch="zoom|exposureCorrection|none"
app:cameraGestureTap="focus|focusWithMarker|capture|none"
app:cameraGestureLongTap="focus|focusWithMarker|capture|none"
app:cameraGestureTap="autoFocus|takePicture|none"
app:cameraGestureLongTap="autoFocus|takePicture|none"
app:cameraGestureScrollHorizontal="zoom|exposureCorrection|none"
app:cameraGestureScrollVertical="zoom|exposureCorrection|none"/>
```

@ -57,6 +57,24 @@ cameraView.setGridColor(Color.WHITE);
cameraView.setGridColor(Color.BLACK);
```
##### cameraAutoFocusMarker
Lets you set a marker for drawing on screen in response to auto focus events.
In XML, you should pass the qualified class name of your marker.
```java
cameraView.setAutoFocusMarker(null);
cameraView.setAutoFocusMarker(marker);
```
We offer a default marker (similar to the old `focusWithMarker` attribute in v1),
which you can set in XML using the `@string/cameraview_default_autofocus_marker` resource,
or programmatically:
```java
cameraView.setAutoFocusMarker(new DefaultAutoFocusMarker());
```
##### cameraAutoFocusResetDelay
Lets you control how an auto-focus operation is reset after completed.

Loading…
Cancel
Save