summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/VideoMenu.java
diff options
context:
space:
mode:
authorAlok Kediya <kediya@codeaurora.org>2013-09-28 17:17:09 +0530
committerLinux Build Service Account <lnxbuild@localhost>2013-10-31 19:39:38 -0600
commitc9271fa7e19cf43ec0e8473b08759e5c4f84798b (patch)
tree1f4cb5a893b15f17638e456add42631a95ff44c4 /src/com/android/camera/VideoMenu.java
parentd8887ed7c40a161431c6b4db32dddcb46859692f (diff)
downloadandroid_packages_apps_Snap-c9271fa7e19cf43ec0e8473b08759e5c4f84798b.tar.gz
android_packages_apps_Snap-c9271fa7e19cf43ec0e8473b08759e5c4f84798b.tar.bz2
android_packages_apps_Snap-c9271fa7e19cf43ec0e8473b08759e5c4f84798b.zip
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)
Diffstat (limited to 'src/com/android/camera/VideoMenu.java')
-rw-r--r--src/com/android/camera/VideoMenu.java30
1 files changed, 20 insertions, 10 deletions
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;
}