优化细节
This commit is contained in:
@@ -20,6 +20,8 @@ ZXingLite for Android 是ZXing的精简版,基于ZXing库优化扫码和生成
|
|||||||
## Gif 展示
|
## Gif 展示
|
||||||

|

|
||||||
|
|
||||||
|
> 你也可以直接下载 [演示App](https://raw.githubusercontent.com/jenly1314/ZXingLite/master/app/release/app-release.apk) 体验效果
|
||||||
|
|
||||||
|
|
||||||
## ViewfinderView属性说明
|
## ViewfinderView属性说明
|
||||||
| 属性 | 值类型 | 默认值 | 说明 |
|
| 属性 | 值类型 | 默认值 | 说明 |
|
||||||
@@ -319,7 +321,7 @@ compileOptions {
|
|||||||
* 更新CameraX至v1.0.1
|
* 更新CameraX至v1.0.1
|
||||||
* 优化CameraConfig的一些默认配置
|
* 优化CameraConfig的一些默认配置
|
||||||
|
|
||||||
#### v2.1.0:2021-6-30 (从v2.1.0开始不再发布至JCenter)
|
#### v2.1.0:2021-6-30 (从v2.1.0开始发布至 MavenCentral)
|
||||||
* 更新CameraX至v1.0.0
|
* 更新CameraX至v1.0.0
|
||||||
* 优化细节
|
* 优化细节
|
||||||
|
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import com.king.zxing.DecodeConfig;
|
|||||||
import com.king.zxing.DecodeFormatManager;
|
import com.king.zxing.DecodeFormatManager;
|
||||||
import com.king.zxing.analyze.MultiFormatAnalyzer;
|
import com.king.zxing.analyze.MultiFormatAnalyzer;
|
||||||
import com.king.zxing.app.util.StatusBarUtils;
|
import com.king.zxing.app.util.StatusBarUtils;
|
||||||
|
import com.king.zxing.config.ResolutionCameraConfig;
|
||||||
|
|
||||||
|
|
||||||
import androidx.appcompat.widget.Toolbar;
|
import androidx.appcompat.widget.Toolbar;
|
||||||
@@ -76,7 +77,8 @@ public class CustomCaptureActivity extends CaptureActivity {
|
|||||||
//获取CameraScan,里面有扫码相关的配置设置。CameraScan里面包含部分支持链式调用的方法,即调用返回是CameraScan本身的一些配置建议在startCamera之前调用。
|
//获取CameraScan,里面有扫码相关的配置设置。CameraScan里面包含部分支持链式调用的方法,即调用返回是CameraScan本身的一些配置建议在startCamera之前调用。
|
||||||
getCameraScan().setPlayBeep(true)//设置是否播放音效,默认为false
|
getCameraScan().setPlayBeep(true)//设置是否播放音效,默认为false
|
||||||
.setVibrate(true)//设置是否震动,默认为false
|
.setVibrate(true)//设置是否震动,默认为false
|
||||||
.setCameraConfig(new CameraConfig())//设置相机配置信息,CameraConfig可覆写options方法自定义配置
|
// .setCameraConfig(new CameraConfig())//设置相机配置信息,CameraConfig可覆写options方法自定义配置
|
||||||
|
.setCameraConfig(new ResolutionCameraConfig(this))//设置CameraConfig,可以根据自己的需求去自定义配置
|
||||||
.setNeedAutoZoom(false)//二维码太小时可自动缩放,默认为false
|
.setNeedAutoZoom(false)//二维码太小时可自动缩放,默认为false
|
||||||
.setNeedTouchZoom(true)//支持多指触摸捏合缩放,默认为true
|
.setNeedTouchZoom(true)//支持多指触摸捏合缩放,默认为true
|
||||||
.setDarkLightLux(45f)//设置光线足够暗的阈值(单位:lux),需要通过{@link #bindFlashlightView(View)}绑定手电筒才有效
|
.setDarkLightLux(45f)//设置光线足够暗的阈值(单位:lux),需要通过{@link #bindFlashlightView(View)}绑定手电筒才有效
|
||||||
|
|||||||
13
build.gradle
13
build.gradle
@@ -1,9 +1,14 @@
|
|||||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
|
|
||||||
apply from: 'versions.gradle'
|
apply from: 'versions.gradle'
|
||||||
|
|
||||||
addRepos(repositories)
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "com.android.tools.build:gradle:$versions.gralde"
|
classpath "com.android.tools.build:gradle:$versions.gralde"
|
||||||
@@ -16,7 +21,11 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
addRepos(repositories)
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
jcenter() // Warning: this repository is going to shut down soon
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
task clean(type: Delete) {
|
||||||
|
|||||||
@@ -77,8 +77,3 @@ deps.easypermissions = "pub.devrel:easypermissions:$versions.easypermissions"
|
|||||||
|
|
||||||
ext.deps = deps
|
ext.deps = deps
|
||||||
|
|
||||||
def addRepos(RepositoryHandler handler) {
|
|
||||||
handler.google()
|
|
||||||
handler.jcenter()
|
|
||||||
}
|
|
||||||
ext.addRepos = this.&addRepos
|
|
||||||
Reference in New Issue
Block a user