From 0e3a3e959063bba3b905bc616530f5e22f0d154e Mon Sep 17 00:00:00 2001 From: aiWean <1581209979@qq.com> Date: Sun, 16 Aug 2020 15:45:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- app/build.gradle | 2 +- .../base/com/google/android/cameraview/PreviewImpl.java | 1 + .../main/java/com/ailiwean/core/view/ZxingCameraView.kt | 2 +- .../java/com/google/android/cameraview/CameraView.java | 8 ++++---- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c45ea90..7e93ed3 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,8 @@ ``` - implementation 'com.github.ailiwean:NBZxing:0.0.21' - //若需要使用灰度算法增强库,再次添加以下依赖 //纯java版超轻量 + implementation 'com.github.ailiwean:NBZxing:0.0.21' + //若需要使用灰度算法增强库,再次添加以下依赖//纯java超轻量 implementation 'com.github.ailiwean:NBZxing-Scale:0.0.1' ``` **注意:库中已经包含zxing源码无需再次依赖** diff --git a/app/build.gradle b/app/build.gradle index 786eb01..bf2eaf3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,7 +40,7 @@ dependencies { implementation 'com.zhihu.android:matisse:0.5.3-beta3' // implementation 'com.github.ailiwean:NBZxing:0.0.7' // api 'com.google.zxing:core:3.3.3' -// implementation 'com.github.ailiwean:NBZxing:0.0.24' +// implementation 'com.github.ailiwean:NBZxing:0.0.21' // implementation 'me.devilsen:czxing:1.0.11' } diff --git a/module_camera/src/main/base/com/google/android/cameraview/PreviewImpl.java b/module_camera/src/main/base/com/google/android/cameraview/PreviewImpl.java index e9ce7f6..c1881e7 100644 --- a/module_camera/src/main/base/com/google/android/cameraview/PreviewImpl.java +++ b/module_camera/src/main/base/com/google/android/cameraview/PreviewImpl.java @@ -17,6 +17,7 @@ package com.google.android.cameraview; import android.os.Handler; +import android.util.Log; import android.view.Surface; import android.view.SurfaceHolder; import android.view.View; diff --git a/module_camera/src/main/java/com/ailiwean/core/view/ZxingCameraView.kt b/module_camera/src/main/java/com/ailiwean/core/view/ZxingCameraView.kt index 4f46452..6883c63 100644 --- a/module_camera/src/main/java/com/ailiwean/core/view/ZxingCameraView.kt +++ b/module_camera/src/main/java/com/ailiwean/core/view/ZxingCameraView.kt @@ -149,7 +149,7 @@ abstract class ZxingCameraView @JvmOverloads constructor(context: Context, attri fun initConfig() { ableCollect?.loadAble() scan_bar.startAnim() - qr_loc.visibility = View.GONE + qr_loc.visibility = View.INVISIBLE initScanType() handleZX.init() VibrateHelper.playInit() diff --git a/module_camera/src/main/java/com/google/android/cameraview/CameraView.java b/module_camera/src/main/java/com/google/android/cameraview/CameraView.java index a315606..ea2e0d3 100644 --- a/module_camera/src/main/java/com/google/android/cameraview/CameraView.java +++ b/module_camera/src/main/java/com/google/android/cameraview/CameraView.java @@ -187,10 +187,10 @@ protected void onDetachedFromWindow() { @Override protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { -// if (isInEditMode()) { -// super.onMeasure(widthMeasureSpec, heightMeasureSpec); -// return; -// } + if (isInEditMode()) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + return; + } // Handle android:adjustViewBounds // if (mAdjustViewBounds) { // if (!isCameraOpened()) {