Skip to content

Commit

Permalink
Dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuriy Budiyev committed Aug 31, 2017
1 parent 6224c15 commit 6a6f69f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
}

dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta2'
classpath 'com.android.tools.build:gradle:3.0.0-beta3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
}
Expand Down Expand Up @@ -65,7 +65,7 @@ android {
dependencies {
api 'com.google.zxing:core:3.3.0'
api 'com.google.zxing:android-core:3.3.0'
api 'com.android.support:support-annotations:26.0.1'
api 'com.android.support:support-annotations:26.0.2'
}

group = publishedGroupId
Expand Down
20 changes: 9 additions & 11 deletions src/main/java/com/budiyev/android/codescanner/CodeScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -298,17 +298,16 @@ private void autoFocusCamera() {
}
if (mFocusing && mFocusAttemptsCount < FOCUS_ATTEMPTS_THRESHOLD) {
mFocusAttemptsCount++;
scheduleAutoFocusTask();
return;
}
try {
mCamera.autoFocus(mAutoFocusCallback);
mFocusAttemptsCount = 0;
mFocusing = true;
} catch (Exception e) {
mFocusing = false;
scheduleAutoFocusTask();
} else {
try {
mCamera.autoFocus(mAutoFocusCallback);
mFocusAttemptsCount = 0;
mFocusing = true;
} catch (Exception e) {
mFocusing = false;
}
}
scheduleAutoFocusTask();
}

private void scheduleAutoFocusTask() {
Expand Down Expand Up @@ -423,7 +422,6 @@ private final class AutoFocusCallback implements Camera.AutoFocusCallback {
@Override
public void onAutoFocus(boolean success, Camera camera) {
mFocusing = false;
scheduleAutoFocusTask();
}
}

Expand Down

0 comments on commit 6a6f69f

Please sign in to comment.