From 6aebaa5e9af89581c5d07fef27c1a17e127673f9 Mon Sep 17 00:00:00 2001 From: Alok Kediya Date: Sat, 28 Sep 2013 18:13:32 +0530 Subject: Camera: Some of the options in the Camera settings are getting selected only when we tap on it twice We are maintaining the popup dialog level in a variable and based on that top level popup is dismissed and the previous popup will be displayed. (cherrypicked from commit 6b8a6e50b48432572ce80ca753b3fe1bab87191a) Change-Id: I6876c5663047eb0d3ec1ce64af6182be0b5bd79c (cherry picked from commit f147ea11ff0b993f8aa5e335065c88051341ab8d) (cherry picked from commit 591973b04ca5444bc644e1ad1f02ea0b5b237d86) --- src/com/android/camera/PhotoMenu.java | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/com/android/camera/PhotoMenu.java b/src/com/android/camera/PhotoMenu.java index b3eb83375..7e60cd950 100644 --- a/src/com/android/camera/PhotoMenu.java +++ b/src/com/android/camera/PhotoMenu.java @@ -56,6 +56,7 @@ public class PhotoMenu extends PieController private int mPopupStatus; private AbstractSettingPopup mPopup; private CameraActivity mActivity; + private int popupNum = 0; public PhotoMenu(CameraActivity activity, PhotoUI ui, PieRenderer pie) { super(activity, pie); @@ -72,6 +73,7 @@ public class PhotoMenu extends PieController mPopup3 = null; mPopupStatus = POPUP_NONE; PieItem item = null; + popupNum = 0; final Resources res = mActivity.getResources(); Locale locale = res.getConfiguration().locale; // The order is from left to right in the menu. @@ -151,6 +153,7 @@ public class PhotoMenu extends PieController mPopupStatus = POPUP_FIRST_LEVEL; } mUI.showPopup(mPopup1); + popupNum = 1; } }); mRenderer.addItem(item1); @@ -164,7 +167,8 @@ public class PhotoMenu extends PieController initializePopup(); mPopupStatus = POPUP_FIRST_LEVEL; } - mUI.showPopup(mPopup2); + mUI.showPopup(mPopup2); + popupNum = 2; } }); mRenderer.addItem(item2); @@ -179,7 +183,7 @@ public class PhotoMenu extends PieController mPopupStatus = POPUP_FIRST_LEVEL; } mUI.showPopup(mPopup3); - mPopupStatus = POPUP_FIRST_LEVEL; + popupNum = 3; } }); mRenderer.addItem(item3); @@ -252,16 +256,22 @@ public class PhotoMenu extends PieController } public void popupDismissed() { - // the popup gets dismissed - if (mPopup1 != null) { - mPopup1 = null; - } - if (mPopup2 != null) { - mPopup2 = null; - } - if (mPopup3 != null) { - mPopup3 = null; + if (mPopupStatus == POPUP_SECOND_LEVEL) { + initializePopup(); + mPopupStatus = POPUP_FIRST_LEVEL; + if (popupNum == 1) + mUI.showPopup(mPopup1); + else if (popupNum == 2) + mUI.showPopup(mPopup2); + else if (popupNum == 3) + mUI.showPopup(mPopup3); + if(mPopup1 != null) mPopup1 = null; + if(mPopup2 != null) mPopup2 = null; + if(mPopup3 != null) mPopup3 = null; + } else { + initializePopup(); } + } @Override -- cgit v1.2.3