Updated the colors / font sizes, and made the notifications un-clearable.

pull/14/head
Tim Su 16 years ago
parent 472610429f
commit d879e63129

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timsu.astrid"
android:versionCode="33"
android:versionName="1.9.7">
android:versionCode="34"
android:versionName="1.9.8">
<uses-permission android:name="android.permission.VIBRATE"/>

@ -20,7 +20,7 @@
-->
<resources>
<color name="task_list_overdue">#F09EA6</color>
<color name="task_list_overdue">#FF340A</color>
<color name="task_list_done">#ff777777</color>
<color name="taskList_dueDateOverdue">#ffFFBF9E</color>
@ -32,9 +32,9 @@
<color name="view_table_values">#ffbbbbbb</color>
<color name="view_table_overdue">#ffff0000</color>
<color name="importance_1">#ffcff09e</color>
<color name="importance_2">#ffa8dba8</color>
<color name="importance_3">#ff79bd9a</color>
<color name="importance_4">#ff439898</color>
<color name="importance_1">#fffff75c</color>
<color name="importance_2">#ffa1b4ff</color>
<color name="importance_3">#ff5274ff</color>
<color name="importance_4">#ff0033ff</color>
</resources>

@ -200,10 +200,17 @@
<!-- Preference Keys -->
<skip />
<string name="p_notif_quietStart">notif_qstart</string>
<string name="p_notif_quietEnd">notif_qend</string>
<string name="key_notification_ringtone">notification_ringtone</string>
<string name="p_notif_quietStart">notif_qstart</string>
<string name="p_notif_quietEnd">notif_qend</string>
<string name="p_notif_annoy">notif_annoy</string>
<string name="key_notification_ringtone">notification_ringtone</string>
<string name="prefs_quietStart_title">Quiet Hours Start</string>
<string name="prefs_quietStart_desc">Starting hour when Astrid should be quiet (e.g. 22)</string>
<string name="prefs_quietEnd_title">Quiet Hours End</string>
<string name="prefs_quietEnd_desc">Ending hour when Astrid should be quiet (e.g. 08)</string>
<string name="prefs_annoy_title">Persistence Mode</string>
<string name="prefs_annoy_desc">If checked, Astrid will try harder to get your attention.</string>
<string name="prefs_notification_title">Notification Ringtone</string>
<string name="prefs_notification_desc">Choose how Astrid alerts you!</string>
</resources>

@ -29,7 +29,7 @@
</style>
<style name="TextAppearance.TaskList_Task">
<item name="android:textSize">24sp</item>
<item name="android:textSize">26sp</item>
<item name="android:textStyle">bold</item>
<item name="android:textColor">@android:color/white</item>
</style>

@ -3,12 +3,16 @@
xmlns:android="http://schemas.android.com/apk/res/android">
<EditTextPreference
android:key="@string/p_notif_quietStart"
android:title="Quiet Hours Start"
android:summary="Starting hour when Astrid should be quiet (e.g. 22)" />
android:title="@string/prefs_quietStart_title"
android:summary="@string/prefs_quietStart_desc" />
<EditTextPreference
android:key="@string/p_notif_quietEnd"
android:title="Quiet Hours End"
android:summary="Ending hour when Astrid should be quiet (e.g. 08)" />
android:title="@string/prefs_quietEnd_title"
android:summary="@string/prefs_quietEnd_desc" />
<CheckBoxPreference
android:key="@string/p_notif_annoy"
android:title="@string/prefs_annoy_title"
android:summary="@string/prefs_annoy_desc" />
<RingtonePreference
android:key="@string/key_notification_ringtone"
android:title="@string/prefs_notification_title"

@ -293,7 +293,9 @@ public class Notifications extends BroadcastReceiver {
return false;
// it's hidden - don't sound, don't delete
if(task.getHiddenUntil() != null && task.getHiddenUntil().after(new Date()))
if(task.getHiddenUntil() != null &&
task.getHiddenUntil().after(new Date()) &&
(flags & FLAG_PERIODIC) > 0)
return true;
taskName = task.getName();
@ -310,11 +312,12 @@ public class Notifications extends BroadcastReceiver {
controller.close();
}
// quiet hours?
// quiet hours? only for periodic reminders
boolean quietHours = false;
Integer quietHoursStart = Preferences.getQuietHourStart(context);
Integer quietHoursEnd = Preferences.getQuietHourEnd(context);
if(quietHoursStart != null && quietHoursEnd != null) {
if(quietHoursStart != null && quietHoursEnd != null &&
(flags & FLAG_PERIODIC) > 0) {
int hour = new Date().getHours();
if(quietHoursStart < quietHoursEnd) {
if(hour >= quietHoursStart && hour < quietHoursEnd)
@ -346,6 +349,8 @@ public class Notifications extends BroadcastReceiver {
appName,
reminder + " " + taskName,
pendingIntent);
if(Preferences.isPersistenceMode(context))
notification.flags |= Notification.FLAG_NO_CLEAR;
notification.defaults = Notification.DEFAULT_LIGHTS;
if(quietHours) {
notification.vibrate = null;

@ -11,12 +11,27 @@ import com.timsu.astrid.R;
public class Preferences {
private static String CURRENT_VERSION = "cv";
private static final String CURRENT_VERSION = "cv";
private static final boolean DEFAULT_PERSISTENCE_MODE = true;
private static SharedPreferences getPrefs(Context context) {
return PreferenceManager.getDefaultSharedPreferences(context);
}
/** Set preference defaults, if unset. called at startup */
public static void setPreferenceDefaults(Context context) {
SharedPreferences prefs = getPrefs(context);
Resources r = context.getResources();
Editor editor = prefs.edit();
if(!prefs.contains(r.getString(R.string.p_notif_annoy))) {
editor.putBoolean(r.getString(R.string.p_notif_annoy),
DEFAULT_PERSISTENCE_MODE);
}
editor.commit();
}
public static int getCurrentVersion(Context context) {
return getPrefs(context).getInt(CURRENT_VERSION, 0);
}
@ -52,7 +67,8 @@ public class Preferences {
return null;
}
}
/** Get notification ringtone, or null if not set */
public static Uri getNotificationRingtone(Context context) {
Resources r = context.getResources();
String value = getPrefs(context).getString(r.getString(
@ -64,4 +80,11 @@ public class Preferences {
return null;
}
}
/** Get perstence mode setting */
public static boolean isPersistenceMode(Context context) {
Resources r = context.getResources();
return getPrefs(context).getBoolean(r.getString(
R.string.p_notif_annoy), DEFAULT_PERSISTENCE_MODE);
}
}

@ -39,6 +39,8 @@ public class StartupReceiver extends BroadcastReceiver {
Preferences.setCurrentVersion(context, version);
}
Preferences.setPreferenceDefaults(context);
hasStartedUp = true;
}
}

Loading…
Cancel
Save