Another enum bites the dust. NotificationIconSet.

pull/14/head
Tim Su 16 years ago
parent 02bf2223fc
commit ade7846578

@ -52,12 +52,14 @@
<item>Time to shorten your todo list!</item>
</string-array>
<!-- Icons for notification tray -->
<string-array name="notif_icon_entries">
<item>Pink</item>
<item>Boring</item>
<item>Astrid</item>
</string-array>
<!-- Corresponding to the constants in Preferences.java -->
<string-array name="notif_icon_values">
<item>0</item>
<item>1</item>

@ -404,10 +404,10 @@ public class Notifications extends BroadcastReceiver {
String appName = r.getString(R.string.app_name);
int icon;
switch(Preferences.getNotificationIconTheme(context)) {
case PINK:
case Preferences.ICON_SET_PINK:
icon = R.drawable.notif_pink_alarm;
break;
case BORING:
case Preferences.ICON_SET_BORING:
icon = R.drawable.notif_boring_alarm;
break;
default:
@ -481,10 +481,10 @@ public class Notifications extends BroadcastReceiver {
// create notification object
int icon;
switch(Preferences.getNotificationIconTheme(context)) {
case PINK:
case Preferences.ICON_SET_PINK:
icon = R.drawable.notif_pink_working;
break;
case BORING:
case Preferences.ICON_SET_BORING:
icon = R.drawable.notif_boring_working;
break;
default:

@ -22,11 +22,9 @@ public class Preferences {
private static final String P_SYNC_LAST_SYNC = "lastsync";
// pref values
public enum NotificationIconTheme {
PINK,
BORING,
ASTRID
}
public static final int ICON_SET_PINK = 0;
public static final int ICON_SET_BORING = 1;
public static final int ICON_SET_ASTRID = 2;
// default values
private static final boolean DEFAULT_PERSISTENCE_MODE = true;
@ -129,11 +127,11 @@ public class Preferences {
}
/** returns hour at which quiet hours start, or null if not set */
public static NotificationIconTheme getNotificationIconTheme(Context context) {
public static int getNotificationIconTheme(Context context) {
Integer index = getIntegerValue(context, R.string.p_notif_icon);
if(index == null)
index = 0;
return NotificationIconTheme.values()[index];
return index;
}
/** Get notification ring tone, or null if not set */

Loading…
Cancel
Save