A custom ZXing qr code scanning, faster and more applicable
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add the dependency:
dependencies {
implementation 'com.github.sunnydlee:FastZXing:v1.2.1'
}
快速接入方式:
//打开扫描页
Intent intent = new Intent(this, FastCaptureActivity.class);
startActivity(intent);
//设置扫描结果回调
FastZXing.getInstance().setResultCallBack(new CaptureActivity.ResultCallBack() {
@Override
public void decodeResult(String result, CaptureActivity activity) {
if (activity != null) {
activity.restartCameraScan();//重新开启扫描,连续扫描
}
}
});