+
+
+
+
+
+ {% assign post_count = site.posts|size %}
+ {% if site.navigation != 0 and site.navigation == 1 or post_count > 0 %}
+
+ {% include navigation.html %}
+
+
+
+ {{ content }}
+
+ {% else %}
+
+ {{ content }}
+
+ {% endif %}
+
+
+ {% if page.disqus == 1 %}
+
+ {% if site.navigation == 1 or post_count > 0 %}
+
+
+ {% else %}
+
+ {% endif %}
+
+ {% endif %}
+
+
+
+
+
+
+
+ {% if site.google_analytics_id != "" %}
+ {% include google_analytics.html %}
+ {% endif %}
+
+
diff --git a/docs/_layouts/page.html b/docs/_layouts/page.html
new file mode 100644
index 00000000..db711745
--- /dev/null
+++ b/docs/_layouts/page.html
@@ -0,0 +1,11 @@
+---
+layout: default
+---
+
+
+
+{{ content }}
diff --git a/docs/_posts/.gitkeep b/docs/_posts/.gitkeep
new file mode 100644
index 00000000..e69de29b
diff --git a/docs/_posts/2018-12-20-camera-events.md b/docs/_posts/2018-12-20-camera-events.md
new file mode 100644
index 00000000..27077196
--- /dev/null
+++ b/docs/_posts/2018-12-20-camera-events.md
@@ -0,0 +1,78 @@
+---
+layout: page
+title: "Camera Events"
+subtitle: "Events and lifecycle"
+category: docs
+date: 2018-12-20 20:02:08
+order: 1
+---
+
+The camera engine will notify anyone about camera events that took place, either on their own or
+after developer action. To access these events, set up one or more `CameraListener` instances.
+
+All actions taken on a `CameraView` instance are asynchronous, which means that the callback can be
+executed at any time in the future. For convenience, all of them are executed on the UI thread.
+
+```java
+camera.addCameraListener(new CameraListener() {
+
+ public void onCameraOpened(CameraOptions options) {}
+
+ public void onCameraClosed() {}
+
+ public void onCameraError(CameraException error) {}
+
+ public void onPictureTaken(PictureResult result) {}
+
+ public void onVideoTaken(VideoResult result) {}
+
+ public void onOrientationChanged(int orientation) {}
+
+ public void onFocusStart(PointF point) {}
+
+ public void onFocusEnd(boolean successful, PointF point) {}
+
+ public void onZoomChanged(float newValue, float[] bounds, PointF[] fingers) {}
+
+ public void onExposureCorrectionChanged(float newValue, float[] bounds, PointF[] fingers) {}
+});
+```
+
+### Lifecycle
+
+CameraView has its own lifecycle, which is basically made of an open and a closed state.
+You will listen to these events using `onCameraOpened` and `onCameraClosed` callbacks:
+
+```java
+camera.addCameraListener(new CameraListener() {
+
+ /**
+ * Notifies that the camera was opened.
+ * The options object collects all supported options by the current camera.
+ */
+ @Override
+ public void onCameraOpened(CameraOptions options) {}
+
+ /**
+ * Notifies that the camera session was closed.
+ */
+ @Override
+ public void onCameraClosed() {}
+
+});
+```
+
+The open callback is especially important because the `CameraOptions` includes all the available
+options of the current sensor. This can be used to adjust the UI, for example, show a flash icon
+if flash is supported.
+
+### Related APIs
+
+|Method|Description|
+|------|-----------|
+|`open()`|Starts the engine. This will cause a future call to `onCameraOpened()` (or an error)|
+|`close()`|Stops the engine. This will cause a future call to `onCameraClosed()`|
+|`isOpened()`|Returns true if `open()` was called successfully. This does not mean that camera is showing preview already.|
+|`getCameraOptions()`|If camera was opened, returns non-null object with information about what is supported.|
+
+Take a look at public methods in `CameraOptions` to know more.
diff --git a/docs/_posts/2018-12-20-capture-size.md b/docs/_posts/2018-12-20-capture-size.md
new file mode 100644
index 00000000..0d8d5b30
--- /dev/null
+++ b/docs/_posts/2018-12-20-capture-size.md
@@ -0,0 +1,105 @@
+---
+layout: page
+title: "Capture Size"
+subtitle: "Set size of output media"
+category: docs
+order: 8
+date: 2018-12-20 22:07:22
+---
+
+If you are planning to use the snapshot APIs, the size of the media output is that of the preview,
+accounting for any cropping made when [measuring the view](preview-size.html).
+If you are planning to use the standard APIs for capturing, then what follows applies.
+
+### Controlling Size
+
+Size is controlled using `setPictureSize` and `setVideoSize` for, respectively, picture and video
+output. These method will accept a `SizeSelector`. The point of a `SizeSelector` is to analyze the
+available sizes that the sensor offers, and choose the ones it prefers.
+
+```java
+// This will be the size of pictures taken with takePicture().
+cameraView.setPictureSize(new SizeSelector() {
+ @Override
+ public List