diff --git a/CHANGELOG.md b/CHANGELOG.md index d07b8773..d14d5504 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ +### v1.4.1 + +- Fixed a bug that would flip the front camera preview on some devices ([#112][112]) +- Two new `CameraOptions` APIs: `o.getSupportedPictureSizes()` and `o.getSupportedPictureAspectRatios()` ([#101][101]) +- Most controls (video quality, hdr, grid, session type, audio, white balance, flash, facing) now inherit + from a base `Control` class ([#105][105]). This let us add new APIs: + + - `CameraView.set(Control)`: sets the control to the given value, e.g. `set(Flash.AUTO)` + - `CameraOptions.supports(Control)`: returns true if the control is supported + - `CameraOptions.getSupportedControls(Class)`: returns list of supported controls of a given kind + +https://github.com/natario1/CameraView/compare/v1.4.0...v1.4.1 + ## v1.4.0 - CameraView is now completely thread-safe. All actions are asynchronous. ([#97][97]) @@ -56,3 +69,6 @@ https://github.com/natario1/CameraView/compare/v1.2.3...v1.3.0 [94]: https://github.com/natario1/CameraView/pull/94 [97]: https://github.com/natario1/CameraView/pull/97 [99]: https://github.com/natario1/CameraView/pull/99 +[101]: https://github.com/natario1/CameraView/pull/101 +[105]: https://github.com/natario1/CameraView/pull/105 +[112]: https://github.com/natario1/CameraView/pull/112 diff --git a/README.md b/README.md index 0cb560a5..f5428457 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ addressing most of the common issues and needs, and still leaving you with flexi See [CHANGELOG](https://github.com/natario1/CameraView/blob/master/CHANGELOG.md). ```groovy -compile 'com.otaliastudios:cameraview:1.4.0' +compile 'com.otaliastudios:cameraview:1.4.1' ```

diff --git a/cameraview/build.gradle b/cameraview/build.gradle index 28c69ea6..adba97e6 100644 --- a/cameraview/build.gradle +++ b/cameraview/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'com.jfrog.bintray' // Required by bintray -version = '1.4.0' +version = '1.4.1' group = 'com.otaliastudios' //region android dependencies diff --git a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java index 402a47da..b240c7aa 100644 --- a/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java +++ b/cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraOptions1Test.java @@ -9,6 +9,7 @@ import org.junit.Test; import org.junit.runner.RunWith; import java.util.Arrays; +import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -109,25 +110,6 @@ public class CameraOptions1Test extends BaseTest { } } - @Test - public void testFacing() { - Set supported = new HashSet<>(); - Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); - for (int i = 0, count = Camera.getNumberOfCameras(); i < count; i++) { - Camera.getCameraInfo(i, cameraInfo); - supported.add(cameraInfo.facing); - } - - CameraOptions o = new CameraOptions(mock(Camera.Parameters.class), false); - Mapper m = new Mapper.Mapper1(); - Set s = o.getSupportedFacing(); - assertEquals(o.getSupportedFacing().size(), supported.size()); - for (Facing facing : s) { - assertTrue(supported.contains(m.map(facing))); - assertTrue(o.supports(facing)); - } - } - @Test public void testGestureActions() { Camera.Parameters params = mock(Camera.Parameters.class); @@ -145,6 +127,41 @@ public class CameraOptions1Test extends BaseTest { assertFalse(o.supports(GestureAction.EXPOSURE_CORRECTION)); } + @Test + public void testAlwaysSupportedControls() { + // Grid, VideoQuality, SessionType and Audio are always supported. + Camera.Parameters params = mock(Camera.Parameters.class); + CameraOptions o = new CameraOptions(params, false); + + Collection grids = o.getSupportedControls(Grid.class); + Collection video = o.getSupportedControls(VideoQuality.class); + Collection sessions = o.getSupportedControls(SessionType.class); + Collection