diff --git a/astrid/AndroidManifest.xml b/astrid/AndroidManifest.xml index ca60f16f5..ba96aedda 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/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); diff --git a/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java b/astrid/src/com/todoroo/astrid/adapter/TaskAdapter.java index 5d7e4b973..2542eac1c 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; @@ -278,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); @@ -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 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)