summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/ui/OtherSettingsPopup.java
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-05-09 20:27:46 +0800
committerWu-cheng Li <wuchengli@google.com>2011-05-10 18:49:03 +0800
commitd50b09687918ae1c89e9c19175e217910b330c60 (patch)
treeedbbe5e0fd3f79d08506ee55608b45876e864a4f /src/com/android/camera/ui/OtherSettingsPopup.java
parent15e50f3db82768bc6952a2007eeba3d354e37b5c (diff)
downloadpackages_apps_LegacyCamera-d50b09687918ae1c89e9c19175e217910b330c60.zip
packages_apps_LegacyCamera-d50b09687918ae1c89e9c19175e217910b330c60.tar.gz
packages_apps_LegacyCamera-d50b09687918ae1c89e9c19175e217910b330c60.tar.bz2
Refactor IndicatorWheel.
Combine BasicSettingPopup and OtherSettingsPopup in indicatorWheel for the preparation of adding share button. bug:4391419 Change-Id: I684890a9bf47611f25fe0f70faa0f08e6485d620
Diffstat (limited to 'src/com/android/camera/ui/OtherSettingsPopup.java')
-rw-r--r--src/com/android/camera/ui/OtherSettingsPopup.java33
1 files changed, 16 insertions, 17 deletions
diff --git a/src/com/android/camera/ui/OtherSettingsPopup.java b/src/com/android/camera/ui/OtherSettingsPopup.java
index 018eb1c..920d270 100644
--- a/src/com/android/camera/ui/OtherSettingsPopup.java
+++ b/src/com/android/camera/ui/OtherSettingsPopup.java
@@ -41,12 +41,6 @@ public class OtherSettingsPopup extends AbstractSettingPopup
implements InLineSettingPicker.Listener,
AdapterView.OnItemClickListener {
private static final String TAG = "OtherSettingsPopup";
- private static final String[] OTHER_SETTING_KEYS = {
- CameraSettings.KEY_RECORD_LOCATION,
- CameraSettings.KEY_FOCUS_MODE,
- CameraSettings.KEY_EXPOSURE,
- CameraSettings.KEY_PICTURE_SIZE,
- CameraSettings.KEY_JPEG_QUALITY};
private static final String ITEM_KEY = "key";
private static final String ITEM_TITLE = "text";
private static final String ITEM_VALUE = "value";
@@ -100,7 +94,7 @@ public class OtherSettingsPopup extends AbstractSettingPopup
}
}
- public void setOtherSettingChangedListener(Listener listener) {
+ public void setSettingChangedListener(Listener listener) {
mListener = listener;
}
@@ -109,12 +103,12 @@ public class OtherSettingsPopup extends AbstractSettingPopup
mContext = context;
}
- public void initialize(PreferenceGroup group) {
+ public void initialize(PreferenceGroup group, String[] keys) {
mPreferenceGroup = group;
// Prepare the setting items.
- for (int i = 0; i < OTHER_SETTING_KEYS.length; ++i) {
+ for (int i = 0; i < keys.length; ++i) {
HashMap<String, Object> map = new HashMap<String, Object>();
- ListPreference pref = group.findPreference(OTHER_SETTING_KEYS[i]);
+ ListPreference pref = group.findPreference(keys[i]);
if (pref != null) {
map.put(ITEM_KEY, pref);
map.put(ITEM_TITLE, pref.getTitle());
@@ -145,14 +139,18 @@ public class OtherSettingsPopup extends AbstractSettingPopup
}
// Scene mode can override other camera settings (ex: flash mode).
- public void overrideSettings(String key, String value) {
+ public void overrideSettings(final String ... keyvalues) {
int count = mSettingList.getChildCount();
- for (int i = 0; i < count; i++) {
- ListPreference pref = (ListPreference) mListItem.get(i).get(ITEM_KEY);
- if (pref != null && key.equals(pref.getKey())) {
- InLineSettingPicker picker =
- (InLineSettingPicker) mSettingList.getChildAt(i);
- picker.overrideSettings(value);
+ for (int i = 0; i < keyvalues.length; i += 2) {
+ String key = keyvalues[i];
+ String value = keyvalues[i + 1];
+ for (int j = 0; j < count; j++) {
+ ListPreference pref = (ListPreference) mListItem.get(j).get(ITEM_KEY);
+ if (pref != null && key.equals(pref.getKey())) {
+ InLineSettingPicker picker =
+ (InLineSettingPicker) mSettingList.getChildAt(j);
+ picker.overrideSettings(value);
+ }
}
}
}
@@ -165,6 +163,7 @@ public class OtherSettingsPopup extends AbstractSettingPopup
}
}
+ @Override
public void reloadPreference() {
int count = mSettingList.getChildCount();
for (int i = 0; i < count; i++) {