* 更新CameraX至v1.0.0-rc01
* 新增支持点击预览区域对焦目标
* 修改一些默认配置
* 优化细节
This commit is contained in:
Jenly
2020-12-30 16:45:50 +08:00
parent c89c465d61
commit f7869595bf
15 changed files with 139 additions and 41 deletions

View File

@@ -41,9 +41,9 @@ dependencies {
androidTestImplementation deps.test.runner
androidTestImplementation deps.test.espresso
implementation deps.support.design
implementation deps.support.appcompat
implementation deps.support.constraintlayout
implementation deps.androidx.design
implementation deps.androidx.appcompat
implementation deps.androidx.constraintlayout
implementation deps.kotlin
implementation deps.corektx

Binary file not shown.

View File

@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":27,"versionName":"2.0.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release","dirName":""},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":28,"versionName":"2.0.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release","dirName":""},"path":"app-release.apk","properties":{}}]

View File

@@ -67,10 +67,10 @@ public class CustomCaptureActivity extends CaptureActivity {
decodeConfig.setHints(DecodeFormatManager.ALL_HINTS)////设置解码
.setSupportVerticalCode(true)//设置是否支持扫垂直的条码 (增强识别率,相应的也会增加性能消耗)
.setSupportLuminanceInvert(true)//设置是否支持识别反色码,黑白颜色反转(增强识别率,相应的也会增加性能消耗)
// .setAreaRectRatio(0.9f)//设置识别区域比例默认0.9,设置的比例最终会在预览区域裁剪基于此比例的一个矩形进行扫码识别
.setAreaRectRatio(0.8f)//设置识别区域比例默认0.8,设置的比例最终会在预览区域裁剪基于此比例的一个矩形进行扫码识别
// .setAreaRectVerticalOffset(0)//设置识别区域垂直方向偏移量默认为0为0表示居中可以为负数
// .setAreaRectHorizontalOffset(0)//设置识别区域水平方向偏移量默认为0为0表示居中可以为负数
.setFullAreaScan(true);//设置是否全区域识别,默认true
.setFullAreaScan(false);//设置是否全区域识别,默认false
//获取CameraScan里面有扫码相关的配置设置。CameraScan里面包含部分支持链式调用的方法即调用返回是CameraScan本身的一些配置建议在startCamera之前调用。
getCameraScan().setPlayBeep(true)//设置是否播放音效默认为false

View File

@@ -41,8 +41,8 @@ public class QRCodeActivity extends CaptureActivity {
//初始化解码配置
DecodeConfig decodeConfig = new DecodeConfig();
decodeConfig.setHints(DecodeFormatManager.QR_CODE_HINTS)//如果只有识别二维码的需求,这样设置效率会更高
.setFullAreaScan(false)//设置是否全区域识别,默认true
.setAreaRectRatio(0.9f)//设置识别区域比例默认0.9,设置的比例最终会在预览区域裁剪基于此比例的一个矩形进行扫码识别
.setFullAreaScan(false)//设置是否全区域识别,默认false
.setAreaRectRatio(0.8f)//设置识别区域比例默认0.8,设置的比例最终会在预览区域裁剪基于此比例的一个矩形进行扫码识别
.setAreaRectVerticalOffset(0)//设置识别区域垂直方向偏移量默认为0为0表示居中可以为负数
.setAreaRectHorizontalOffset(0);//设置识别区域水平方向偏移量默认为0为0表示居中可以为负数