Skip to content

Commit

Permalink
1.更新 DevEngine 部分代码
Browse files Browse the repository at this point in the history
  • Loading branch information
afkT committed Sep 2, 2021
1 parent bc8bde8 commit 8290c37
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import dev.engine.barcode.listener.BarCodeEncodeCallback;
import dev.utils.LogPrintUtils;
import dev.utils.common.StringUtils;
import dev.utils.common.thread.DevThreadManager;
import dev.utils.common.thread.DevThreadPool;

/**
* detail: ZXing BarCode Engine 实现
Expand All @@ -28,10 +28,10 @@ public class ZXingEngineImpl
// 日志 TAG
private final String TAG = ZXingEngineImpl.class.getSimpleName();

// 线程数量
private final int THREAD_NUMBER = 6;
// 线程池 ( 构建类 )
private final DevThreadPool DEV_THREAD_POOL = new DevThreadPool(6);
// 默认条码配置
private final BarCodeConfig DEFAULT_CONFIG = new BarCodeConfig().defaultEncode();
private final BarCodeConfig DEFAULT_CONFIG = new BarCodeConfig().defaultEncode();
// 当前条码配置
private BarCodeConfig mBarCodeConfig;

Expand Down Expand Up @@ -63,7 +63,7 @@ public void encodeBarCode(
encodeFailureCallback(callback, error);
return;
}
DevThreadManager.getInstance(THREAD_NUMBER).execute(() -> {
DEV_THREAD_POOL.execute(() -> {
try {
Bitmap bitmap = encodeBarCodeSync(params);
// 条码嵌入 icon、logo
Expand Down Expand Up @@ -123,7 +123,7 @@ public void decodeBarCode(
decodeFailureCallback(callback, new Exception("BarCode decode Bitmap is null"));
return;
}
DevThreadManager.getInstance(THREAD_NUMBER).execute(() -> {
DEV_THREAD_POOL.execute(() -> {
try {
BarCodeResult result = decodeBarCodeSync(bitmap);
// 触发回调
Expand Down

0 comments on commit 8290c37

Please sign in to comment.