优化细节

This commit is contained in:
Jenly
2021-04-25 11:22:05 +08:00
parent 28922aa74b
commit 63f78fd8e6
4 changed files with 4 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ public class AmbientLightManager implements SensorEventListener {
*/
private float darkLightLux = DARK_LUX;
/**
* 光线足够亮时,默认:照度450 lux
* 光线足够亮时,默认:照度100 lux
*/
private float brightLightLux = BRIGHT_LUX;

View File

@@ -10,7 +10,6 @@ import com.king.zxing.analyze.AreaRectAnalyzer;
import com.king.zxing.analyze.BarcodeFormatAnalyzer;
import com.king.zxing.analyze.ImageAnalyzer;
import com.king.zxing.analyze.MultiFormatAnalyzer;
import com.king.zxing.util.LogUtils;
import androidx.annotation.Nullable;
import androidx.camera.core.CameraSelector;

View File

@@ -152,7 +152,7 @@ public class DefaultCameraScan extends CameraScan {
mScreenWidth = displayMetrics.widthPixels;
mScreenHeight = displayMetrics.heightPixels;
LogUtils.d(String.format("screenSize: %d * %d",mScreenWidth,mScreenHeight));
LogUtils.d(String.format("displayMetrics:%dx%d",mScreenWidth,mScreenHeight));
//因为为了保持流畅性和性能限制在1080p在此前提下尽可能的找到屏幕接近的分辨率
if(mScreenWidth < mScreenHeight){
float ratio = mScreenWidth / (float)mScreenHeight;
@@ -169,6 +169,7 @@ public class DefaultCameraScan extends CameraScan {
mTargetSize = new Size(mScreenHeight / 9 * 16, mScreenHeight);
}
}
LogUtils.d("targetSize:" + mTargetSize);
mBeepManager = new BeepManager(mContext);
mAmbientLightManager = new AmbientLightManager(mContext);

View File

@@ -103,7 +103,7 @@ public class LogUtils {
String tag = TAG_FORMAT;
String callerClazzName = caller.getClassName();
callerClazzName = callerClazzName.substring(callerClazzName.lastIndexOf(".") + 1);
tag = String.format(tag,new Object[] { callerClazzName, caller.getMethodName(),caller.getFileName(),Integer.valueOf(caller.getLineNumber()) });
tag = String.format(tag,callerClazzName, caller.getMethodName(),caller.getFileName(),caller.getLineNumber());
return new StringBuilder().append(TAG).append(VERTICAL).append(tag).toString();
}