diff options
Diffstat (limited to 'src/com/android/camera/ui/ModuleSwitcher.java')
-rw-r--r-- | src/com/android/camera/ui/ModuleSwitcher.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/com/android/camera/ui/ModuleSwitcher.java b/src/com/android/camera/ui/ModuleSwitcher.java index c0b0e4348..cab75fa7e 100644 --- a/src/com/android/camera/ui/ModuleSwitcher.java +++ b/src/com/android/camera/ui/ModuleSwitcher.java @@ -69,6 +69,7 @@ public class ModuleSwitcher extends RotateImageView { private int[] mModuleIds; private int[][] mDrawAndDescIds; private PopupWindow mPopup; + private boolean mShowingPopup; private LinearLayout mContent; private float mTranslationX; @@ -116,7 +117,7 @@ public class ModuleSwitcher extends RotateImageView { public void setCurrentIndex(int i) { mCurrentIndex = i; - if (i == GCAM_MODULE_INDEX) { + if (i == GCAM_MODULE_INDEX || i == CAPTURE_MODULE_INDEX) { setImageResource(R.drawable.ic_switch_camera); } else { setImageResource(mDrawAndDescIds[i][0]); @@ -185,7 +186,12 @@ public class ModuleSwitcher extends RotateImageView { closePopup(); } + public boolean showsPopup() { + return mShowingPopup; + } + private void showSwitcher() { + mShowingPopup = true; mPopup = getPopup(); mPopup.showAsDropDown(this, ((getWidth() / 2) - (mContent.getMeasuredWidth() / 2)), -(mContent.getMeasuredHeight() + Math.round(0.75f * getHeight())), @@ -193,6 +199,7 @@ public class ModuleSwitcher extends RotateImageView { } public void closePopup() { + mShowingPopup = false; if (mPopup != null) { mPopup.dismiss(); mPopup = null; |