aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrianBlade <n.gelbertz@gmail.com>2015-04-04 16:06:50 +0200
committerBrianBlade <n.gelbertz@gmail.com>2015-04-04 16:06:50 +0200
commit09aae952e89f7d522a7bb0d192e2ba4a49aea79d (patch)
treefa26482e96eca3855e5e96690d9549f83036107a
parent34a404ca31ef83973223cd93cdc75b6ae8c497de (diff)
Add blacklistedConversation for undo swipe
Update title_undo_swipe_* strings
-rw-r--r--src/main/java/eu/siacs/conversations/ui/ConversationActivity.java7
-rw-r--r--src/main/res/values-de/strings.xml4
-rw-r--r--src/main/res/values/strings.xml4
3 files changed, 10 insertions, 5 deletions
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<Conversation> 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;
diff --git a/src/main/res/values-de/strings.xml b/src/main/res/values-de/strings.xml
index 59a152bf..3f6f471b 100644
--- a/src/main/res/values-de/strings.xml
+++ b/src/main/res/values-de/strings.xml
@@ -427,8 +427,8 @@
<string name="no_application_found_to_display_location">Keine App für die Standort-Anzeige gefunden</string>
<string name="location">Standort</string>
<string name="received_location">Standort empfangen</string>
- <string name="title_undo_swipe_out_conversation">Unterhaltung mit %s beendet</string>
- <string name="title_undo_swipe_out_muc">Konferenz beendet. Du wirst keine weiteren Nachrichten aus diesem Chat empfangen.</string>
+ <string name="title_undo_swipe_out_conversation">Unterhaltung beendet</string>
+ <string name="title_undo_swipe_out_muc">Konferenz verlassen</string>
<plurals name="select_contact">
<item quantity="one">%d Kontakt ausgewählt</item>
<item quantity="other">%d Kontakte ausgewählt</item>
diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml
index e36cac26..ddea9055 100644
--- a/src/main/res/values/strings.xml
+++ b/src/main/res/values/strings.xml
@@ -455,8 +455,8 @@
<string name="no_application_found_to_display_location">No application found to display location</string>
<string name="location">Location</string>
<string name="received_location">Received location</string>
- <string name="title_undo_swipe_out_conversation">Conversation with %s closed</string>
- <string name="title_undo_swipe_out_muc">Conference closed. You won\'t receive new messages from this chat.</string>
+ <string name="title_undo_swipe_out_conversation">Conversation closed</string>
+ <string name="title_undo_swipe_out_muc">Conference left</string>
<plurals name="select_contact">
<item quantity="one">Select %d contact</item>
<item quantity="other">Select %d contacts</item>