Skip to content

Commit a219073

Browse files
authored
Release v2.7.0 (#1040)
* Release v2.7.0 * Improve docs
1 parent d894911 commit a219073

File tree

14 files changed

+64
-33
lines changed

14 files changed

+64
-33
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55
push:
66
branches:
77
- master
8+
- main
89
pull_request:
910
jobs:
1011
ANDROID_BASE_CHECKS:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CameraView is a well documented, high-level library that makes capturing picture
2222
addressing most of the common issues and needs, and still leaving you with flexibility where needed.
2323

2424
```groovy
25-
api 'com.otaliastudios:cameraview:2.6.4'
25+
api 'com.otaliastudios:cameraview:2.7.0'
2626
```
2727

2828
- Fast & reliable

build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
buildscript {
33

44
extra["minSdkVersion"] = 15
5-
extra["compileSdkVersion"] = 29
6-
extra["targetSdkVersion"] = 29
5+
extra["compileSdkVersion"] = 30
6+
extra["targetSdkVersion"] = 30
77

88
repositories {
99
google()
@@ -12,9 +12,9 @@ buildscript {
1212
}
1313

1414
dependencies {
15-
classpath("com.android.tools.build:gradle:4.0.1")
16-
classpath("com.otaliastudios.tools:publisher:0.3.3")
17-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.0")
15+
classpath("com.android.tools.build:gradle:4.1.2")
16+
classpath("io.deepmedia.tools:publisher:0.4.1")
17+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21")
1818

1919
}
2020
}

cameraview/build.gradle.kts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import com.otaliastudios.tools.publisher.common.License
2-
import com.otaliastudios.tools.publisher.common.Release
1+
import io.deepmedia.tools.publisher.common.License
2+
import io.deepmedia.tools.publisher.common.Release
33

44
plugins {
55
id("com.android.library")
66
id("kotlin-android")
7-
id("com.otaliastudios.tools.publisher")
7+
id("io.deepmedia.tools.publisher")
88
id("jacoco")
99
}
1010

@@ -14,7 +14,7 @@ android {
1414
setMinSdkVersion(property("minSdkVersion") as Int)
1515
setTargetSdkVersion(property("targetSdkVersion") as Int)
1616
versionCode = 1
17-
versionName = "2.6.4"
17+
versionName = "2.7.0"
1818
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1919
testInstrumentationRunnerArgument("filter", "" +
2020
"com.otaliastudios.cameraview.tools.SdkExcludeFilter," +
@@ -30,11 +30,11 @@ dependencies {
3030

3131
androidTestImplementation("androidx.test:runner:1.3.0")
3232
androidTestImplementation("androidx.test:rules:1.3.0")
33-
androidTestImplementation("androidx.test.ext:junit:1.1.1")
33+
androidTestImplementation("androidx.test.ext:junit:1.1.2")
3434
androidTestImplementation("org.mockito:mockito-android:2.28.2")
3535
androidTestImplementation("androidx.test.espresso:espresso-core:3.2.0")
3636

37-
api("androidx.exifinterface:exifinterface:1.2.0")
37+
api("androidx.exifinterface:exifinterface:1.3.2")
3838
api("androidx.lifecycle:lifecycle-common:2.2.0")
3939
api("com.google.android.gms:play-services-tasks:17.2.0")
4040
implementation("androidx.annotation:annotation:1.1.0")
@@ -52,8 +52,8 @@ publisher {
5252
project.url = "https://github.com/natario1/CameraView"
5353
project.addLicense(License.APACHE_2_0)
5454
bintray {
55-
release.setSources(Release.SOURCES_AUTO)
56-
release.setDocs(Release.DOCS_AUTO)
55+
release.sources = Release.SOURCES_AUTO
56+
release.docs = Release.DOCS_AUTO
5757
auth.user = "BINTRAY_USER"
5858
auth.key = "BINTRAY_KEY"
5959
auth.repo = "BINTRAY_REPO"
@@ -97,7 +97,7 @@ jacoco { toolVersion = "0.8.5" }
9797
tasks.register("computeCoverage", JacocoReport::class) {
9898
dependsOn("compileDebugSources") // Compile sources, needed below
9999
executionData.from(fileTree(coverageInputDir))
100-
sourceDirectories.from(android.sourceSets["main"].java.sourceFiles)
100+
sourceDirectories.from(android.sourceSets["main"].java.srcDirs)
101101
additionalSourceDirs.from("$buildDir/generated/source/buildConfig/debug")
102102
additionalSourceDirs.from("$buildDir/generated/source/r/debug")
103103
classDirectories.from(fileTree("$buildDir/intermediates/javac/debug") {

cameraview/src/androidTest/java/com/otaliastudios/cameraview/CameraViewCallbacksTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,13 @@ public void testOrientationCallbacks() {
248248
verify(listener, times(1)).onOrientationChanged(anyInt());
249249
}
250250

251-
// TODO: test onShutter, here or elsewhere
251+
@Test
252+
public void testOnShutter() {
253+
doEndOp(op, true).when(listener).onPictureShutter();
254+
camera.mCameraCallbacks.dispatchOnPictureShutter(true);
255+
assertNotNull(op.await(DELAY));
256+
verify(listener, times(1)).onPictureShutter();
257+
}
252258

253259
@Test
254260
public void testCameraError() {

cameraview/src/main/java/com/otaliastudios/cameraview/CameraListener.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,12 @@ public void onVideoRecordingEnd() {
162162
}
163163

164164
/**
165-
* Notifies that the shutter event is happening. You can update UI to show some
166-
* trigger effect, so user visually confirms that picture is being taken
167-
* or video recording is about to start.
165+
* Notifies that the picture capture has started. Can be used to update the UI for visual
166+
* confirmation or sound effects.
168167
*/
169168
@UiThread
170-
public void onShutter() {}
169+
public void onPictureShutter() {
170+
171+
}
171172

172173
}

cameraview/src/main/java/com/otaliastudios/cameraview/CameraView.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,15 +2228,15 @@ public void run() {
22282228
}
22292229

22302230
@Override
2231-
public void onShutter(boolean shouldPlaySound) {
2231+
public void dispatchOnPictureShutter(boolean shouldPlaySound) {
22322232
if (shouldPlaySound && mPlaySounds) {
22332233
playSound(MediaActionSound.SHUTTER_CLICK);
22342234
}
22352235
mUiHandler.post(new Runnable() {
22362236
@Override
22372237
public void run() {
22382238
for (CameraListener listener : mListeners) {
2239-
listener.onShutter();
2239+
listener.onPictureShutter();
22402240
}
22412241
}
22422242
});

cameraview/src/main/java/com/otaliastudios/cameraview/engine/CameraBaseEngine.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.otaliastudios.cameraview.engine;
22

3-
import android.graphics.PointF;
4-
import android.graphics.RectF;
53
import android.location.Location;
64

75
import androidx.annotation.CallSuper;
@@ -28,7 +26,6 @@
2826
import com.otaliastudios.cameraview.engine.offset.Reference;
2927
import com.otaliastudios.cameraview.engine.orchestrator.CameraState;
3028
import com.otaliastudios.cameraview.frame.FrameManager;
31-
import com.otaliastudios.cameraview.gesture.Gesture;
3229
import com.otaliastudios.cameraview.overlay.Overlay;
3330
import com.otaliastudios.cameraview.picture.PictureRecorder;
3431
import com.otaliastudios.cameraview.preview.CameraPreview;
@@ -556,7 +553,7 @@ public void run() {
556553

557554
@Override
558555
public void onPictureShutter(boolean didPlaySound) {
559-
getCallback().onShutter(!didPlaySound);
556+
getCallback().dispatchOnPictureShutter(!didPlaySound);
560557
}
561558

562559
@Override

cameraview/src/main/java/com/otaliastudios/cameraview/engine/CameraEngine.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public interface Callback {
116116
void dispatchOnCameraOpened(@NonNull CameraOptions options);
117117
void dispatchOnCameraClosed();
118118
void onCameraPreviewStreamSizeChanged();
119-
void onShutter(boolean shouldPlaySound);
119+
void dispatchOnPictureShutter(boolean shouldPlaySound);
120120
void dispatchOnVideoTaken(@NonNull VideoResult.Stub stub);
121121
void dispatchOnPictureTaken(@NonNull PictureResult.Stub stub);
122122
void dispatchOnFocusStart(@Nullable Gesture trigger, @NonNull PointF where);

docs/_about/changelog.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ New versions are released through GitHub, so the reference page is the [GitHub R
99
> Starting from 2.4.0, you can now [support development](https://github.com/sponsors/natario1) through the GitHub Sponsors program.
1010
Companies can share a tiny part of their revenue and get private support hours in return. Thanks!
1111

12+
##### v2.7.0
13+
14+
- New: onPictureShutter() callback when taking pictures, thanks to [@EzequielAdrianM][EzequielAdrianM] ([#1030][1030])
15+
- New: GestureAction.TAKE_PICTURE_SNAPSHOT lets you take snapshots on gesture, thanks to [@EzequielAdrianM][EzequielAdrianM] ([#1030][1030])
16+
- Improvement: try-catch internal exception when takePicture fails, thanks to [@michaelspecht][michaelspecht] ([#1024][1024])
17+
- Improvement: log errors when file writing fails, thanks to [@bwt][bwt] ([#960][960])
18+
- Fix: Avoid preview deadlocks ([#1020][1020])
19+
- Fix: Workaround for messed-up preview on Pixel 4 ([#1020][1020])
20+
- Fix: Avoid internal StackOverflow errors ([#992][992])
21+
22+
<https://github.com/natario1/CameraView/compare/v2.6.4...v2.7.0>
23+
1224
##### v2.6.4
1325

1426
- Fix: Fix many small bugs ([#953][953])
@@ -322,6 +334,7 @@ This is the last release before v2.
322334

323335
[aartikov]: https://github.com/aartikov
324336
[athornz]: https://github.com/athornz
337+
[bwt]: https://github.com/bwt
325338
[v-gar]: https://github.com/v-gar
326339
[andrewmunn]: https://github.com/andrewmunn
327340
[chaitanyaraghav]: https://github.com/chaitanyaraghav
@@ -344,6 +357,8 @@ This is the last release before v2.
344357
[hualong-shen]: https://github.com/hualong-shen
345358
[EverydayPineapple]: https://github.com/EverydayPineapple
346359
[jeffreyfjohnson]: https://github.com/jeffreyfjohnson
360+
[michaelspecht]: https://github.com/michaelspecht
361+
[EzequielAdrianM]: https://github.com/EzequielAdrianM
347362

348363

349364
[73]: https://github.com/natario1/CameraView/pull/73
@@ -442,3 +457,8 @@ This is the last release before v2.
442457
[877]: https://github.com/natario1/CameraView/pull/877
443458
[897]: https://github.com/natario1/CameraView/pull/897
444459
[953]: https://github.com/natario1/CameraView/pull/953
460+
[960]: https://github.com/natario1/CameraView/pull/960
461+
[992]: https://github.com/natario1/CameraView/pull/992
462+
[1020]: https://github.com/natario1/CameraView/pull/1020
463+
[1024]: https://github.com/natario1/CameraView/pull/1024
464+
[1030]: https://github.com/natario1/CameraView/pull/1030

0 commit comments

Comments
 (0)