Merge branch 'master' into error_handling

pull/59/merge^2
Johnson145 7 years ago committed by GitHub
commit b2c4bf1f57
  1. 4
      README.md
  2. 2
      cameraview/build.gradle
  3. 6
      cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java
  4. 12
      cameraview/src/main/utils/com/otaliastudios/cameraview/CameraLogger.java
  5. 10
      demo/src/main/java/com/otaliastudios/cameraview/demo/CameraActivity.java

@ -10,7 +10,7 @@
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. 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.
```groovy ```groovy
compile 'com.otaliastudios:cameraview:1.2.1' compile 'com.otaliastudios:cameraview:1.2.2'
``` ```
<p> <p>
@ -19,7 +19,7 @@ compile 'com.otaliastudios:cameraview:1.2.1'
<img src="art/screen3.jpg" width="250" vspace="20" hspace="5"> <img src="art/screen3.jpg" width="250" vspace="20" hspace="5">
</p> </p>
*This was a fork of [CameraKit-Android library](https://github.com/gogopop/CameraKit-Android), originally a fork of [Google's CameraView library](https://github.com/google/cameraview), but has been [completely rewritten](https://github.com/natario1/CameraView/graphs/contributors?type=d). See [below](#roadmap) for a list of what was done. Feel free to contribute - this is under active development.* *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](#roadmap) for a list of what was done. Feel free to contribute - this is under active development.*
### Features ### Features

@ -3,7 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray' apply plugin: 'com.jfrog.bintray'
// Required by bintray // Required by bintray
version = '1.2.1' version = '1.2.2'
group = 'com.otaliastudios' group = 'com.otaliastudios'
//region android dependencies //region android dependencies

@ -518,7 +518,9 @@ public class CameraView extends FrameLayout {
/** /**
* Checks that we have appropriate permissions for this session type. * Checks that we have appropriate permissions for this session type.
* Throws if session = audio and manifest did not add the microphone permissions. * Throws if session = audio and manifest did not add the microphone permissions.
* @param sessionType
* @param audio
* @return true if we can go on, false otherwise. * @return true if we can go on, false otherwise.
*/ */
@SuppressLint("NewApi") @SuppressLint("NewApi")
@ -1280,7 +1282,7 @@ public class CameraView extends FrameLayout {
/** /**
* Controls whether CameraView should play sound effects on certain * Controls whether CameraView should play sound effects on certain
* events (picture taken, focus complete). Note that: * events (picture taken, focus complete). Note that:
* - On API level < 16, this flag is always false * - On API level {@literal <} 16, this flag is always false
* - Camera1 will always play the shutter sound when taking pictures * - Camera1 will always play the shutter sound when taking pictures
* *
* @param playSounds whether to play sound effects * @param playSounds whether to play sound effects

@ -38,7 +38,7 @@ public final class CameraLogger {
mTag = tag; mTag = tag;
} }
public void i(String message) { void i(String message) {
if (should(LEVEL_VERBOSE)) { if (should(LEVEL_VERBOSE)) {
Log.i(mTag, message); Log.i(mTag, message);
lastMessage = message; lastMessage = message;
@ -46,7 +46,7 @@ public final class CameraLogger {
} }
} }
public void w(String message) { void w(String message) {
if (should(LEVEL_WARNING)) { if (should(LEVEL_WARNING)) {
Log.w(mTag, message); Log.w(mTag, message);
lastMessage = message; lastMessage = message;
@ -54,7 +54,7 @@ public final class CameraLogger {
} }
} }
public void e(String message) { void e(String message) {
if (should(LEVEL_ERROR)) { if (should(LEVEL_ERROR)) {
Log.w(mTag, message); Log.w(mTag, message);
lastMessage = message; lastMessage = message;
@ -77,15 +77,15 @@ public final class CameraLogger {
return message.trim(); return message.trim();
} }
public void i(Object... data) { void i(Object... data) {
i(string(LEVEL_VERBOSE, data)); i(string(LEVEL_VERBOSE, data));
} }
public void w(Object... data) { void w(Object... data) {
w(string(LEVEL_WARNING, data)); w(string(LEVEL_WARNING, data));
} }
public void e(Object... data) { void e(Object... data) {
e(string(LEVEL_ERROR, data)); e(string(LEVEL_ERROR, data));
} }
} }

@ -132,6 +132,16 @@ public class CameraActivity extends AppCompatActivity implements View.OnClickLis
} }
} }
@Override
public void onBackPressed() {
BottomSheetBehavior b = BottomSheetBehavior.from(controlPanel);
if (b.getState() != BottomSheetBehavior.STATE_HIDDEN) {
b.setState(BottomSheetBehavior.STATE_HIDDEN);
return;
}
super.onBackPressed();
}
private void edit() { private void edit() {
BottomSheetBehavior b = BottomSheetBehavior.from(controlPanel); BottomSheetBehavior b = BottomSheetBehavior.from(controlPanel);
b.setState(BottomSheetBehavior.STATE_COLLAPSED); b.setState(BottomSheetBehavior.STATE_COLLAPSED);

Loading…
Cancel
Save