优化细节
This commit is contained in:
@@ -38,7 +38,7 @@ public class AmbientLightManager implements SensorEventListener {
|
|||||||
*/
|
*/
|
||||||
private float darkLightLux = DARK_LUX;
|
private float darkLightLux = DARK_LUX;
|
||||||
/**
|
/**
|
||||||
* 光线足够亮时,默认:照度450 lux
|
* 光线足够亮时,默认:照度100 lux
|
||||||
*/
|
*/
|
||||||
private float brightLightLux = BRIGHT_LUX;
|
private float brightLightLux = BRIGHT_LUX;
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import com.king.zxing.analyze.AreaRectAnalyzer;
|
|||||||
import com.king.zxing.analyze.BarcodeFormatAnalyzer;
|
import com.king.zxing.analyze.BarcodeFormatAnalyzer;
|
||||||
import com.king.zxing.analyze.ImageAnalyzer;
|
import com.king.zxing.analyze.ImageAnalyzer;
|
||||||
import com.king.zxing.analyze.MultiFormatAnalyzer;
|
import com.king.zxing.analyze.MultiFormatAnalyzer;
|
||||||
import com.king.zxing.util.LogUtils;
|
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.camera.core.CameraSelector;
|
import androidx.camera.core.CameraSelector;
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ public class DefaultCameraScan extends CameraScan {
|
|||||||
mScreenWidth = displayMetrics.widthPixels;
|
mScreenWidth = displayMetrics.widthPixels;
|
||||||
mScreenHeight = displayMetrics.heightPixels;
|
mScreenHeight = displayMetrics.heightPixels;
|
||||||
|
|
||||||
LogUtils.d(String.format("screenSize: %d * %d",mScreenWidth,mScreenHeight));
|
LogUtils.d(String.format("displayMetrics:%dx%d",mScreenWidth,mScreenHeight));
|
||||||
//因为为了保持流畅性和性能,限制在1080p,在此前提下尽可能的找到屏幕接近的分辨率
|
//因为为了保持流畅性和性能,限制在1080p,在此前提下尽可能的找到屏幕接近的分辨率
|
||||||
if(mScreenWidth < mScreenHeight){
|
if(mScreenWidth < mScreenHeight){
|
||||||
float ratio = mScreenWidth / (float)mScreenHeight;
|
float ratio = mScreenWidth / (float)mScreenHeight;
|
||||||
@@ -169,6 +169,7 @@ public class DefaultCameraScan extends CameraScan {
|
|||||||
mTargetSize = new Size(mScreenHeight / 9 * 16, mScreenHeight);
|
mTargetSize = new Size(mScreenHeight / 9 * 16, mScreenHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
LogUtils.d("targetSize:" + mTargetSize);
|
||||||
|
|
||||||
mBeepManager = new BeepManager(mContext);
|
mBeepManager = new BeepManager(mContext);
|
||||||
mAmbientLightManager = new AmbientLightManager(mContext);
|
mAmbientLightManager = new AmbientLightManager(mContext);
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class LogUtils {
|
|||||||
String tag = TAG_FORMAT;
|
String tag = TAG_FORMAT;
|
||||||
String callerClazzName = caller.getClassName();
|
String callerClazzName = caller.getClassName();
|
||||||
callerClazzName = callerClazzName.substring(callerClazzName.lastIndexOf(".") + 1);
|
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();
|
return new StringBuilder().append(TAG).append(VERTICAL).append(tag).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user