From 9f0c71dbd6c9facac9ee352a0ba94bd7f100d923 Mon Sep 17 00:00:00 2001 From: likaid Date: Sat, 21 Mar 2015 09:42:17 +0800 Subject: SnapdragonCamera: Stop panorama capture when move to opposite direction In panorama capture mode, when user moved to the opposite from the original direction, stop the capture and save current picture. Change-Id: I716a08f2fc497301fb8a6c6a124211b855cd9a77 CRs-Fixed: 801022 --- src/com/android/camera/WideAnglePanoramaModule.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/com/android/camera/WideAnglePanoramaModule.java') diff --git a/src/com/android/camera/WideAnglePanoramaModule.java b/src/com/android/camera/WideAnglePanoramaModule.java index e7025a1a7..21f55f36b 100644 --- a/src/com/android/camera/WideAnglePanoramaModule.java +++ b/src/com/android/camera/WideAnglePanoramaModule.java @@ -153,6 +153,8 @@ public class WideAnglePanoramaModule private boolean mPreviewFocused = true; private boolean mPreviewLayoutChanged = false; + private boolean mDirectionChanged = false; + @Override public void onPreviewUIReady() { configMosaicPreview(); @@ -225,9 +227,16 @@ public class WideAnglePanoramaModule new PanoProgressBar.OnDirectionChangeListener() { @Override public void onDirectionChange(int direction) { + if (mDirectionChanged) { + stopCapture(false); + return; + } if (mCaptureState == CAPTURE_STATE_MOSAIC) { mUI.showDirectionIndicators(direction); } + if (direction != PanoProgressBar.DIRECTION_NONE) { + mDirectionChanged = true; + } } }); @@ -583,6 +592,7 @@ public class WideAnglePanoramaModule } private void stopCapture(boolean aborted) { + mDirectionChanged = false; mCaptureState = CAPTURE_STATE_VIEWFINDER; mUI.onStopCapture(); Parameters parameters = mCameraDevice.getParameters(); @@ -758,6 +768,7 @@ public class WideAnglePanoramaModule // This function will be called upon the first camera frame is available. private void reset() { mCaptureState = CAPTURE_STATE_VIEWFINDER; + mDirectionChanged = false; mOrientationLocked = false; mUI.setOrientation(mDeviceOrientation, true); -- cgit v1.2.3