Made Astrid annoying mode use the device's full volume. Also hide postpone menu for tasks w/ no deadlines and stuff.

pull/14/head
Tim Su 17 years ago
parent b4f9d7e086
commit 2698abcdd2

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.timsu.astrid" package="com.timsu.astrid"
android:versionCode="66" android:versionCode="67"
android:versionName="2.0.3"> android:versionName="2.1.0">
<meta-data android:name="com.a0soft.gphone.aTrackDog.webURL" <meta-data android:name="com.a0soft.gphone.aTrackDog.webURL"
android:value="http://www.weloveastrid.com" /> android:value="http://www.weloveastrid.com" />

@ -296,7 +296,7 @@ Wish me luck!\n
<string name="p_notif_annoy">notif_annoy</string> <string name="p_notif_annoy">notif_annoy</string>
<string name="prefs_annoy_title">Persistent Mode</string> <string name="prefs_annoy_title">Persistent Mode</string>
<string name="prefs_annoy_desc">If checked, you must view reminders before clearing them</string> <string name="prefs_annoy_desc">If checked, you must view reminders before clearing them (also LED)</string>
<string name="p_notification_ringtone">notification_ringtone</string> <string name="p_notification_ringtone">notification_ringtone</string>
<string name="prefs_notification_title">Notification Ringtone</string> <string name="prefs_notification_title">Notification Ringtone</string>

@ -163,7 +163,7 @@ public class TaskListAdapter extends ArrayAdapter<TaskModelForList> {
String nameValue = task.getName(); String nameValue = task.getName();
if(task.getHiddenUntil() != null && task.getHiddenUntil().after(new Date())) { if(task.getHiddenUntil() != null && task.getHiddenUntil().after(new Date())) {
nameValue = "(" + r.getString(R.string.taskList_hiddenPrefix) + ") " + nameValue; nameValue = "(" + r.getString(R.string.taskList_hiddenPrefix) + ") " + nameValue;
task.putCachedLabel(KEY_HIDDEN, ""); task.putCachedLabel(KEY_HIDDEN, "y");
} }
cachedResult = nameValue.toString(); cachedResult = nameValue.toString();
task.putCachedLabel(KEY_NAME, cachedResult); task.putCachedLabel(KEY_NAME, cachedResult);
@ -211,7 +211,7 @@ public class TaskListAdapter extends ArrayAdapter<TaskModelForList> {
} else { } else {
taskOverdue = true; taskOverdue = true;
label.append(r.getString(R.string.taskList_overdueBy)).append(" "); label.append(r.getString(R.string.taskList_overdueBy)).append(" ");
task.putCachedLabel(KEY_OVERDUE, ""); task.putCachedLabel(KEY_OVERDUE, "y");
} }
label.append(DateUtilities.getDurationString(r, label.append(DateUtilities.getDurationString(r,
(int)Math.abs(timeLeft/1000), 1)); (int)Math.abs(timeLeft/1000), 1));
@ -401,6 +401,8 @@ public class TaskListAdapter extends ArrayAdapter<TaskModelForList> {
timerTitle = R.string.taskList_context_stopTimer; timerTitle = R.string.taskList_context_stopTimer;
menu.add(position, CONTEXT_TIMER_ID, Menu.NONE, timerTitle); menu.add(position, CONTEXT_TIMER_ID, Menu.NONE, timerTitle);
if(task.getDefiniteDueDate() != null ||
task.getPreferredDueDate() != null)
menu.add(position, CONTEXT_POSTPONE_ID, Menu.NONE, menu.add(position, CONTEXT_POSTPONE_ID, Menu.NONE,
R.string.taskList_context_postpone); R.string.taskList_context_postpone);

@ -59,6 +59,9 @@ public class TaskModelForRepeat extends AbstractTaskModel implements Notifiable
setPreferredDueDate(repeatInfo.shiftDate(getPreferredDueDate())); setPreferredDueDate(repeatInfo.shiftDate(getPreferredDueDate()));
setProgressPercentage(0); setProgressPercentage(0);
// set elapsed time to 0... yes, we're losing data
setElapsedSeconds(0);
// if no deadlines set, create one (so users don't get confused) // if no deadlines set, create one (so users don't get confused)
if(getDefiniteDueDate() == null && getPreferredDueDate() == null) if(getDefiniteDueDate() == null && getPreferredDueDate() == null)
setPreferredDueDate(repeatInfo.shiftDate(new Date())); setPreferredDueDate(repeatInfo.shiftDate(new Date()));

@ -15,6 +15,7 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.res.Resources; import android.content.res.Resources;
import android.graphics.Color; import android.graphics.Color;
import android.media.AudioManager;
import android.net.Uri; import android.net.Uri;
import android.util.Log; import android.util.Log;
@ -404,6 +405,13 @@ public class Notifications extends BroadcastReceiver {
if(nonstopMode && (flags & FLAG_PERIODIC) == 0) { if(nonstopMode && (flags & FLAG_PERIODIC) == 0) {
notification.flags |= Notification.FLAG_INSISTENT; notification.flags |= Notification.FLAG_INSISTENT;
// if you're gonna do this... might as well crank up the volume!
AudioManager audioManager = (AudioManager)context.getSystemService(
Context.AUDIO_SERVICE);
notification.audioStreamType = AudioManager.STREAM_ALARM;
audioManager.setStreamVolume(AudioManager.STREAM_ALARM,
audioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM), 0);
} }
if(quietHours) { if(quietHours) {

Loading…
Cancel
Save