add function 'mark all as read' to archive (#2443)

* add function 'mark all as read' to archive

as we have the unread counter there now,
we should have an easy way to reset it.

* more clear strings-key
This commit is contained in:
bjoern
2023-01-06 11:37:33 +01:00
committed by GitHub
parent 8fb4140689
commit 17039651be
3 changed files with 34 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:title="@string/mark_all_as_read"
android:id="@+id/mark_as_read"
app:showAsAction="never"/>
</menu>
+3
View File
@@ -48,6 +48,9 @@
<string name="start_chat">Start Chat</string>
<string name="show_full_message">Show Full Message…</string>
<string name="show_full_message_in_browser">Show Full Message in Browser…</string>
<string name="mark_all_as_read">Mark All as Read</string>
<!-- Shortest text for "Mark as being read". In english, this could be "Read" (past tense of "to read"), in german, this could be "Gelesen". -->
<string name="mark_as_read_short">Read</string>
<!-- Placeholder text when something is loading -->
<string name="loading">Loading…</string>
<string name="hide">Hide</string>
@@ -2,8 +2,13 @@ package org.thoughtcrime.securesms;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import com.b44t.messenger.DcChat;
import org.thoughtcrime.securesms.connect.DcHelper;
import org.thoughtcrime.securesms.util.DynamicLanguage;
import org.thoughtcrime.securesms.util.DynamicTheme;
@@ -57,12 +62,28 @@ public class ConversationListArchiveActivity extends PassphraseRequiredActionBar
dynamicLanguage.onResume(this);
}
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
MenuInflater inflater = this.getMenuInflater();
menu.clear();
inflater.inflate(R.menu.archived_list, menu);
super.onPrepareOptionsMenu(menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
super.onOptionsItemSelected(item);
switch (item.getItemId()) {
case android.R.id.home: super.onBackPressed(); return true;
case android.R.id.home:
super.onBackPressed();
return true;
case R.id.mark_as_read:
DcHelper.getContext(this).marknoticedChat(DcChat.DC_CHAT_ID_ARCHIVED_LINK);
return true;
}
return false;