summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/ModuleSwitcher.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/android/camera/ui/ModuleSwitcher.java')
-rw-r--r--src/com/android/camera/ui/ModuleSwitcher.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/com/android/camera/ui/ModuleSwitcher.java b/src/com/android/camera/ui/ModuleSwitcher.java
index 60fed24ad..3f9ccd5ec 100644
--- a/src/com/android/camera/ui/ModuleSwitcher.java
+++ b/src/com/android/camera/ui/ModuleSwitcher.java
@@ -52,6 +52,7 @@ public class ModuleSwitcher extends RotateImageView
public static final int WIDE_ANGLE_PANO_MODULE_INDEX = 2;
public static final int LIGHTCYCLE_MODULE_INDEX = 3;
public static final int GCAM_MODULE_INDEX = 4;
+ private boolean mTouchEnabled = true;
private static final int[] DRAW_IDS = {
R.drawable.ic_switch_camera,
@@ -146,6 +147,20 @@ public class ModuleSwitcher extends RotateImageView
}
@Override
+ public boolean dispatchTouchEvent(MotionEvent m) {
+ if (mTouchEnabled) {
+ return super.dispatchTouchEvent(m);
+ } else {
+ setBackground(null);
+ return false;
+ }
+ }
+
+ public void enableTouch(boolean enable) {
+ mTouchEnabled = enable;
+ }
+
+ @Override
public void onClick(View v) {
showSwitcher();
mListener.onShowSwitcherPopup();
@@ -254,6 +269,16 @@ public class ModuleSwitcher extends RotateImageView
mParent.setOnTouchListener(null);
}
+ public void removePopup() {
+ mShowingPopup = false;
+ setVisibility(View.VISIBLE);
+ if (mPopup != null) {
+ ((ViewGroup) mParent).removeView(mPopup);
+ mPopup = null;
+ }
+ setAlpha(1f);
+ }
+
@Override
public void onConfigurationChanged(Configuration config) {
if (showsPopup()) {