From 4a4eda3067a5558ea68be79b61c5e64c4ac93fe8 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Wed, 4 Aug 2010 19:28:09 -0700 Subject: [PATCH 1/3] Fix for AST-137 --- .../todoroo/astrid/reminders/NotificationActivity.java | 9 ++++++++- .../com/todoroo/astrid/reminders/Notifications.java | 4 +++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationActivity.java b/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationActivity.java index c1aedb5b5..6d38021dd 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/NotificationActivity.java @@ -38,6 +38,7 @@ import com.todoroo.andlib.utility.DateUtilities; import com.todoroo.astrid.activity.TaskListActivity; import com.todoroo.astrid.api.Filter; import com.todoroo.astrid.dao.TaskDao.TaskCriteria; +import com.todoroo.astrid.utility.Preferences; /** * This activity is launched when a user opens up a notification from the @@ -95,7 +96,13 @@ public class NotificationActivity extends TaskListActivity implements OnTimeSetL getLayoutInflater().inflate(R.layout.notification_control, parent, true); String reminder = Notifications.getRandomReminder(getResources().getStringArray(R.array.reminder_responses)); - ((TextView)findViewById(R.id.reminderLabel)).setText(reminder); + + if(Preferences.getBoolean(R.string.p_rmd_nagging, true)) + ((TextView)findViewById(R.id.reminderLabel)).setText(reminder); + else { + findViewById(R.id.reminderLabel).setVisibility(View.GONE); + findViewById(R.id.astridIcon).setVisibility(View.GONE); + } // set up listeners ((Button)findViewById(R.id.goAway)).setOnClickListener(new OnClickListener() { diff --git a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java index 859ad8a0d..ce9adf6d3 100644 --- a/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java +++ b/astrid/plugin-src/com/todoroo/astrid/reminders/Notifications.java @@ -76,8 +76,10 @@ public class Notifications extends BroadcastReceiver { reminder = getRandomReminder(r.getStringArray(R.array.reminders_due)); else if(type == ReminderService.TYPE_SNOOZE) reminder = getRandomReminder(r.getStringArray(R.array.reminders_snooze)); - else + else if(Preferences.getBoolean(R.string.p_rmd_nagging, true)) reminder = getRandomReminder(r.getStringArray(R.array.reminders)); + else + reminder = ""; //$NON-NLS-1$ if(!showTaskNotification(id, type, reminder)) { notificationManager.cancel((int)id); From dd3bb2d720c52efd38e62272fec64f01c57cd04c Mon Sep 17 00:00:00 2001 From: Tim Su Date: Wed, 4 Aug 2010 19:32:07 -0700 Subject: [PATCH 2/3] Added linkify to task details --- astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java index 5d7e4b973..936a9c579 100644 --- a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java @@ -13,6 +13,7 @@ import android.content.res.Resources; import android.database.Cursor; import android.graphics.Paint; import android.text.Html; +import android.text.util.Linkify; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.LayoutInflater; @@ -434,6 +435,7 @@ public class TaskAdapter extends CursorAdapter implements Filterable { view.setText(Html.fromHtml(string.trim().replace("\n", "
"))); else view.setText(string.trim()); + Linkify.addLinks(view, Linkify.ALL); } @Override From af119a599daef3b5e60db050b5b9d56243140305 Mon Sep 17 00:00:00 2001 From: Tim Su Date: Wed, 4 Aug 2010 19:50:29 -0700 Subject: [PATCH 3/3] Version bump, updated upgrade message, and added weekday --- astrid/AndroidManifest.xml | 2 +- .../todoroo/andlib/utility/DateUtilities.java | 17 +++++++++++++++-- .../com/todoroo/astrid/adapter/TaskAdapter.java | 6 +++--- .../todoroo/astrid/service/UpgradeService.java | 11 +++++++---- 4 files changed, 26 insertions(+), 10 deletions(-) diff --git a/astrid/AndroidManifest.xml b/astrid/AndroidManifest.xml index 885ffd3ce..f28f5466d 100644 --- a/astrid/AndroidManifest.xml +++ b/astrid/AndroidManifest.xml @@ -1,7 +1,7 @@ diff --git a/astrid/common-src/com/todoroo/andlib/utility/DateUtilities.java b/astrid/common-src/com/todoroo/andlib/utility/DateUtilities.java index b4eba3a56..2e1e4162a 100644 --- a/astrid/common-src/com/todoroo/andlib/utility/DateUtilities.java +++ b/astrid/common-src/com/todoroo/andlib/utility/DateUtilities.java @@ -163,9 +163,22 @@ public class DateUtilities { @SuppressWarnings("nls") public static SimpleDateFormat getDateFormatWithWeekday(Context context) { try { - return new SimpleDateFormat("EEE, " + getDateFormatString(context)); + return new SimpleDateFormat("EEEE, " + getDateFormatString(context)); } catch (Exception e) { - return new SimpleDateFormat("EEE, d MMM yyyy"); + return new SimpleDateFormat("EEEE, d MMM yyyy"); + } + } + + /** + * @return date format as getDateFormat with weekday + */ + @SuppressWarnings("nls") + public static SimpleDateFormat getDateWithTimeAndWeekday(Context context) { + try { + return new SimpleDateFormat("EEEE, " + getDateFormatString(context) + + " " + getTimeFormatString(context)); + } catch (Exception e) { + return new SimpleDateFormat("EEEE, d MMM yyyy H:mm"); } } diff --git a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java index 936a9c579..2542eac1c 100644 --- a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java +++ b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java @@ -279,14 +279,14 @@ public class TaskAdapter extends CursorAdapter implements Filterable { String dateValue; Date dueDateAsDate = DateUtilities.unixtimeToDate(dueDate); if (task.hasDueTime()) { - dateValue = DateUtilities.getDateWithTimeFormat(activity).format(dueDateAsDate); + dateValue = DateUtilities.getDateWithTimeAndWeekday(activity).format(dueDateAsDate); } else { - dateValue = DateUtilities.getDateFormat(activity).format(dueDateAsDate); + dateValue = DateUtilities.getDateFormatWithWeekday(activity).format(dueDateAsDate); } dueDateView.setText(dateValue); setVisibility(dueDateView); } else if(task.isCompleted()) { - String dateValue = DateUtilities.getDateFormat(activity).format(task.getValue(Task.COMPLETION_DATE)); + String dateValue = DateUtilities.getDateFormatWithWeekday(activity).format(task.getValue(Task.COMPLETION_DATE)); dueDateView.setText(r.getString(R.string.TAd_completed, dateValue)); dueDateView.setTextAppearance(activity, R.style.TextAppearance_TAd_ItemDetails); setVisibility(dueDateView); diff --git a/astrid/src/com/todoroo/astrid/service/UpgradeService.java b/astrid/src/com/todoroo/astrid/service/UpgradeService.java index 7254864d2..3884be158 100644 --- a/astrid/src/com/todoroo/astrid/service/UpgradeService.java +++ b/astrid/src/com/todoroo/astrid/service/UpgradeService.java @@ -56,14 +56,17 @@ public final class UpgradeService { "If you liked the old version, you can also go back by " + "clicking here", }); - else if(from <= 144) + if(from > 135 && from <= 144) newVersionString(changeLog, "3.0.6 (8/4/10)", new String[] { "This update contains for free all of the " + "powerpack's features for evaluation purposes", "Fixed widget not updating when tasks are edited", - "Added a setting for displaying task notes", - "If you liked the old version, you can also go back by " + - "clicking here", + "Added a setting for displaying task notes in the list", + }); + if(from > 135 && from <= 145) + newVersionString(changeLog, "3.0.7 (8/5/10)", new String[] { + "Linkify phone numbers, e-mails, and web pages", + "Made the 'Astrid Notifications' setting in the menu work", }); if(changeLog.length() == 0)