From 9367a8f8e85c65293124899c97fcf992f86cf125 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 2 Sep 2011 18:12:10 -0700 Subject: [PATCH] Tag name changes get reflected in the gui immediately --- .../todoroo/astrid/actfm/TagViewActivity.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java index ad8ef3d54..92b84d1f4 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/TagViewActivity.java @@ -243,10 +243,10 @@ public class TagViewActivity extends TaskListActivity implements OnTabChangeList @SuppressWarnings("nls") private void showPopovers() { - if(tabHost.getCurrentTabTag().equals("tasks")) - showListTabPopover(); - else if(tabHost.getCurrentTabTag().equals("settings")) + if(tabHost.getCurrentTabTag().equals("settings")) showCollaboratorsPopover(); + else + showListTabPopover(); } /** @@ -636,10 +636,12 @@ public class TagViewActivity extends TaskListActivity implements OnTabChangeList String oldName = tagData.getValue(TagData.NAME); String newName = tagName.getText().toString(); - if(!oldName.equals(newName)) { + boolean nameChanged = !oldName.equals(newName); + if (nameChanged) { tagData.setValue(TagData.NAME, newName); TagService.getInstance().rename(oldName, newName); tagData.setFlag(TagData.FLAGS, TagData.FLAG_EMERGENT, false); + } if(newName.length() > 0 && oldName.length() == 0) { @@ -665,6 +667,12 @@ public class TagViewActivity extends TaskListActivity implements OnTabChangeList tagDataService.save(tagData); + if (nameChanged) { + filter = TagFilterExposer.filterFromTagData(this, tagData); + taskAdapter = null; + loadTaskListContent(true); + } + refreshSettingsPage(); }