Skip to content

Commit

Permalink
release 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hupei committed Jun 20, 2017
1 parent 2137b61 commit aa9b5d3
Show file tree
Hide file tree
Showing 10 changed files with 219 additions and 211 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- 本库依赖使用Gradle构建时添加一下即可:

```javascript
compile 'com.mylhyl:zxingscanner:1.3.0'
compile 'com.mylhyl:zxingscanner:1.3.1'
```

## 2、离线jar,需要手动添加 Zxing 核心库
Expand Down Expand Up @@ -193,6 +193,8 @@ Bitmap bitmap = new QREncode.Builder(this)

### 七、版本更新

> 1.3.1 优化代码
> 1.3.0 生成二维码增加logo
> 1.2.2 修复扫描提示文字颜色无效、支持自动换行
Expand Down
6 changes: 3 additions & 3 deletions zxingscanner/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ android {
buildToolsVersion '25.0.0'

defaultConfig {
minSdkVersion 14
minSdkVersion 15
targetSdkVersion 23
versionCode 20170608
versionCode 20170620
versionName version
}
buildTypes {
Expand All @@ -33,7 +33,7 @@ publish {
userOrg = 'mylhyl'
groupId = 'com.mylhyl'
artifactId = 'zxingscanner'
version = '1.3.0'
version = '1.3.1'
description = 'android zxing style'
website = "https://github.com/mylhyl/Android-Zxing"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@

import android.hardware.Camera;
import android.os.AsyncTask;
import android.util.Log;

import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.RejectedExecutionException;

@SuppressWarnings("deprecation")
final class AutoFocusManager implements Camera.AutoFocusCallback {

// private static final String TAG = AutoFocusManager.class.getSimpleName();
private static final String TAG = AutoFocusManager.class.getSimpleName();

private static final long AUTO_FOCUS_INTERVAL_MS = 2000L;
private static final Collection<String> FOCUS_MODES_CALLING_AF;
Expand All @@ -47,7 +49,8 @@ final class AutoFocusManager implements Camera.AutoFocusCallback {
String currentFocusMode = camera.getParameters().getFocusMode();
// 自动对焦
useAutoFocus = true && FOCUS_MODES_CALLING_AF.contains(currentFocusMode);
//Log.i(TAG, "Current focus mode '" + currentFocusMode + "'; use auto focus? " + useAutoFocus);
//Log.i(TAG, "Current focus mode '" + currentFocusMode + "'; use auto focus? " +
// useAutoFocus);
start();
}

Expand All @@ -64,7 +67,7 @@ private synchronized void autoFocusAgainLater() {
newTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);
outstandingTask = newTask;
} catch (RejectedExecutionException ree) {
// Log.w(TAG, "Could not request auto focus", ree);
Log.w(TAG, "Could not request auto focus", ree);
}
}
}
Expand All @@ -77,9 +80,8 @@ synchronized void start() {
camera.autoFocus(this);
focusing = true;
} catch (RuntimeException re) {
// Have heard RuntimeException reported in Android 4.0.x+;
// continue?
// Log.w(TAG, "Unexpected exception while focusing", re);
// Have heard RuntimeException reported in Android 4.0.x+; continue?
Log.w(TAG, "Unexpected exception while focusing", re);
// Try again later to keep cycle going
autoFocusAgainLater();
}
Expand All @@ -104,9 +106,8 @@ synchronized void stop() {
try {
camera.cancelAutoFocus();
} catch (RuntimeException re) {
// Have heard RuntimeException reported in Android 4.0.x+;
// continue?
// Log.w(TAG, "Unexpected exception while cancelling focusing", re);
// Have heard RuntimeException reported in Android 4.0.x+; continue?
Log.w(TAG, "Unexpected exception while cancelling focusing", re);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* A class which deals with reading, parsing, and setting the camera parameters
* which are used to configure the camera hardware.
*/
@SuppressWarnings("deprecation")
final class CameraConfigurationManager {

private static final String TAG = "CameraConfiguration";
Expand All @@ -56,8 +57,7 @@ final class CameraConfigurationManager {
*/
void initFromCameraParameters(OpenCamera camera) {
Camera.Parameters parameters = camera.getCamera().getParameters();
WindowManager manager = (WindowManager) context
.getSystemService(Context.WINDOW_SERVICE);
WindowManager manager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
Display display = manager.getDefaultDisplay();

int displayRotation = display.getRotation();
Expand All @@ -80,8 +80,7 @@ void initFromCameraParameters(OpenCamera camera) {
if (displayRotation % 90 == 0) {
cwRotationFromNaturalToDisplay = (360 + displayRotation) % 360;
} else {
throw new IllegalArgumentException("Bad rotation: "
+ displayRotation);
throw new IllegalArgumentException("Bad rotation: " + displayRotation);
}
}

Expand Down Expand Up @@ -130,7 +129,8 @@ void setDesiredCameraParameters(OpenCamera camera, boolean safeMode) {
Camera.Parameters parameters = theCamera.getParameters();

if (parameters == null) {
Log.w(TAG, "Device error: no camera parameters are available. Proceeding without configuration.");
Log.w(TAG, "Device error: no camera parameters are available. Proceeding without " +
"configuration.");
return;
}

Expand Down Expand Up @@ -184,13 +184,13 @@ void setDesiredCameraParameters(OpenCamera camera, boolean safeMode) {
}
}

Point getBestPreviewSize() {
return bestPreviewSize;
}
// Point getBestPreviewSize() {
// return bestPreviewSize;
// }

Point getPreviewSizeOnScreen() {
return previewSizeOnScreen;
}
// Point getPreviewSizeOnScreen() {
// return previewSizeOnScreen;
// }

Point getCameraResolution() {
return cameraResolution;
Expand All @@ -200,9 +200,9 @@ Point getScreenResolution() {
return screenResolution;
}

int getCWNeededRotation() {
return cwNeededRotation;
}
// int getCWNeededRotation() {
// return cwNeededRotation;
// }

boolean getTorchState(Camera camera) {
if (camera != null) {
Expand Down
Loading

0 comments on commit aa9b5d3

Please sign in to comment.