From c9271fa7e19cf43ec0e8473b08759e5c4f84798b Mon Sep 17 00:00:00 2001 From: Alok Kediya Date: Sat, 28 Sep 2013 17:17:09 +0530 Subject: Camera: Fix issue with dialog box in camera settings Dialog box is not getting closed even after clicking on "done" button in camera and camcorder settings. This change fixes this issue. (cherrypicked from commit b9f6f18ba263bb36a0bf03cfafb8b91a659cb2e5) Change-Id: Icf5afbb399e5abf93d19a9112200d507355662e6 (cherry picked from commit 2408d38f98dd692b972ec25d10a11bd0d6c15747) (cherry picked from commit e82ce8f4cb6ecd3e702087b4989832dd8a265601) --- src/com/android/camera/VideoMenu.java | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'src/com/android/camera/VideoMenu.java') diff --git a/src/com/android/camera/VideoMenu.java b/src/com/android/camera/VideoMenu.java index 12e6970b3..03196020c 100644 --- a/src/com/android/camera/VideoMenu.java +++ b/src/com/android/camera/VideoMenu.java @@ -38,15 +38,15 @@ public class VideoMenu extends PieController private VideoUI mUI; private String[] mOtherKeys1; private String[] mOtherKeys2; - private MoreSettingPopup mPopup1; - private MoreSettingPopup mPopup2; - private AbstractSettingPopup mPopup; + private AbstractSettingPopup mPopup1; + private AbstractSettingPopup mPopup2; private static final int POPUP_NONE = 0; private static final int POPUP_FIRST_LEVEL = 1; private static final int POPUP_SECOND_LEVEL = 2; private int mPopupStatus; + private int popupNum; private CameraActivity mActivity; public VideoMenu(CameraActivity activity, VideoUI ui, PieRenderer pie) { @@ -57,9 +57,9 @@ public class VideoMenu extends PieController public void initialize(PreferenceGroup group) { super.initialize(group); - mPopup = null; mPopup1 = null; mPopup2 = null; + popupNum = 0; mPopupStatus = POPUP_NONE; PieItem item = null; // settings popup @@ -93,6 +93,7 @@ public class VideoMenu extends PieController mPopupStatus = POPUP_FIRST_LEVEL; } mUI.showPopup(mPopup1); + popupNum = 1; } }); mRenderer.addItem(item1); @@ -107,6 +108,7 @@ public class VideoMenu extends PieController mPopupStatus = POPUP_FIRST_LEVEL; } mUI.showPopup(mPopup2); + popupNum = 2; } }); mRenderer.addItem(item2); @@ -159,11 +161,12 @@ public class VideoMenu extends PieController @Override public void overrideSettings(final String ... keyvalues) { super.overrideSettings(keyvalues); - if (mPopup == null || mPopupStatus != POPUP_FIRST_LEVEL) { + if (((mPopup1 == null) && (mPopup2 == null)) || mPopupStatus != POPUP_FIRST_LEVEL) { mPopupStatus = POPUP_FIRST_LEVEL; initializePopup(); } - ((MoreSettingPopup) mPopup).overrideSettings(keyvalues); + ((MoreSettingPopup) mPopup1).overrideSettings(keyvalues); + ((MoreSettingPopup) mPopup2).overrideSettings(keyvalues); } @Override @@ -172,6 +175,8 @@ public class VideoMenu extends PieController if (mPopup1 != null && mPopup2 != null) { if (mPopupStatus == POPUP_SECOND_LEVEL) { mUI.dismissPopup(true); + mPopup1.reloadPreference(); + mPopup2.reloadPreference(); } } super.onSettingChanged(pref); @@ -203,7 +208,12 @@ public class VideoMenu extends PieController if (mPopupStatus == POPUP_SECOND_LEVEL) { initializePopup(); mPopupStatus = POPUP_FIRST_LEVEL; - if (topPopupOnly) mUI.showPopup(mPopup); + if (topPopupOnly) { + if(popupNum == 1) mUI.showPopup(mPopup1); + else if(popupNum == 2) mUI.showPopup(mPopup2); + } + } else { + initializePopup(); } } @@ -222,16 +232,16 @@ public class VideoMenu extends PieController timeInterval.initialize((IconListPreference) pref); timeInterval.setSettingChangedListener(this); mUI.dismissPopup(true); - mPopup = timeInterval; + mPopup1 = timeInterval; } else { ListPrefSettingPopup basic = (ListPrefSettingPopup) inflater.inflate( R.layout.list_pref_setting_popup, null, false); basic.initialize(pref); basic.setSettingChangedListener(this); mUI.dismissPopup(true); - mPopup = basic; + mPopup1 = basic; } - mUI.showPopup(mPopup); + mUI.showPopup(mPopup1); mPopupStatus = POPUP_SECOND_LEVEL; } -- cgit v1.2.3