From 0a2a94245c31b628da7c1b1d9153b8db497e0e12 Mon Sep 17 00:00:00 2001 From: Dylan McIntyre Date: Wed, 22 Feb 2017 21:06:07 -0500 Subject: [PATCH] fix flipping camera --- .../src/main/api16/com/flurgle/camerakit/Camera1.java | 7 +++++-- .../src/main/java/com/flurgle/camerakit/CameraView.java | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java b/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java index 0cab6593..119a333b 100644 --- a/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java +++ b/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java @@ -303,6 +303,9 @@ public class Camera1 extends CameraImpl { if (mCamera != null) { mCamera.release(); mCamera = null; + mCameraParameters = null; + mPreviewSize = null; + mCaptureSize = null; mCameraListener.onCameraClosed(); } } @@ -316,12 +319,12 @@ public class Camera1 extends CameraImpl { } private void adjustCameraParameters() { - mCameraParameters.setPreviewSize( + mPreview.setTruePreviewSize( getPreviewResolution().getWidth(), getPreviewResolution().getHeight() ); - mPreview.setTruePreviewSize( + mCameraParameters.setPreviewSize( getPreviewResolution().getWidth(), getPreviewResolution().getHeight() ); diff --git a/camerakit/src/main/java/com/flurgle/camerakit/CameraView.java b/camerakit/src/main/java/com/flurgle/camerakit/CameraView.java index 20ff48a3..0f724826 100644 --- a/camerakit/src/main/java/com/flurgle/camerakit/CameraView.java +++ b/camerakit/src/main/java/com/flurgle/camerakit/CameraView.java @@ -74,7 +74,6 @@ public class CameraView extends FrameLayout { mFocus = a.getInteger(R.styleable.CameraView_ckFocus, CameraKit.Defaults.DEFAULT_FOCUS); mMethod = a.getInteger(R.styleable.CameraView_ckMethod, CameraKit.Defaults.DEFAULT_METHOD); mZoom = a.getInteger(R.styleable.CameraView_ckZoom, CameraKit.Defaults.DEFAULT_ZOOM); - mJpegQuality = a.getInteger(R.styleable.CameraView_ckJpegQuality, CameraKit.Defaults.DEFAULT_JPEG_QUALITY); mCropOutput = a.getBoolean(R.styleable.CameraView_ckCropOutput, CameraKit.Defaults.DEFAULT_CROP_OUTPUT); mAdjustViewBounds = a.getBoolean(R.styleable.CameraView_android_adjustViewBounds, CameraKit.Defaults.DEFAULT_ADJUST_VIEW_BOUNDS);