Another enum bites the dust. NotificationIconSet.

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

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

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

@ -22,11 +22,9 @@ public class Preferences {
private static final String P_SYNC_LAST_SYNC = "lastsync"; private static final String P_SYNC_LAST_SYNC = "lastsync";
// pref values // pref values
public enum NotificationIconTheme { public static final int ICON_SET_PINK = 0;
PINK, public static final int ICON_SET_BORING = 1;
BORING, public static final int ICON_SET_ASTRID = 2;
ASTRID
}
// default values // default values
private static final boolean DEFAULT_PERSISTENCE_MODE = true; 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 */ /** 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); Integer index = getIntegerValue(context, R.string.p_notif_icon);
if(index == null) if(index == null)
index = 0; index = 0;
return NotificationIconTheme.values()[index]; return index;
} }
/** Get notification ring tone, or null if not set */ /** Get notification ring tone, or null if not set */

Loading…
Cancel
Save