优化细节

This commit is contained in:
Jenly
2020-12-28 15:45:25 +08:00
parent aa47b2a7f9
commit 704d21e6c9
4 changed files with 6 additions and 4 deletions

View File

@@ -96,10 +96,12 @@ allprojects {
* v2.x如果您是通过继承CaptureActivity或CaptureFragment实现扫码功能那么动态权限申请相关都已经在CaptureActivity或CaptureFragment处理好了。
* v2.x如果您是通过继承CaptureActivity或CaptureFragment实现扫码功能如果有想要修改默认配置可重写**initCameraScan**方法修改CameraScan的配置即可如果无需修改配置直接在跳转原界面的**onActivityResult** 接收扫码结果即可(更多具体详情可参见[app](app)中的使用示例)。
#### 关于CameraX
##### 关于CameraX
* CameraX暂时还是Beta版可能会存在一定的稳定性如果您有这个考量可以继续使用 **ZXingLite** 以前的 **v1.x** 版本。相信不久之后CameraX就会发布稳定版。
#### v1.x 说明
[【v1.1.9】](https://github.com/jenly1314/ZXingLite/tree/androidx) 如果您正在使用 **1.x** 版本请点击下面的链接查看分支版本,当前 **2.x** 版本已经基于 **Camerx** 进行重构,不支持升级,请在新项目中使用。
查看AndroidX版 **1.x** 分支 [请戳此处](https://github.com/jenly1314/ZXingLite/tree/androidx)

Binary file not shown.

View File

@@ -65,8 +65,8 @@ public class CustomCaptureActivity extends CaptureActivity {
//初始化解码配置
DecodeConfig decodeConfig = new DecodeConfig();
decodeConfig.setHints(DecodeFormatManager.ALL_HINTS)////设置解码
.setSupportVerticalCode(true)//设置是否支持扫垂直的条码
.setSupportLuminanceInvert(true)//设置是否支持识别反色码,黑白颜色反转
.setSupportVerticalCode(true)//设置是否支持扫垂直的条码 (增强识别率,相应的也会增加性能消耗)
.setSupportLuminanceInvert(true)//设置是否支持识别反色码,黑白颜色反转(增强识别率,相应的也会增加性能消耗)
// .setAreaRectRatio(0.9f)//设置识别区域比例默认0.9,设置的比例最终会在预览区域裁剪基于此比例的一个矩形进行扫码识别
// .setAreaRectVerticalOffset(0)//设置识别区域垂直方向偏移量默认为0为0表示居中可以为负数
// .setAreaRectHorizontalOffset(0)//设置识别区域水平方向偏移量默认为0为0表示居中可以为负数

View File

@@ -60,7 +60,7 @@ public class MultiFormatAnalyzer extends AreaRectAnalyzer {
rawResult = decodeInternal(new PlanarYUVLuminanceSource(rotatedData,dataHeight,dataWidth,top,left,height,width,false),mDecodeConfig.isSupportVerticalCodeMultiDecode());
}
if(mDecodeConfig.isSupportLuminanceInvert()){
if(rawResult == null && mDecodeConfig.isSupportLuminanceInvert()){
rawResult = decodeInternal(source.invert(),mDecodeConfig.isSupportLuminanceInvertMultiDecode());
}
}