|
|
|
@ -61,10 +61,12 @@ abstract class PreviewImpl { |
|
|
|
|
return mHeight; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void setTruePreviewSize(int width, int height) { |
|
|
|
|
void setTruePreviewSize(final int width, final int height) { |
|
|
|
|
this.mTrueWidth = width; |
|
|
|
|
this.mTrueHeight = height; |
|
|
|
|
|
|
|
|
|
((Activity) getView().getContext()).runOnUiThread(new Runnable() { |
|
|
|
|
@Override |
|
|
|
|
public void run() { |
|
|
|
|
if (width != 0 && height != 0) { |
|
|
|
|
AspectRatio aspectRatio = AspectRatio.of(width, height); |
|
|
|
|
int targetHeight = (int) (getView().getWidth() * aspectRatio.toFloat()); |
|
|
|
@ -84,6 +86,8 @@ abstract class PreviewImpl { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int getTrueWidth() { |
|
|
|
|
return mTrueWidth; |
|
|
|
|