1、支持真实识别区域比例和识别区域偏移量可配置

2、对外暴露更多可配置参数
This commit is contained in:
jenly1314
2019-09-24 11:04:36 +08:00
parent 3465b76e96
commit 39f13c3c3f
10 changed files with 266 additions and 93 deletions

View File

@@ -61,8 +61,11 @@ public class CustomCaptureActivity extends CaptureActivity {
//获取CaptureHelper里面有扫码相关的配置设置
getCaptureHelper().playBeep(false)//播放音效
.vibrate(true)//震动
// .decodeFormats(DecodeFormatManager.QR_CODE_FORMATS)//设置只识别二维码会提升速度
.supportVerticalCode(true)//支持扫垂直条码,建议有此需求时才使用。
// .decodeFormats(DecodeFormatManager.QR_CODE_FORMATS)//设置只识别二维码会提升速度
// .framingRectRatio(0.9f)//设置识别区域比例范围建议在0.625 ~ 1.0之间。非全屏识别时才有效
// .framingRectVerticalOffset(0)//设置识别区域垂直方向偏移量,非全屏识别时才有效
// .framingRectHorizontalOffset(0)//设置识别区域水平方向偏移量,非全屏识别时才有效
.continuousScan(isContinuousScan);//是否连扫
}

View File

@@ -14,7 +14,9 @@
android:background="@color/colorPrimary"
android:layout_height="wrap_content"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp">
app:contentInsetStart="0dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent">
<TextView
android:id="@+id/tvTitle"
android:layout_width="match_parent"
@@ -32,7 +34,7 @@
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="6dp"
android:layout_marginTop="16dp"
android:layout_marginBottom="6dp"
android:text="默认扫码"
app:layout_constraintLeft_toLeftOf="parent"