summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/WideAnglePanoramaModule.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/WideAnglePanoramaModule.java')
-rw-r--r--src/com/android/camera/WideAnglePanoramaModule.java11
1 files changed, 11 insertions, 0 deletions
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);