Skip to content

Commit 35b6cee

Browse files
committed
发布0.9.7版本
1 parent 2400314 commit 35b6cee

5 files changed

Lines changed: 25 additions & 13 deletions

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ C++ port of ZXing for Android
99
### 使用
1010
在gradle中:
1111
``` groovy
12-
implementation 'me.devilsen:CZXing:0.9.6'
12+
implementation 'me.devilsen:CZXing:0.9.7'
1313
```
1414
建议加入abiFilters
1515
```gradle
@@ -37,6 +37,10 @@ Scanner.with(this)
3737
.setScanMode(ScanView.SCAN_MODE_TINY) // 扫描区域
3838
.setTitle("My Scan View") // 扫码界面标题
3939
.showAlbum(true) // 显示相册(默认为true)
40+
.setBarcodeFormat(BarcodeFormat.EAN_13) // 设置扫码格式
41+
.setScanNoticeText("扫描二维码") // 设置扫码文字提示
42+
.setFlashLightOnText("打开闪光灯") // 打开闪光灯提示
43+
.setFlashLightOffText("关闭闪光灯") // 关闭闪光灯提示
4044
.continuousScan() // 连续扫码,不关闭扫码界面
4145
.setOnClickAlbumDelegate(new ScanActivityDelegate.OnClickAlbumDelegate() {
4246
@Override

czxing/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ android {
66
defaultConfig {
77
minSdkVersion rootProject.ext.minSdkVersion
88
targetSdkVersion rootProject.ext.targetSdkVersion
9-
versionCode 19
10-
versionName "0.9.6"
9+
versionCode 20
10+
versionName "0.9.7"
1111

1212
externalNativeBuild {
1313
cmake {

czxing/src/main/cpp/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ include_directories(zxing)
1414
include_directories(include)
1515
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -L${CMAKE_SOURCE_DIR}/../../../libs/${ANDROID_ABI}")
1616

17-
#add_compile_options(czxing "-O1" "-fPIC")
17+
add_compile_options(czxing "-O1" "-fPIC")
1818

1919
# 静态方式导入库
2020
add_library(opencv_core STATIC IMPORTED)
@@ -36,10 +36,10 @@ set_target_properties(tegra_hal PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}
3636
#set_target_properties(opencv_java4 PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../../../libs/${ANDROID_ABI}/libopencv_java4.so)
3737

3838
# 导入zbar
39-
#add_library(iconv SHARED IMPORTED)
40-
add_library(zbar_croe SHARED IMPORTED)
41-
#set_target_properties(iconv PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../../../libs/${ANDROID_ABI}/libiconv.so)
42-
set_target_properties(zbar_croe PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../../../libs/${ANDROID_ABI}/libzbarjni.so)
39+
add_library(iconv SHARED IMPORTED)
40+
add_library(zbar_core SHARED IMPORTED)
41+
set_target_properties(iconv PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../../../libs/${ANDROID_ABI}/libiconv.so)
42+
set_target_properties(zbar_core PROPERTIES IMPORTED_LOCATION ${CMAKE_SOURCE_DIR}/../../../libs/${ANDROID_ABI}/libzbarjni.so)
4343

4444
find_library(
4545
log-lib
@@ -49,8 +49,8 @@ target_link_libraries(
4949
czxing
5050
ZXingCore
5151

52-
# iconv
53-
zbar_croe
52+
iconv
53+
zbar_core
5454

5555
opencv_imgproc
5656
opencv_core

czxing/src/main/java/me/devilsen/czxing/camera/CameraSurface.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
public class CameraSurface extends SurfaceView implements SensorController.CameraFocusListener,
2424
SurfaceHolder.Callback {
2525

26+
private static final long ONE_SECOND = 1000;
2627
private Camera mCamera;
2728

2829
private float mOldDist = 1f;
@@ -33,6 +34,7 @@ public class CameraSurface extends SurfaceView implements SensorController.Camer
3334
private boolean mZoomOutFlag;
3435

3536
private Point focusCenter;
37+
private long mLastFrozenTime;
3638
private long mLastTouchTime;
3739
private SensorController mSensorController;
3840
private CameraConfigurationManager mCameraConfigurationManager;
@@ -214,7 +216,13 @@ private void doubleTap() {
214216
*/
215217
@Override
216218
public void onFrozen() {
217-
BarCodeUtil.d("mCamera is frozen, start focus x = " + focusCenter.x + " y = "+ focusCenter.y);
219+
long now = System.currentTimeMillis();
220+
if (now - mLastFrozenTime < ONE_SECOND) {
221+
return;
222+
}
223+
mLastFrozenTime = now;
224+
225+
BarCodeUtil.d("mCamera is frozen, start focus x = " + focusCenter.x + " y = " + focusCenter.y);
218226
handleFocus(focusCenter.x, focusCenter.y);
219227
}
220228

sample/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ android {
4848
dependencies {
4949

5050
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-3'
51-
implementation project(':czxing')
52-
// implementation 'me.devilsen:CZXing:0.9.6'
51+
// implementation project(':czxing')
52+
implementation 'me.devilsen:CZXing:0.9.7'
5353

5454
implementation rootProject.ext.appcompat
5555
testImplementation rootProject.ext.junit

0 commit comments

Comments
 (0)