From 78b5bb31c20b9ca750e9c251f85527c2929d7aa8 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Thu, 22 Dec 2011 11:04:28 -0700 Subject: [PATCH] Fixed a bug where the save toast wouldn't show correctly for shared tasks --- .../com/todoroo/astrid/actfm/EditPeopleControlSet.java | 9 ++++++--- astrid/res/layout/filter_list_activity.xml | 2 +- astrid/res/values/strings-core.xml | 5 ++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java index 7b65d37e8..646d7a64f 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/EditPeopleControlSet.java @@ -661,17 +661,20 @@ public class EditPeopleControlSet extends PopupControlSet { task.setValue(Task.DETAILS_DATE, 0L); readTagData(result.getJSONArray("tags")); - JSONObject assignee = result.getJSONObject("assignee"); + JSONObject assignee = result.getJSONObject("user"); JsonHelper.readUser(assignee, task, Task.USER_ID, Task.USER); Flags.set(Flags.ACTFM_SUPPRESS_SYNC); taskService.save(task); String assignedName = assignee.optString("name"); + if (TextUtils.isEmpty(assignedName)) { + assignedName = assignee.optString("email"); + } long id = assignee.optLong("id", -2); - if (!(id == -2 || id == ActFmPreferenceService.userId() || assignedName == null)) { + if (!(id == -2 || id == ActFmPreferenceService.userId() || TextUtils.isEmpty(assignedName))) { saveToast += "\n" + - activity.getString(R.string.actfm_EPA_assigned_toast, assignedName); + activity.getString(R.string.actfm_EPA_assigned_toast, assignedName, assignedName); } int count = result.optInt("shared", 0); diff --git a/astrid/res/layout/filter_list_activity.xml b/astrid/res/layout/filter_list_activity.xml index d5afd764a..b12228225 100644 --- a/astrid/res/layout/filter_list_activity.xml +++ b/astrid/res/layout/filter_list_activity.xml @@ -60,7 +60,7 @@ android:layout_height="fill_parent" android:background="@drawable/footer_editbutton" android:gravity="center" - android:text="@string/FLA_new_filter" + android:text="@string/FLA_new_list" android:textStyle="bold" style="@style/TextAppearance.TEA_action"/> diff --git a/astrid/res/values/strings-core.xml b/astrid/res/values/strings-core.xml index 00756185f..d5eb68215 100644 --- a/astrid/res/values/strings-core.xml +++ b/astrid/res/values/strings-core.xml @@ -246,7 +246,10 @@ Created Shortcut: %s - New List + New Filter + + + New List