|
|
|
@ -122,6 +122,7 @@ public class CameraView extends FrameLayout { |
|
|
|
|
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { |
|
|
|
|
if (mAdjustViewBounds) { |
|
|
|
|
Size previewSize = getPreviewSize(); |
|
|
|
|
if(previewSize != null) { |
|
|
|
|
if (getLayoutParams().width == LayoutParams.WRAP_CONTENT) { |
|
|
|
|
int height = MeasureSpec.getSize(heightMeasureSpec); |
|
|
|
|
float ratio = (float) height / (float) previewSize.getWidth(); |
|
|
|
@ -141,6 +142,10 @@ public class CameraView extends FrameLayout { |
|
|
|
|
); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec); |
|
|
|
|