diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2008-10-21 07:00:00 -0700 |
commit | 1d4c75065966c4f6f56900e31f655bfd1b334435 (patch) | |
tree | 5d4526db3153daa63087fcb9384f8bc0659fbd18 /src/com/android/camera/CameraSettings.java | |
download | LegacyCamera-1d4c75065966c4f6f56900e31f655bfd1b334435.zip LegacyCamera-1d4c75065966c4f6f56900e31f655bfd1b334435.tar.gz LegacyCamera-1d4c75065966c4f6f56900e31f655bfd1b334435.tar.bz2 |
Initial Contribution
Diffstat (limited to 'src/com/android/camera/CameraSettings.java')
-rw-r--r-- | src/com/android/camera/CameraSettings.java | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java new file mode 100644 index 0000000..fb77e34 --- /dev/null +++ b/src/com/android/camera/CameraSettings.java @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2007 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.camera; + +import android.content.SharedPreferences; +import android.os.Bundle; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.content.Context; + +/** + * CameraSettings + */ +class CameraSettings extends PreferenceActivity +{ + public CameraSettings() + { + } + + protected int resourceId() { + return R.xml.camera_preferences; + } + + /** Called with the activity is first created. */ + @Override + public void onCreate(Bundle icicle) + { + super.onCreate(icicle); + addPreferencesFromResource(resourceId()); + + Preference p = findPreference("pref_camera_upload_albumname_key"); + if (p != null) { + SharedPreferences sp = p.getSharedPreferences(); + p.setSummary( + String.format(getResources().getString(R.string.pref_camera_upload_albumname_summary), + p.getSharedPreferences().getString(p.getKey(), UploadService.sUploadAlbumName))); + p.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() { + public boolean onPreferenceChange(Preference p, Object newObjValue) { + String newValue = (String) newObjValue; + if (newValue == null || newValue.length() == 0) + return false; + if (android.util.Config.LOGV) + android.util.Log.v("camera", "onPreferenceChange ... " + newValue); + p.setSummary(String.format(getResources().getString(R.string.pref_camera_upload_albumname_summary), newValue)); + return true; + } + }); + } + } +} + |