summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/CountDownTimerPreference.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2013-05-08 11:14:35 -0700
committerMichael Kolb <kolby@google.com>2013-05-08 14:17:25 -0700
commit7048972374474dfca142856583833d8168d3b1b6 (patch)
tree2bede13e277042c4b1d667feff8af8b93a501c79 /src/com/android/camera/CountDownTimerPreference.java
parent0815098550dd4158386d059b04de7f13fb415620 (diff)
downloadandroid_packages_apps_Snap-7048972374474dfca142856583833d8168d3b1b6.tar.gz
android_packages_apps_Snap-7048972374474dfca142856583833d8168d3b1b6.tar.bz2
android_packages_apps_Snap-7048972374474dfca142856583833d8168d3b1b6.zip
Fix second level menu
Bug: 8857098 Added Countdown timer and picture size items Change-Id: I73f3a5b22ab708e216729ed77fbd60041d40147d
Diffstat (limited to 'src/com/android/camera/CountDownTimerPreference.java')
-rw-r--r--src/com/android/camera/CountDownTimerPreference.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/com/android/camera/CountDownTimerPreference.java b/src/com/android/camera/CountDownTimerPreference.java
index 0bbf6bc9d..9c66dda8c 100644
--- a/src/com/android/camera/CountDownTimerPreference.java
+++ b/src/com/android/camera/CountDownTimerPreference.java
@@ -21,25 +21,20 @@ import android.util.AttributeSet;
import com.android.gallery3d.R;
-import java.util.List;
-
-/* CountDownTimerPreference generates entries (i.e. what users see in the UI),
- * and entry values (the actual value recorded in preference) in
- * initCountDownTimeChoices(Context context), rather than reading the entries
- * from a predefined list. When the entry values are a continuous list of numbers,
- * (e.g. 0-60), it is more efficient to auto generate the list than to predefine it.*/
public class CountDownTimerPreference extends ListPreference {
- private final static int MAX_DURATION = 60;
+ private static final int[] DURATIONS = {
+ 0, 1, 2, 3, 4, 5, 10, 15, 20, 30, 60
+ };
public CountDownTimerPreference(Context context, AttributeSet attrs) {
super(context, attrs);
initCountDownDurationChoices(context);
}
private void initCountDownDurationChoices(Context context) {
- CharSequence[] entryValues = new CharSequence[MAX_DURATION + 1];
- CharSequence[] entries = new CharSequence[MAX_DURATION + 1];
- for (int i = 0; i <= MAX_DURATION; i++) {
- entryValues[i] = Integer.toString(i);
+ CharSequence[] entryValues = new CharSequence[DURATIONS.length];
+ CharSequence[] entries = new CharSequence[DURATIONS.length];
+ for (int i = 0; i < DURATIONS.length; i++) {
+ entryValues[i] = Integer.toString(DURATIONS[i]);
if (i == 0) {
entries[0] = context.getString(R.string.setting_off); // Off
} else {