diff options
Diffstat (limited to 'src/com/android/camera/WideAnglePanoramaModule.java')
-rw-r--r-- | src/com/android/camera/WideAnglePanoramaModule.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java index 9c44f5c6d..424d8490d 100644 --- a/src/com/android/camera/WideAnglePanoramaModule.java +++ b/src/com/android/camera/WideAnglePanoramaModule.java @@ -69,7 +69,8 @@ public class WideAnglePanoramaModule extends BaseModule<WideAnglePanoramaUI> imp WideAnglePanoramaController, SurfaceTexture.OnFrameAvailableListener { - public static final int DEFAULT_SWEEP_ANGLE = 160; + public static final int DEFAULT_SWEEP_ANGLE_PORTRAIT = 160; + public static final int DEFAULT_SWEEP_ANGLE_LANDSCAPE = 270; public static final int DEFAULT_BLEND_MODE = Mosaic.BLENDTYPE_HORIZONTAL; public static final int DEFAULT_CAPTURE_PIXELS = 1440 * 1080; @@ -576,6 +577,9 @@ public class WideAnglePanoramaModule extends BaseModule<WideAnglePanoramaUI> imp parameters.setAutoWhiteBalanceLock(true); configureCamera(parameters); + final int sweepAngle = (mDeviceOrientation == 90 || mDeviceOrientation == 270) ? + DEFAULT_SWEEP_ANGLE_LANDSCAPE : DEFAULT_SWEEP_ANGLE_PORTRAIT; + mMosaicFrameProcessor.setProgressListener(new MosaicFrameProcessor.ProgressListener() { @Override public void onProgress(boolean isFinished, float panningRateX, float panningRateY, @@ -584,8 +588,8 @@ public class WideAnglePanoramaModule extends BaseModule<WideAnglePanoramaUI> imp float accumulatedVerticalAngle = progressY * mVerticalViewAngle; boolean isRotated = !(mDeviceOrientationAtCapture == mDeviceOrientation); if (isFinished - || (Math.abs(accumulatedHorizontalAngle) >= DEFAULT_SWEEP_ANGLE) - || (Math.abs(accumulatedVerticalAngle) >= DEFAULT_SWEEP_ANGLE) + || (Math.abs(accumulatedHorizontalAngle) >= sweepAngle) + || (Math.abs(accumulatedVerticalAngle) >= sweepAngle) || isRotated) { stopCapture(false); } else { @@ -605,7 +609,7 @@ public class WideAnglePanoramaModule extends BaseModule<WideAnglePanoramaUI> imp mUI.resetCaptureProgress(); // TODO: calculate the indicator width according to different devices to reflect the actual // angle of view of the camera device. - mUI.setMaxCaptureProgress(DEFAULT_SWEEP_ANGLE); + mUI.setMaxCaptureProgress(sweepAngle); mUI.showCaptureProgress(); mDeviceOrientationAtCapture = mDeviceOrientation; keepScreenOn(); |