Update PreviewImpl.java

pull/1/head
android-dataticket 8 years ago committed by GitHub
parent e04fb369a6
commit 5ca35cdd35
  1. 8
      camerakit/src/main/base/com/flurgle/camerakit/PreviewImpl.java

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

Loading…
Cancel
Save