发布v3.2.0
This commit is contained in:
@@ -25,11 +25,11 @@ android {
|
||||
}
|
||||
compileOptions {
|
||||
coreLibraryDesugaringEnabled true
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_11.toString()
|
||||
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
||||
}
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
|
||||
Binary file not shown.
@@ -11,8 +11,8 @@
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"attributes": [],
|
||||
"versionCode": 41,
|
||||
"versionName": "3.1.1",
|
||||
"versionCode": 42,
|
||||
"versionName": "3.2.0",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -33,7 +33,10 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
/**
|
||||
* 生成条形码/二维码示例
|
||||
* @author Jenly <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
*
|
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
* <p>
|
||||
* <a href="https://github.com/jenly1314">Follow me</a>
|
||||
*/
|
||||
public class CodeActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
@@ -16,7 +16,10 @@ import com.king.zxing.analyze.QRCodeAnalyzer
|
||||
|
||||
/**
|
||||
* 扫二维码全屏识别示例
|
||||
*
|
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
* <p>
|
||||
* <a href="https://github.com/jenly1314">Follow me</a>
|
||||
*/
|
||||
class FullScreenQRCodeScanActivity : BarcodeCameraScanActivity() {
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.provider.MediaStore;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.Toast;
|
||||
@@ -28,7 +29,6 @@ import androidx.core.app.ActivityCompat;
|
||||
import androidx.core.app.ActivityOptionsCompat;
|
||||
|
||||
import com.king.camera.scan.CameraScan;
|
||||
import com.king.camera.scan.util.LogUtils;
|
||||
import com.king.zxing.util.CodeUtils;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -36,9 +36,14 @@ import java.util.concurrent.Executors;
|
||||
|
||||
/**
|
||||
* 扫码示例
|
||||
*
|
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
* <p>
|
||||
* <a href="https://github.com/jenly1314">Follow me</a>
|
||||
*/
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
private static final String TAG = "MainActivity";
|
||||
public static final String KEY_TITLE = "key_title";
|
||||
public static final String KEY_IS_QR_CODE = "key_code";
|
||||
|
||||
@@ -88,8 +93,10 @@ public class MainActivity extends AppCompatActivity {
|
||||
//异步解析
|
||||
asyncThread(() -> {
|
||||
final String result = CodeUtils.parseCode(bitmap);
|
||||
// 如果只需识别二维码,建议使用:parseQRCode;(因为识别的格式越明确,误识别率越低。)
|
||||
// final String result = CodeUtils.parseQRCode(bitmap);
|
||||
runOnUiThread(() -> {
|
||||
LogUtils.d("result:" + result);
|
||||
Log.d(TAG, "result:" + result);
|
||||
showToast(result);
|
||||
});
|
||||
|
||||
|
||||
@@ -11,7 +11,10 @@ import com.king.zxing.analyze.MultiFormatAnalyzer
|
||||
|
||||
/**
|
||||
* 连续扫码(识别多种格式)示例
|
||||
*
|
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
* <p>
|
||||
* <a href="https://github.com/jenly1314">Follow me</a>
|
||||
*/
|
||||
class MultiFormatScanActivity : BarcodeCameraScanActivity() {
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import com.king.camera.scan.analyze.Analyzer;
|
||||
import com.king.zxing.DecodeConfig;
|
||||
import com.king.zxing.DecodeFormatManager;
|
||||
import com.king.zxing.BarcodeCameraScanActivity;
|
||||
import com.king.zxing.analyze.MultiFormatAnalyzer;
|
||||
import com.king.zxing.analyze.QRCodeAnalyzer;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -17,7 +18,10 @@ import androidx.annotation.Nullable;
|
||||
|
||||
/**
|
||||
* 扫二维码识别示例
|
||||
*
|
||||
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
|
||||
* <p>
|
||||
* <a href="https://github.com/jenly1314">Follow me</a>
|
||||
*/
|
||||
public class QRCodeScanActivity extends BarcodeCameraScanActivity {
|
||||
|
||||
@@ -38,8 +42,8 @@ public class QRCodeScanActivity extends BarcodeCameraScanActivity {
|
||||
.setAreaRectRatio(0.8f)//设置识别区域比例,默认0.8,设置的比例最终会在预览区域裁剪基于此比例的一个矩形进行扫码识别
|
||||
.setAreaRectVerticalOffset(0)//设置识别区域垂直方向偏移量,默认为0,为0表示居中,可以为负数
|
||||
.setAreaRectHorizontalOffset(0);//设置识别区域水平方向偏移量,默认为0,为0表示居中,可以为负数
|
||||
// BarcodeCameraScanActivity默认使用的MultiFormatAnalyzer,这里可以改为使用QRCodeAnalyzer
|
||||
return new QRCodeAnalyzer(decodeConfig);
|
||||
// BarcodeCameraScanActivity默认使用的MultiFormatAnalyzer,这里也可以改为使用QRCodeAnalyzer
|
||||
return new MultiFormatAnalyzer(decodeConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user