diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-09-09 05:34:37 +0800 |
---|---|---|
committer | Wu-cheng Li <wuchengli@google.com> | 2011-09-12 06:51:35 +0800 |
commit | 0bb4487fcc7601118111d4545c31dae04651b456 (patch) | |
tree | bbc11b712e5029bc4b7eef0170a8ebf83cf32e75 /src | |
parent | e164996caf656a9b966e828dee5296c5b328f364 (diff) | |
download | LegacyCamera-0bb4487fcc7601118111d4545c31dae04651b456.zip LegacyCamera-0bb4487fcc7601118111d4545c31dae04651b456.tar.gz LegacyCamera-0bb4487fcc7601118111d4545c31dae04651b456.tar.bz2 |
Disable zoom and shutter button during video snapshot.
bug:5274338
Change-Id: I4a0f578535075ff37a92f642fd2a7bc6343d3357
Diffstat (limited to 'src')
6 files changed, 28 insertions, 5 deletions
diff --git a/src/com/android/camera/VideoCamera.java b/src/com/android/camera/VideoCamera.java index 33430f5..fdd79ef 100644 --- a/src/com/android/camera/VideoCamera.java +++ b/src/com/android/camera/VideoCamera.java @@ -922,6 +922,7 @@ public class VideoCamera extends ActivityBase CameraHolder.instance().release(); mCameraDevice = null; mPreviewing = false; + mSnapshotInProgress = false; } private void finishRecorderAndCloseCamera() { @@ -2180,9 +2181,11 @@ public class VideoCamera extends ActivityBase } } - void showVideoSnapshotUI(boolean enable) { + void showVideoSnapshotUI(boolean enabled) { if (mParameters.isVideoSnapshotSupported() && !mIsVideoCaptureIntent) { - mPreviewBorder.setVisibility(enable ? View.VISIBLE : View.INVISIBLE); + mPreviewBorder.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE); + mIndicatorControlContainer.enableZoom(!enabled); + mShutterButton.setEnabled(!enabled); } } diff --git a/src/com/android/camera/ui/IndicatorControlBar.java b/src/com/android/camera/ui/IndicatorControlBar.java index 773645f..ff986ee 100644 --- a/src/com/android/camera/ui/IndicatorControlBar.java +++ b/src/com/android/camera/ui/IndicatorControlBar.java @@ -111,8 +111,12 @@ public class IndicatorControlBar extends IndicatorControl implements mSecondLevelIcon.setVisibility(enabled ? View.VISIBLE : View.INVISIBLE); } else { // We also disable the zoom button during snapshot. - if (mZoomIcon != null) mZoomIcon.setEnabled(enabled); + enableZoom(enabled); } mSecondLevelIcon.setEnabled(enabled); } + + public void enableZoom(boolean enabled) { + if (mZoomIcon != null) mZoomIcon.setEnabled(enabled); + } } diff --git a/src/com/android/camera/ui/IndicatorControlBarContainer.java b/src/com/android/camera/ui/IndicatorControlBarContainer.java index 0783065..b06c63f 100644 --- a/src/com/android/camera/ui/IndicatorControlBarContainer.java +++ b/src/com/android/camera/ui/IndicatorControlBarContainer.java @@ -164,4 +164,9 @@ public class IndicatorControlBarContainer extends IndicatorControlContainer mIndicatorControlBar.setEnabled(enabled); mSecondLevelIndicatorControlBar.setEnabled(enabled); } + + @Override + public void enableZoom(boolean enabled) { + mIndicatorControlBar.enableZoom(enabled); + } } diff --git a/src/com/android/camera/ui/IndicatorControlContainer.java b/src/com/android/camera/ui/IndicatorControlContainer.java index 2e6711f..552c551 100644 --- a/src/com/android/camera/ui/IndicatorControlContainer.java +++ b/src/com/android/camera/ui/IndicatorControlContainer.java @@ -30,4 +30,5 @@ public abstract class IndicatorControlContainer extends IndicatorControl { super(context, attrs); } + public abstract void enableZoom(boolean enabled); } diff --git a/src/com/android/camera/ui/IndicatorControlWheel.java b/src/com/android/camera/ui/IndicatorControlWheel.java index 9be34b5..f3f869a 100644 --- a/src/com/android/camera/ui/IndicatorControlWheel.java +++ b/src/com/android/camera/ui/IndicatorControlWheel.java @@ -258,7 +258,8 @@ public class IndicatorControlWheel extends IndicatorControl implements if ((index != -1) && (action != MotionEvent.ACTION_MOVE)) { View view = getChildAt(index); // Switch to zoom control only if a touch down event is received. - if ((view == mZoomIcon) && (action == MotionEvent.ACTION_DOWN)) { + if ((view == mZoomIcon) && (action == MotionEvent.ACTION_DOWN) + && mZoomIcon.isEnabled()) { mPressedIndex = -1; mOnIndicatorEventListener.onIndicatorEvent( OnIndicatorEventListener.EVENT_ENTER_ZOOM_CONTROL); @@ -477,12 +478,16 @@ public class IndicatorControlWheel extends IndicatorControl implements requestLayout(); } else { // We also disable the zoom button during snapshot. - if (mZoomIcon != null) mZoomIcon.setEnabled(enabled); + enableZoom(enabled); } mSecondLevelIcon.setEnabled(enabled); mCloseIcon.setEnabled(enabled); } + public void enableZoom(boolean enabled) { + if (mZoomIcon != null) mZoomIcon.setEnabled(enabled); + } + public void onTouchOutBound() { dismissSettingPopup(); if (mPressedIndex != -1) { diff --git a/src/com/android/camera/ui/IndicatorControlWheelContainer.java b/src/com/android/camera/ui/IndicatorControlWheelContainer.java index b7b338f..4e2a03e 100644 --- a/src/com/android/camera/ui/IndicatorControlWheelContainer.java +++ b/src/com/android/camera/ui/IndicatorControlWheelContainer.java @@ -214,6 +214,11 @@ public class IndicatorControlWheelContainer extends IndicatorControlContainer } @Override + public void enableZoom(boolean enabled) { + mIndicatorControlWheel.enableZoom(enabled); + } + + @Override public void overrideSettings(final String ... keyvalues) { mIndicatorControlWheel.overrideSettings(keyvalues); } |