From 09aae952e89f7d522a7bb0d192e2ba4a49aea79d Mon Sep 17 00:00:00 2001 From: BrianBlade Date: Sat, 4 Apr 2015 16:06:50 +0200 Subject: Add blacklistedConversation for undo swipe Update title_undo_swipe_* strings --- src/main/java/eu/siacs/conversations/ui/ConversationActivity.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java/eu') diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java index d2a5c855..5f963da1 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationActivity.java @@ -76,6 +76,7 @@ public class ConversationActivity extends XmppActivity private View mContentView; private List conversationList = new ArrayList<>(); + private Conversation blacklistedConversation = null; private Conversation mSelectedConversation = null; private EnhancedListView listView; private ConversationFragment mConversationFragment; @@ -186,6 +187,7 @@ public class ConversationActivity extends XmppActivity final Conversation item = listAdapter.getItem(position); listAdapter.remove(item); listAdapter.notifyDataSetChanged(); + blacklistedConversation = item; if (position == 0 && listAdapter.getCount() == 0) { endConversation(item, false, true); @@ -202,11 +204,13 @@ public class ConversationActivity extends XmppActivity public void undo() { listAdapter.insert(item, position); listAdapter.notifyDataSetChanged(); + blacklistedConversation = null; } @Override public void discard() { endConversation(item, false, false); + blacklistedConversation = null; } @Override @@ -214,7 +218,7 @@ public class ConversationActivity extends XmppActivity if (item.getMode() == Conversation.MODE_MULTI) { return getResources().getString(R.string.title_undo_swipe_out_muc); } else { - return getResources().getString(R.string.title_undo_swipe_out_conversation, item.getName()); + return getResources().getString(R.string.title_undo_swipe_out_conversation); } } }; @@ -1120,6 +1124,7 @@ public class ConversationActivity extends XmppActivity @Override protected void refreshUiReal() { updateConversationList(); + conversationList.remove(blacklistedConversation); if (xmppConnectionService != null && xmppConnectionService.getAccounts().size() == 0) { if (!mRedirected) { this.mRedirected = true; -- cgit v1.2.3