diff --git a/README.md b/README.md index 149a895c..ec2b818d 100644 --- a/README.md +++ b/README.md @@ -2,724 +2,37 @@ [![Code Coverage](https://codecov.io/gh/natario1/CameraView/branch/master/graph/badge.svg)](https://codecov.io/gh/natario1/CameraView)
- +
# CameraView CameraView is a well documented, high-level library that makes capturing pictures and videos easy, addressing most of the common issues and needs, and still leaving you with flexibility where needed. -See [CHANGELOG](https://github.com/natario1/CameraView/blob/master/CHANGELOG.md). ```groovy -compile 'com.otaliastudios:cameraview:1.6.1' -``` - -Make sure your project repositories include the `jcenter()`: - -```groovy -allprojects { - repositories { - jcenter() - } -} -``` - - -- - - -
- -*This was a fork of [CameraKit-Android](https://github.com/gogopop/CameraKit-Android), originally a -fork of [Google's CameraView](https://github.com/google/cameraview), but has been -[completely rewritten](https://github.com/natario1/CameraView/graphs/contributors?type=d). -See below for [licensing info](#contributing-and-licenses).* - -### Features - -- Seamless image and video capturing -- **Gestures** support (tap to focus, pinch to zoom and much more) -- System permission handling -- **Smart sizing** behavior - - Preview: Create a `CameraView` of **any size** - - Preview: Center inside or center crop behaviors - - Output: Handy SizeSelectors to set the output size -- Built-in **grid drawing** -- Multiple capture methods - - Capture high-quality content with `takePicture` and `takeVideo` - - Take **quick snapshots** as a freeze frame of the preview with `takePictureSnapshot` -- Control HDR, flash, zoom, white balance, exposure correction and more -- **Frame processing** support -- **Metadata** support for pictures and videos - - Automatically detected orientation tags - - Plug in **location tags** with `setLocation()` API -- `CameraUtils` to help with Bitmaps and orientations -- Error handling -- Thread safe, **well tested** -- **Lightweight**, no dependencies, just support `ExifInterface` +compile 'com.otaliastudios:cameraview:2.0.0-beta01' +``` + +- Fast & reliable +- Gestures support +- Frame processing support +- OpenGL powered preview +- Take high-quality content with `takePicture` and `takeVideo` +- Take super-fast snapshots with `takePictureSnapshot` and `takeVideoSnapshot` +- Smart sizing: create a `CameraView` of any size +- Control HDR, flash, zoom, white balance, exposure, location, grid drawing & more +- Lightweight: the only dep. is support `ExifInterface` - Works down to API level 15 +- Well tested -# Docs - -- [Usage](#usage) - - [Capturing Images](#capturing-images) - - [Capturing Video](#capturing-video) - - [Other camera events](#other-camera-events) -- [Gestures](#gestures) - - [Gesture APIs](#gesture-apis) -- [Sizing Behavior](#sizing-behavior) - - [Preview Size](#preview-size) - - [Capture Size](#capture-size) - - [Size APIs](#size-apis) -- [Camera Controls](#camera-controls) -- [Frame Processing](#frame-processing) - - [Frame Processing APIs](#frame-processing-apis) -- [Other APIs](#other-apis) -- [Permissions Behavior](#permissions-behavior) -- [Logging](#logging) - -## Usage - -To use the CameraView engine, simply add a `CameraView` to your layout: - -```xml -+ + + +
\ No newline at end of file diff --git a/art/old_screen1.png b/art/old_screen1.png deleted file mode 100644 index 72deb7c8..00000000 Binary files a/art/old_screen1.png and /dev/null differ diff --git a/art/old_screen2.png b/art/old_screen2.png deleted file mode 100644 index c0ae2a54..00000000 Binary files a/art/old_screen2.png and /dev/null differ diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewTest.java index ef138658..56d404f4 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewTest.java @@ -71,16 +71,16 @@ public class CameraViewTest extends BaseTest { //region testLifecycle @Test - public void testStart() { - cameraView.start(); + public void testOpen() { + cameraView.open(); verify(mockPreview, times(1)).onResume(); // Can't verify controller, depends on permissions. // See to-do at the end. } @Test - public void testStop() { - cameraView.stop(); + public void testClose() { + cameraView.close(); verify(mockPreview, times(1)).onPause(); verify(mockController, times(1)).stop(); } @@ -96,7 +96,7 @@ public class CameraViewTest extends BaseTest { @Test public void testNullBeforeStart() { - assertFalse(cameraView.isStarted()); + assertFalse(cameraView.isOpened()); assertNull(cameraView.getCameraOptions()); assertNull(cameraView.getSnapshotSize()); assertNull(cameraView.getPictureSize()); diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/IntegrationTest.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/IntegrationTest.java index f37f17a5..c0db9581 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/IntegrationTest.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/IntegrationTest.java @@ -98,7 +98,7 @@ public class IntegrationTest extends BaseTest { } private CameraOptions waitForOpen(boolean expectSuccess) { - camera.start(); + camera.open(); final Task+ +
+ +### Get started + +Get started with [install info](about/install.html), [quick setup](about/getting-started.html), or +read the in-depth [documentation](). + +### Older versions + +This website contains documentation and informations about version 2.X.X of the library. +For older versions, please take a look at the v1 branch in the [project page](https://github.com/natario1/CameraView). + diff --git a/docs/script/launch b/docs/script/launch new file mode 100755 index 00000000..080bfe6c --- /dev/null +++ b/docs/script/launch @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +# +# Run a local instance of the site. +bundle exec jekyll serve diff --git a/docs/script/new-page b/docs/script/new-page new file mode 100755 index 00000000..237bf18a --- /dev/null +++ b/docs/script/new-page @@ -0,0 +1,107 @@ +#!/usr/bin/env ruby + +require 'date' +require 'optparse' + +options = { + # Expects to be in the bin/ sub-directory by default + :path => File.dirname(File.dirname(__FILE__)) +} + +parser = OptionParser.new do |opt| + opt.banner = 'usage: jekyll-page TITLE CATEGORY [FILENAME] [OPTIONS]' + opt.separator '' + opt.separator 'Options' + opt.on('-e', '--edit', 'Edit the page') do |edit| + options[:edit] = true + end + opt.on('-l', '--link', 'Relink pages') do |link| + options[:link] = true + end + opt.on('-p PATH', '--path PATH', String, 'Path to project root') do |path| + options[:path] = path + end + opt.separator '' +end + +parser.parse! + +title = ARGV[0] +category = ARGV[1] +filename = ARGV[2] + +# Resolve any relative links +BASE_DIR = File.expand_path(options[:path]) +POSTS_DIR = "#{BASE_DIR}/_posts" +PAGES_DIR = "#{BASE_DIR}/_pages" + +# Ensure the _posts directory exists (we are in the correct directory) +if not Dir.exists?(POSTS_DIR) + puts "#{POSTS_DIR} directory does not exists" + exit +end + +# Create _pages directory if it doesn't exist +if not Dir.exists?(PAGES_DIR) + Dir.mkdir(PAGES_DIR) +end + +if options[:link] + Dir.foreach(POSTS_DIR) do |name| + next if name[0] == '.' + nodate = name[/\d{4}-\d{2}-\d{2}-(?