From 376b2289e2f6f1e26b63108790ceb784ba4de471 Mon Sep 17 00:00:00 2001 From: Manuel Dejonghe Date: Thu, 24 Apr 2014 10:33:51 +0200 Subject: [PATCH] Mark as unread: Add the possibility to mark a thread as unread, as requested per Issue #685 --- res/menu/conversation.xml | 4 ++++ res/values/strings.xml | 1 + src/org/thoughtcrime/securesms/ConversationActivity.java | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/res/menu/conversation.xml b/res/menu/conversation.xml index 90df2dfd30b..30ed5acfc69 100644 --- a/res/menu/conversation.xml +++ b/res/menu/conversation.xml @@ -13,4 +13,8 @@ android:id="@+id/menu_delete_thread" android:icon="@android:drawable/ic_menu_delete" /> + + diff --git a/res/values/strings.xml b/res/values/strings.xml index c9e91fa0ad9..190388ed4e7 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -815,6 +815,7 @@ Leave Group Add contact info Delete thread + Mark thread as unread Recipients list diff --git a/src/org/thoughtcrime/securesms/ConversationActivity.java b/src/org/thoughtcrime/securesms/ConversationActivity.java index a154fc3c38e..b4b9e24559a 100644 --- a/src/org/thoughtcrime/securesms/ConversationActivity.java +++ b/src/org/thoughtcrime/securesms/ConversationActivity.java @@ -294,6 +294,7 @@ public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.menu_call: handleDial(getRecipients().getPrimaryRecipient()); return true; case R.id.menu_delete_thread: handleDeleteThread(); return true; + case R.id.menu_unread_thread: handleUnreadThread(); return true; case R.id.menu_add_contact_info: handleAddContactInfo(); return true; case R.id.menu_add_attachment: handleAddAttachment(); return true; case R.id.menu_start_secure_session: handleStartSecureSession(); return true; @@ -538,6 +539,10 @@ public void onClick(DialogInterface dialog, int which) { builder.show(); } + private void handleUnreadThread() { + DatabaseFactory.getThreadDatabase(ConversationActivity.this).setUnread(threadId); + } + private void handleAddContactInfo() { Intent intent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); startActivityForResult(intent, PICK_CONTACT_INFO);