diff options
author | Chih-Chung Chang <chihchung@google.com> | 2011-10-31 21:04:26 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-10-31 21:04:26 -0700 |
commit | 4d55f6cb82c07a6191d2ab8e78fbab8c31e9db89 (patch) | |
tree | f7007626855a37ab067e9b44c310da43d343c06b /src | |
parent | 174b8b7fc4d55e8c63eb3ed0b71f1519a13e345d (diff) | |
parent | 30e2c49eedfbce51be7458161829a750f809d56d (diff) | |
download | LegacyCamera-4d55f6cb82c07a6191d2ab8e78fbab8c31e9db89.zip LegacyCamera-4d55f6cb82c07a6191d2ab8e78fbab8c31e9db89.tar.gz LegacyCamera-4d55f6cb82c07a6191d2ab8e78fbab8c31e9db89.tar.bz2 |
Merge "Remove long pressing shutter triggers autocous." into ics-mr0
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/camera/Camera.java | 12 | ||||
-rw-r--r-- | src/com/android/camera/FocusManager.java | 23 | ||||
-rwxr-xr-x | src/com/android/camera/ShutterButton.java | 23 |
3 files changed, 3 insertions, 55 deletions
diff --git a/src/com/android/camera/Camera.java b/src/com/android/camera/Camera.java index 1bedb4f..8898510 100644 --- a/src/com/android/camera/Camera.java +++ b/src/com/android/camera/Camera.java @@ -82,7 +82,7 @@ public class Camera extends ActivityBase implements FocusManager.Listener, View.OnTouchListener, ShutterButton.OnShutterButtonListener, SurfaceHolder.Callback, ModePicker.OnModeChangeListener, FaceDetectionListener, CameraPreference.OnPreferenceChangedListener, - LocationManager.Listener, ShutterButton.OnShutterButtonLongPressListener { + LocationManager.Listener { private static final String TAG = "camera"; @@ -370,7 +370,6 @@ public class Camera extends ActivityBase implements FocusManager.Listener, // Initialize shutter button. mShutterButton = (ShutterButton) findViewById(R.id.shutter_button); mShutterButton.setOnShutterButtonListener(this); - mShutterButton.setOnShutterButtonLongPressListener(this); mShutterButton.setVisibility(View.VISIBLE); // Initialize focus UI. @@ -1393,15 +1392,6 @@ public class Camera extends ActivityBase implements FocusManager.Listener, mFocusManager.doSnap(); } - @Override - public void onShutterButtonLongPressed() { - if (mPausing || mCameraState == SNAPSHOT_IN_PROGRESS - || mCameraDevice == null || mPicturesRemaining <= 0) return; - - Log.v(TAG, "onShutterButtonLongPressed"); - mFocusManager.shutterLongPressed(); - } - private OnScreenHint mStorageHint; private void updateStorageHint() { diff --git a/src/com/android/camera/FocusManager.java b/src/com/android/camera/FocusManager.java index 86b92c2..72ea8b5 100644 --- a/src/com/android/camera/FocusManager.java +++ b/src/com/android/camera/FocusManager.java @@ -56,7 +56,6 @@ public class FocusManager { private boolean mInitialized; private boolean mFocusAreaSupported; - private boolean mInLongPress; private boolean mLockAeAwbNeeded; private boolean mAeAwbLock; private Matrix mMatrix; @@ -174,22 +173,6 @@ public class FocusManager { } } - public void shutterLongPressed() { - if (Parameters.FOCUS_MODE_CONTINUOUS_PICTURE.equals(mFocusMode) - && isSupported(Parameters.FOCUS_MODE_AUTO, mParameters.getSupportedFocusModes())) { - if (mState == STATE_IDLE || mState == STATE_FOCUSING_SNAP_ON_FINISH) { - Log.e(TAG, "Invalid focus state=" + mState); - } - mInLongPress = true; - // Cancel any outstanding Auto focus requests. The auto focus mode - // will be changed from CAF to auto in cancelAutoFocus. - onShutterUp(); - // Call Autofocus - onShutterDown(); - mInLongPress = false; - } - } - public void doSnap() { if (!mInitialized) return; @@ -379,11 +362,7 @@ public class FocusManager { public String getFocusMode() { if (mOverrideFocusMode != null) return mOverrideFocusMode; - if (mInLongPress) { - // Users long-press the shutter button in CAF. Change it to auto - // mode, so it will do a full scan. - mFocusMode = Parameters.FOCUS_MODE_AUTO; - } else if (mFocusAreaSupported && mFocusArea != null) { + if (mFocusAreaSupported && mFocusArea != null) { // Always use autofocus in tap-to-focus. mFocusMode = Parameters.FOCUS_MODE_AUTO; } else { diff --git a/src/com/android/camera/ShutterButton.java b/src/com/android/camera/ShutterButton.java index ace154e..c7f792a 100755 --- a/src/com/android/camera/ShutterButton.java +++ b/src/com/android/camera/ShutterButton.java @@ -26,7 +26,7 @@ import android.widget.ImageView; * It's currently an {@code ImageView} that can call a delegate when the * pressed state changes. */ -public class ShutterButton extends ImageView implements View.OnLongClickListener { +public class ShutterButton extends ImageView { /** * A callback to be invoked when a ShutterButton's pressed state changes. */ @@ -40,30 +40,17 @@ public class ShutterButton extends ImageView implements View.OnLongClickListener void onShutterButtonClick(); } - /** - * A callback to be invoked when a ShutterButton's long pressed. - */ - public interface OnShutterButtonLongPressListener { - void onShutterButtonLongPressed(); - } - private OnShutterButtonListener mListener; - private OnShutterButtonLongPressListener mLongPressListener; private boolean mOldPressed; public ShutterButton(Context context, AttributeSet attrs) { super(context, attrs); - setOnLongClickListener(this); } public void setOnShutterButtonListener(OnShutterButtonListener listener) { mListener = listener; } - public void setOnShutterButtonLongPressListener(OnShutterButtonLongPressListener listener) { - mLongPressListener = listener; - } - /** * Hook into the drawable state changing to get changes to isPressed -- the * onPressed listener doesn't always get called when the pressed state @@ -122,12 +109,4 @@ public class ShutterButton extends ImageView implements View.OnLongClickListener } return result; } - - @Override - public boolean onLongClick(View v) { - if (mLongPressListener != null) { - mLongPressListener.onShutterButtonLongPressed(); - } - return false; - } } |