summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CameraSettings.java
diff options
context:
space:
mode:
authorWu-cheng Li <>2009-04-09 23:46:15 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-04-09 23:46:15 -0700
commit9dacf7b214339440c16f3d66e12d6afef1248f68 (patch)
tree64b46e58e70c4e4e45c7bcf2096d6cd492cae900 /src/com/android/camera/CameraSettings.java
parent0e841fe509c3b61ced7ddf4bee4728b382eae62f (diff)
downloadLegacyCamera-9dacf7b214339440c16f3d66e12d6afef1248f68.zip
LegacyCamera-9dacf7b214339440c16f3d66e12d6afef1248f68.tar.gz
LegacyCamera-9dacf7b214339440c16f3d66e12d6afef1248f68.tar.bz2
AI 145679: Add picture size settings.
BUG=1761248 Automated import of CL 145679
Diffstat (limited to 'src/com/android/camera/CameraSettings.java')
-rw-r--r--src/com/android/camera/CameraSettings.java25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index fc87524..8d0075a 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -37,11 +37,13 @@ public class CameraSettings extends PreferenceActivity implements
public static final String KEY_WHITE_BALANCE =
"pref_camera_whitebalance_key";
public static final String KEY_EFFECT = "pref_camera_effect_key";
+ public static final String KEY_PICTURE_SIZE = "pref_camera_picturesize_key";
public static final boolean DEFAULT_VIDEO_QUALITY_VALUE = true;
private ListPreference mVideoQuality;
private ListPreference mWhiteBalance;
private ListPreference mEffect;
+ private ListPreference mPictureSize;
private Parameters mParameters;
@Override
@@ -59,12 +61,14 @@ public class CameraSettings extends PreferenceActivity implements
updateVideoQualitySummary();
updateWhiteBalanceSummary();
updateEffectSummary();
+ updatePictureSizeSummary();
}
private void initUI() {
mVideoQuality = (ListPreference) findPreference(KEY_VIDEO_QUALITY);
mWhiteBalance = (ListPreference) findPreference(KEY_WHITE_BALANCE);
mEffect = (ListPreference) findPreference(KEY_EFFECT);
+ mPictureSize = (ListPreference) findPreference(KEY_PICTURE_SIZE);
getPreferenceScreen().getSharedPreferences().
registerOnSharedPreferenceChangeListener(this);
@@ -82,13 +86,24 @@ public class CameraSettings extends PreferenceActivity implements
createSettings(mEffect, Camera.SUPPORTED_EFFECT,
R.array.pref_camera_effect_entries,
R.array.pref_camera_effect_entryvalues);
+
+ // Create picture size settings.
+ createSettings(mPictureSize, Camera.SUPPORTED_PICTURE_SIZE,
+ R.array.pref_camera_picturesize_entries,
+ R.array.pref_camera_picturesize_entryvalues);
}
private void createSettings(
ListPreference pref, String paramName, int prefEntriesResId,
int prefEntryValuesResId) {
- // Get the supported parameter settings.
+ // Disable the preference if the parameter is not supported.
String supportedParamStr = mParameters.get(paramName);
+ if (supportedParamStr == null) {
+ pref.setEnabled(false);
+ return;
+ }
+
+ // Get the supported parameter settings.
StringTokenizer tokenizer = new StringTokenizer(supportedParamStr, ",");
ArrayList<CharSequence> supportedParam = new ArrayList<CharSequence>();
while (tokenizer.hasMoreElements()) {
@@ -127,15 +142,17 @@ public class CameraSettings extends PreferenceActivity implements
}
private void updateWhiteBalanceSummary() {
- // Set preference summary.
mWhiteBalance.setSummary(mWhiteBalance.getEntry());
}
private void updateEffectSummary() {
- // Set preference summary.
mEffect.setSummary(mEffect.getEntry());
}
+ private void updatePictureSizeSummary() {
+ mPictureSize.setSummary(mPictureSize.getEntry());
+ }
+
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
String key) {
if (key.equals(KEY_VIDEO_QUALITY)) {
@@ -144,6 +161,8 @@ public class CameraSettings extends PreferenceActivity implements
updateWhiteBalanceSummary();
} else if (key.equals(KEY_EFFECT)) {
updateEffectSummary();
+ } else if (key.equals(KEY_PICTURE_SIZE)) {
+ updatePictureSizeSummary();
}
}
}