summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-17 04:40:22 -0400
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-17 04:40:22 -0400
commit83c371d93f9513d317fcabb5783cce5091274c34 (patch)
treefa6996002c16864c12ea44e09c49aaf016dc3438 /src/com/android/camera
parentd53b8e8554655db159f972e30d60f2a830f5bc97 (diff)
parent922273ca16db7bf57cf5a2910f5cbe9439aa5f57 (diff)
downloadLegacyCamera-83c371d93f9513d317fcabb5783cce5091274c34.zip
LegacyCamera-83c371d93f9513d317fcabb5783cce5091274c34.tar.gz
LegacyCamera-83c371d93f9513d317fcabb5783cce5091274c34.tar.bz2
Merge change 25454 into eclair
* changes: Fix a bug that if user close the settings directly from sub menu. The summary in main menu will not be updated.
Diffstat (limited to 'src/com/android/camera')
-rw-r--r--src/com/android/camera/OnScreenSettings.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/com/android/camera/OnScreenSettings.java b/src/com/android/camera/OnScreenSettings.java
index a040abc..b61e6a7 100644
--- a/src/com/android/camera/OnScreenSettings.java
+++ b/src/com/android/camera/OnScreenSettings.java
@@ -47,6 +47,7 @@ public class OnScreenSettings {
private ListView mSubMenu;
private boolean mIsVisible = false;
private OnVisibilityChangedListener mVisibilityListener;
+ private MainMenuAdapter mMainAdapter;
/**
* When showing the on-screen settings, we add the view as a new window.
@@ -110,6 +111,8 @@ public class OnScreenSettings {
mIsVisible = visible;
if (visible) {
+ // Update main adapter before show up
+ if (mMainAdapter != null) mMainAdapter.notifyDataSetChanged();
if (mContainerLayoutParams.token == null) {
mContainerLayoutParams.token = mOwnerView.getWindowToken();
}
@@ -171,10 +174,6 @@ public class OnScreenSettings {
private void closeSubMenu() {
Util.slideOut(mSubMenu, Util.DIRECTION_RIGHT);
Util.slideIn(mMainMenu, Util.DIRECTION_LEFT);
-
- // The data could be changed in the sub menu, so we update the summary
- // in the main menu here
- ((MainMenuAdapter) mMainMenu.getAdapter()).notifyDataSetChanged();
}
private Container createContainer() {
@@ -232,9 +231,9 @@ public class OnScreenSettings {
for (int i = 0, n = screen.getPreferenceCount(); i < n; ++i) {
addPreference(screen.getPreference(i), list);
}
- MainMenuAdapter mainAdapter = new MainMenuAdapter(mContext, list);
- mMainMenu.setAdapter(mainAdapter);
- mMainMenu.setOnItemClickListener(mainAdapter);
+ mMainAdapter = new MainMenuAdapter(mContext, list);
+ mMainMenu.setAdapter(mMainAdapter);
+ mMainMenu.setOnItemClickListener(mMainAdapter);
}
private View inflateIfNeed(
@@ -427,6 +426,7 @@ public class OnScreenSettings {
if (idx != position - 1) {
mPreference.setValueIndex(position - 1);
notifyDataSetChanged();
+ mMainAdapter.notifyDataSetChanged();
return;
}
}