fix#81
This commit is contained in:
19
README.md
19
README.md
@@ -3,13 +3,14 @@
|
||||

|
||||
|
||||
[](https://raw.githubusercontent.com/jenly1314/ZXingLite/master/app/release/app-release.apk)
|
||||
[](https://bintray.com/beta/#/jenly/maven/zxing-lite)
|
||||
[](https://jitpack.io/#jenly1314/ZXingLite)
|
||||
[](https://travis-ci.org/jenly1314/ZXingLite)
|
||||
[](https://circleci.com/gh/jenly1314/ZXingLite)
|
||||
[](https://android-arsenal.com/api?level=16)
|
||||
[](http://www.apache.org/licenses/LICENSE-2.0)
|
||||
[](https://jenly1314.github.io/)
|
||||
[](http://shang.qq.com/wpa/qunwpa?idkey=8fcc6a2f88552ea44b1.1.682c94fd124f7bb3ec227e2a400dbbfaad3dc2f5ad)
|
||||
[](http://shang.qq.com/wpa/qunwpa?idkey=8fcc6a2f88552ea44b1.1.782c94fd124f7bb3ec227e2a400dbbfaad3dc2f5ad)
|
||||
|
||||
ZXingLite for Android 是ZXing的精简版,基于ZXing库优化扫码和生成二维码/条形码功能,扫码界面完全支持自定义,也可一行代码使用默认实现的扫码功能。总之你想要的都在这里。
|
||||
>简单如斯,你不试试? Come on~
|
||||
@@ -54,21 +55,21 @@ ZXingLite for Android 是ZXing的精简版,基于ZXing库优化扫码和生成
|
||||
<dependency>
|
||||
<groupId>com.king.zxing</groupId>
|
||||
<artifactId>zxing-lite</artifactId>
|
||||
<version>1.1.6</version>
|
||||
<version>1.1.7</version>
|
||||
<type>pom</type>
|
||||
</dependency>
|
||||
```
|
||||
### Gradle:
|
||||
```gradle
|
||||
//AndroidX 版本
|
||||
implementation 'com.king.zxing:zxing-lite:1.1.6-androidx'
|
||||
implementation 'com.king.zxing:zxing-lite:1.1.7-androidx'
|
||||
|
||||
//Android 版本
|
||||
implementation 'com.king.zxing:zxing-lite:1.1.6'
|
||||
implementation 'com.king.zxing:zxing-lite:1.1.7'
|
||||
```
|
||||
### Lvy:
|
||||
```lvy
|
||||
<dependency org='com.king.zxing' name='zxing-lite' rev='1.1.6'>
|
||||
<dependency org='com.king.zxing' name='zxing-lite' rev='1.1.7'>
|
||||
<artifact name='$AID' ext='pom'></artifact>
|
||||
</dependency>
|
||||
```
|
||||
@@ -169,6 +170,10 @@ api 'com.google.zxing:core:3.3.3'
|
||||
|
||||
## 版本记录
|
||||
|
||||
#### v1.1.7:2020-3-29
|
||||
* 优化一些默认参数配置
|
||||
* 修复扫码界面开启闪光灯并切到后台时,手电筒按钮状态未同步问题(fix#81)
|
||||
|
||||
#### v1.1.6:2019-12-27
|
||||
* 生成条形码/二维码时支持自定义配置颜色
|
||||
* 支持识别反色码(增强识别率,默认不支持,需通过CaptureHelper.supportLuminanceInvert(true)开启)
|
||||
@@ -240,11 +245,11 @@ api 'com.google.zxing:core:3.3.3'
|
||||
|
||||
CSDN: <a title="CSDN博客" href="http://blog.csdn.net/jenly121" target="_blank">jenly121</a>
|
||||
|
||||
博客园: <a title="博客园" href="https://www.cnblogs.com/jenly" target="_blank">jenly</a>
|
||||
CNBlogs: <a title="博客园" href="https://www.cnblogs.com/jenly" target="_blank">jenly</a>
|
||||
|
||||
Github: <a title="Github开源项目" href="https://github.com/jenly1314" target="_blank">jenly1314</a>
|
||||
|
||||
加入QQ群: <a title="点击加入QQ群" href="http://shang.qq.com/wpa/qunwpa?idkey=8fcc6a2f88552ea44b1.1.682c94fd124f7bb3ec227e2a400dbbfaad3dc2f5ad" target="_blank">20867961</a>
|
||||
加入QQ群: <a title="点击加入QQ群" href="http://shang.qq.com/wpa/qunwpa?idkey=8fcc6a2f88552ea44b1.1.782c94fd124f7bb3ec227e2a400dbbfaad3dc2f5ad" target="_blank">20867961</a>
|
||||
<div>
|
||||
<img src="https://jenly1314.github.io/image/jenly666.png">
|
||||
<img src="https://jenly1314.github.io/image/qqgourp.png">
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":20,"versionName":"1.1.6-androidx","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
|
||||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":22,"versionName":"1.1.7-androidx","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
|
||||
@@ -247,6 +247,10 @@ public class CaptureHelper implements CaptureLifecycle,CaptureTouchEvent,Capture
|
||||
if (!hasSurface) {
|
||||
surfaceHolder.removeCallback(this);
|
||||
}
|
||||
if(ivTorch != null && ivTorch.getVisibility() == View.VISIBLE){
|
||||
ivTorch.setSelected(false);
|
||||
ivTorch.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -156,6 +156,10 @@ public final class CameraManager {
|
||||
framingRect = null;
|
||||
framingRectInPreview = null;
|
||||
}
|
||||
isTorch = false;
|
||||
if(onTorchListener!=null){
|
||||
onTorchListener.onTorchChanged(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,6 +22,7 @@ import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.BinaryBitmap;
|
||||
@@ -39,6 +40,7 @@ import com.google.zxing.common.HybridBinarizer;
|
||||
import com.google.zxing.qrcode.QRCodeReader;
|
||||
import com.google.zxing.qrcode.QRCodeWriter;
|
||||
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
|
||||
import com.king.zxing.CaptureHelper;
|
||||
import com.king.zxing.DecodeFormatManager;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -184,7 +186,7 @@ public final class CodeUtils {
|
||||
|
||||
return bitmap;
|
||||
} catch (WriterException e) {
|
||||
e.printStackTrace();
|
||||
Log.w(CaptureHelper.TAG,e.getMessage());
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -232,7 +234,7 @@ public final class CodeUtils {
|
||||
canvas.restore();
|
||||
} catch (Exception e) {
|
||||
bitmap = null;
|
||||
e.printStackTrace();
|
||||
Log.w(CaptureHelper.TAG,e.getMessage());
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
@@ -246,6 +248,7 @@ public final class CodeUtils {
|
||||
public static String parseQRCode(String bitmapPath) {
|
||||
Map<DecodeHintType, Object> hints = new HashMap<>();
|
||||
hints.put(DecodeHintType.CHARACTER_SET, "utf-8");
|
||||
hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
|
||||
return parseQRCode(bitmapPath,hints);
|
||||
}
|
||||
|
||||
@@ -319,7 +322,7 @@ public final class CodeUtils {
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Log.w(CaptureHelper.TAG,e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -340,6 +343,7 @@ public final class CodeUtils {
|
||||
decodeFormats.addAll(DecodeFormatManager.AZTEC_FORMATS);
|
||||
decodeFormats.addAll(DecodeFormatManager.PDF417_FORMATS);
|
||||
|
||||
hints.put(DecodeHintType.CHARACTER_SET, "utf-8");
|
||||
hints.put(DecodeHintType.TRY_HARDER,Boolean.TRUE);
|
||||
hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);
|
||||
return parseCode(bitmapPath,hints);
|
||||
@@ -416,7 +420,7 @@ public final class CodeUtils {
|
||||
}
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
Log.w(CaptureHelper.TAG,e.getMessage());
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -606,7 +610,7 @@ public final class CodeUtils {
|
||||
}
|
||||
return bitmap;
|
||||
} catch (WriterException e) {
|
||||
e.printStackTrace();
|
||||
Log.w(CaptureHelper.TAG,e.getMessage());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -649,7 +653,7 @@ public final class CodeUtils {
|
||||
canvas.restore();
|
||||
} catch (Exception e) {
|
||||
bitmap = null;
|
||||
e.printStackTrace();
|
||||
Log.w(CaptureHelper.TAG,e.getMessage());
|
||||
}
|
||||
|
||||
return bitmap;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
//App
|
||||
def app_version = [:]
|
||||
app_version.versionCode = 20
|
||||
app_version.versionName = "1.1.6-androidx"
|
||||
app_version.versionCode = 22
|
||||
app_version.versionName = "1.1.7-androidx"
|
||||
ext.app_version = app_version
|
||||
|
||||
//build version
|
||||
|
||||
Reference in New Issue
Block a user