summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkaiyiz <kaiyiz@codeaurora.org>2014-11-11 11:03:10 +0800
committerkaiyiz <kaiyiz@codeaurora.org>2014-12-16 11:44:56 +0800
commitd7a1b78fdb2ffcdc13427de98bac6aa0787fbc8b (patch)
tree69772740b673d89813b9de0a43a035d0eade5e3c
parentb8a211285617dbecc49cf391db9219d82f38bdfd (diff)
downloadandroid_packages_apps_Snap-d7a1b78fdb2ffcdc13427de98bac6aa0787fbc8b.tar.gz
android_packages_apps_Snap-d7a1b78fdb2ffcdc13427de98bac6aa0787fbc8b.tar.bz2
android_packages_apps_Snap-d7a1b78fdb2ffcdc13427de98bac6aa0787fbc8b.zip
SnapdragonCamera: fix app crash when switch to camcorder
Camera app crash when switch to camcorder during continuously shooting. Prohibition click event when continuously shooting. CRs-Fixed: 744811 Change-Id: Ia51ca53d46e060c2a4f4e877c37f795526532be7
-rw-r--r--src/com/android/camera/PhotoUI.java9
-rw-r--r--src/com/android/camera/VideoUI.java6
-rw-r--r--src/com/android/camera/WideAnglePanoramaUI.java7
-rw-r--r--src/com/android/camera/ui/ModuleSwitcher.java6
4 files changed, 24 insertions, 4 deletions
diff --git a/src/com/android/camera/PhotoUI.java b/src/com/android/camera/PhotoUI.java
index 48fb2f704..90234c620 100644
--- a/src/com/android/camera/PhotoUI.java
+++ b/src/com/android/camera/PhotoUI.java
@@ -280,6 +280,15 @@ public class PhotoUI implements PieListener,
mSwitcher = (ModuleSwitcher) mRootView.findViewById(R.id.camera_switcher);
mSwitcher.setCurrentIndex(ModuleSwitcher.PHOTO_MODULE_INDEX);
mSwitcher.setSwitchListener(mActivity);
+ mSwitcher.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ if (mController.getCameraState() == PhotoController.LONGSHOT) {
+ return;
+ }
+ mSwitcher.showPopup();
+ }
+ });
mMenuButton = mRootView.findViewById(R.id.menu);
mCameraControls = (CameraControls) mRootView.findViewById(R.id.camera_controls);
ViewStub faceViewStub = (ViewStub) mRootView
diff --git a/src/com/android/camera/VideoUI.java b/src/com/android/camera/VideoUI.java
index 3e23fca83..8a0eb8858 100644
--- a/src/com/android/camera/VideoUI.java
+++ b/src/com/android/camera/VideoUI.java
@@ -238,6 +238,12 @@ public class VideoUI implements PieRenderer.PieListener,
mSwitcher = (ModuleSwitcher) mRootView.findViewById(R.id.camera_switcher);
mSwitcher.setCurrentIndex(ModuleSwitcher.VIDEO_MODULE_INDEX);
mSwitcher.setSwitchListener(mActivity);
+ mSwitcher.setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mSwitcher.showPopup();
+ }
+ });
initializeMiscControls();
initializeControlByIntent();
diff --git a/src/com/android/camera/WideAnglePanoramaUI.java b/src/com/android/camera/WideAnglePanoramaUI.java
index 8f9643971..14cacfb9b 100644
--- a/src/com/android/camera/WideAnglePanoramaUI.java
+++ b/src/com/android/camera/WideAnglePanoramaUI.java
@@ -115,6 +115,13 @@ public class WideAnglePanoramaUI implements
mActivity.gotoGallery();
}
});
+
+ mSwitcher.setOnClickListener(new View.OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ mSwitcher.showPopup();
+ }
+ });
}
public void onStartCapture() {
diff --git a/src/com/android/camera/ui/ModuleSwitcher.java b/src/com/android/camera/ui/ModuleSwitcher.java
index 3f9ccd5ec..6c20da497 100644
--- a/src/com/android/camera/ui/ModuleSwitcher.java
+++ b/src/com/android/camera/ui/ModuleSwitcher.java
@@ -41,7 +41,7 @@ import com.android.camera.util.UsageStatistics;
import org.codeaurora.snapcam.R;
public class ModuleSwitcher extends RotateImageView
- implements OnClickListener, OnTouchListener {
+ implements OnTouchListener {
@SuppressWarnings("unused")
private static final String TAG = "CAM_Switcher";
@@ -97,7 +97,6 @@ public class ModuleSwitcher extends RotateImageView
private void init(Context context) {
mItemSize = context.getResources().getDimensionPixelSize(R.dimen.switcher_size);
- setOnClickListener(this);
mIndicator = context.getResources().getDrawable(R.drawable.ic_switcher_menu_indicator);
initializeDrawables(context);
}
@@ -160,8 +159,7 @@ public class ModuleSwitcher extends RotateImageView
mTouchEnabled = enable;
}
- @Override
- public void onClick(View v) {
+ public void showPopup() {
showSwitcher();
mListener.onShowSwitcherPopup();
}