优化细节(#194)

This commit is contained in:
Jenly
2022-06-06 09:54:27 +08:00
parent 7a06d371cc
commit 650f62e3c7

View File

@@ -115,15 +115,6 @@ public class ViewfinderView extends View {
*/ */
public int scannerEnd = 0; public int scannerEnd = 0;
/**
* 扫码初始框宽
*/
private int initFrameWidth;
/**
* 扫码初始框高
*/
private int initFrameHeight;
/** /**
* 扫码框宽 * 扫码框宽
*/ */
@@ -289,8 +280,8 @@ public class ViewfinderView extends View {
labelTextWidth = array.getDimensionPixelSize(R.styleable.ViewfinderView_labelTextWidth,0); labelTextWidth = array.getDimensionPixelSize(R.styleable.ViewfinderView_labelTextWidth,0);
labelTextLocation = TextLocation.getFromInt(array.getInt(R.styleable.ViewfinderView_labelTextLocation,0)); labelTextLocation = TextLocation.getFromInt(array.getInt(R.styleable.ViewfinderView_labelTextLocation,0));
initFrameWidth = array.getDimensionPixelSize(R.styleable.ViewfinderView_frameWidth,0); frameWidth = array.getDimensionPixelSize(R.styleable.ViewfinderView_frameWidth,0);
initFrameHeight = array.getDimensionPixelSize(R.styleable.ViewfinderView_frameHeight,0); frameHeight = array.getDimensionPixelSize(R.styleable.ViewfinderView_frameHeight,0);
laserStyle = LaserStyle.getFromInt(array.getInt(R.styleable.ViewfinderView_laserStyle,LaserStyle.LINE.mValue)); laserStyle = LaserStyle.getFromInt(array.getInt(R.styleable.ViewfinderView_laserStyle,LaserStyle.LINE.mValue));
gridColumn = array.getInt(R.styleable.ViewfinderView_gridColumn,20); gridColumn = array.getInt(R.styleable.ViewfinderView_gridColumn,20);
@@ -358,11 +349,11 @@ public class ViewfinderView extends View {
int size = (int)(Math.min(width,height) * frameRatio); int size = (int)(Math.min(width,height) * frameRatio);
if(initFrameWidth <= 0 || initFrameWidth > width){ if(frameWidth <= 0 || frameWidth > width){
frameWidth = size; frameWidth = size;
} }
if(initFrameHeight <= 0 || initFrameHeight > height){ if(frameHeight <= 0 || frameHeight > height){
frameHeight = size; frameHeight = size;
} }