Browse Source

Added menu to mark read/unread, star/unstar

main
M66B 6 years ago
parent
commit
886cad559c
38 changed files with 126 additions and 27 deletions
  1. +52
    -27
      app/src/main/java/eu/faircode/email/AdapterMessage.java
  2. +2
    -0
      app/src/main/res/values-af/strings.xml
  3. +2
    -0
      app/src/main/res/values-ar-rBH/strings.xml
  4. +2
    -0
      app/src/main/res/values-ar-rEG/strings.xml
  5. +2
    -0
      app/src/main/res/values-ar-rSA/strings.xml
  6. +2
    -0
      app/src/main/res/values-ar-rYE/strings.xml
  7. +2
    -0
      app/src/main/res/values-ar/strings.xml
  8. +2
    -0
      app/src/main/res/values-ca/strings.xml
  9. +2
    -0
      app/src/main/res/values-cs/strings.xml
  10. +2
    -0
      app/src/main/res/values-da/strings.xml
  11. +2
    -0
      app/src/main/res/values-de/strings.xml
  12. +2
    -0
      app/src/main/res/values-el/strings.xml
  13. +2
    -0
      app/src/main/res/values-en/strings.xml
  14. +2
    -0
      app/src/main/res/values-es-rES/strings.xml
  15. +2
    -0
      app/src/main/res/values-fi/strings.xml
  16. +2
    -0
      app/src/main/res/values-fr/strings.xml
  17. +2
    -0
      app/src/main/res/values-he/strings.xml
  18. +2
    -0
      app/src/main/res/values-hu/strings.xml
  19. +2
    -0
      app/src/main/res/values-it/strings.xml
  20. +2
    -0
      app/src/main/res/values-iw/strings.xml
  21. +2
    -0
      app/src/main/res/values-ja/strings.xml
  22. +2
    -0
      app/src/main/res/values-ko/strings.xml
  23. +2
    -0
      app/src/main/res/values-nb/strings.xml
  24. +2
    -0
      app/src/main/res/values-nl/strings.xml
  25. +2
    -0
      app/src/main/res/values-no/strings.xml
  26. +2
    -0
      app/src/main/res/values-pl/strings.xml
  27. +2
    -0
      app/src/main/res/values-pt-rBR/strings.xml
  28. +2
    -0
      app/src/main/res/values-pt-rPT/strings.xml
  29. +2
    -0
      app/src/main/res/values-ro/strings.xml
  30. +2
    -0
      app/src/main/res/values-ru/strings.xml
  31. +2
    -0
      app/src/main/res/values-sr/strings.xml
  32. +2
    -0
      app/src/main/res/values-sv-rSE/strings.xml
  33. +2
    -0
      app/src/main/res/values-tr/strings.xml
  34. +2
    -0
      app/src/main/res/values-uk/strings.xml
  35. +2
    -0
      app/src/main/res/values-vi/strings.xml
  36. +2
    -0
      app/src/main/res/values-zh-rCN/strings.xml
  37. +2
    -0
      app/src/main/res/values-zh-rTW/strings.xml
  38. +2
    -0
      app/src/main/res/values/strings.xml

+ 52
- 27
app/src/main/java/eu/faircode/email/AdapterMessage.java View File

@ -26,6 +26,8 @@ import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.format.DateUtils;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
@ -39,6 +41,7 @@ import java.util.Date;
import java.util.List;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.PopupMenu;
import androidx.lifecycle.LifecycleOwner;
import androidx.lifecycle.Observer;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
@ -70,6 +73,9 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
TextView tvError;
ProgressBar pbLoading;
private static final int action_seen = 1;
private static final int action_flag = 2;
ViewHolder(View itemView) {
super(itemView);
@ -207,40 +213,59 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
if (pos == RecyclerView.NO_POSITION)
return false;
TupleMessageEx message = getItem(pos);
Bundle args = new Bundle();
args.putLong("id", message.id);
final TupleMessageEx message = getItem(pos);
new SimpleTask<Void>() {
PopupMenu popupMenu = new PopupMenu(context, itemView);
popupMenu.getMenu().add(Menu.NONE, action_flag, 1, message.ui_flagged ? R.string.title_unflag : R.string.title_flag);
popupMenu.getMenu().add(Menu.NONE, action_seen, 2, message.ui_seen ? R.string.title_unseen : R.string.title_seen);
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
protected Void onLoad(Context context, Bundle args) {
long id = args.getLong("id");
DB db = DB.getInstance(context);
try {
db.beginTransaction();
EntityMessage message = db.message().getMessage(id);
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread)) {
db.message().setMessageUiSeen(tmessage.id, !message.ui_seen);
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, !tmessage.ui_seen);
public boolean onMenuItemClick(MenuItem target) {
Bundle args = new Bundle();
args.putLong("id", message.id);
args.putInt("action", target.getItemId());
new SimpleTask<Void>() {
@Override
protected Void onLoad(Context context, Bundle args) {
long id = args.getLong("id");
int action = args.getInt("action");
DB db = DB.getInstance(context);
try {
db.beginTransaction();
EntityMessage message = db.message().getMessage(id);
for (EntityMessage tmessage : db.message().getMessageByThread(message.account, message.thread))
if (action == action_flag) {
db.message().setMessageUiFlagged(tmessage.id, !message.ui_flagged);
EntityOperation.queue(db, tmessage, EntityOperation.FLAG, !tmessage.ui_flagged);
} else if (action == action_seen) {
db.message().setMessageUiSeen(tmessage.id, !message.ui_seen);
EntityOperation.queue(db, tmessage, EntityOperation.SEEN, !tmessage.ui_seen);
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
EntityOperation.process(context);
return null;
}
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
EntityOperation.process(context);
@Override
public void onException(Bundle args, Throwable ex) {
Toast.makeText(context, ex.toString(), Toast.LENGTH_LONG).show();
}
}.load(context, owner, args);
return null;
return true;
}
});
@Override
public void onException(Bundle args, Throwable ex) {
Toast.makeText(context, ex.toString(), Toast.LENGTH_LONG).show();
}
}.load(context, owner, args);
popupMenu.show();
return true;
}


+ 2
- 0
app/src/main/res/values-af/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-ar-rBH/strings.xml View File

@ -142,6 +142,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-ar-rEG/strings.xml View File

@ -142,6 +142,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-ar-rSA/strings.xml View File

@ -142,6 +142,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-ar-rYE/strings.xml View File

@ -142,6 +142,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-ar/strings.xml View File

@ -142,6 +142,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-ca/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-cs/strings.xml View File

@ -134,6 +134,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-da/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Markér som læst</string>
<string name="title_unseen">Markér som ulæst</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Videresend</string>
<string name="title_reply_all">Svar alle</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-de/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Unterhaltung anzeigen</string>
<string name="title_seen">Als gelesen markieren</string>
<string name="title_unseen">Als ungelesen markieren</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Weiterleiten</string>
<string name="title_reply_all">Antworten an alle</string>
<string name="title_show_headers">Kopfzeile anzeigen</string>


+ 2
- 0
app/src/main/res/values-el/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-en/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-es-rES/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-fi/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-fr/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Afficher le fil de discussion</string>
<string name="title_seen">Marquer comme lu</string>
<string name="title_unseen">Marquer comme non lu</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Transférer</string>
<string name="title_reply_all">Répondre à tous</string>
<string name="title_show_headers">Afficher les en-têtes</string>


+ 2
- 0
app/src/main/res/values-he/strings.xml View File

@ -134,6 +134,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-hu/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-it/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Segna come letto</string>
<string name="title_unseen">Segna come non letto</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Inoltra</string>
<string name="title_reply_all">Rispondi a tutti</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-iw/strings.xml View File

@ -134,6 +134,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-ja/strings.xml View File

@ -122,6 +122,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-ko/strings.xml View File

@ -122,6 +122,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-nb/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-nl/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-no/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-pl/strings.xml View File

@ -134,6 +134,8 @@
<string name="title_thread">Pokaż konwersację</string>
<string name="title_seen">Oznacz jako przeczytane</string>
<string name="title_unseen">Oznacz jako nieprzeczytane</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Prześlij dalej</string>
<string name="title_reply_all">Odpowiedz wszystkim</string>
<string name="title_show_headers">Pokaż nagłówki</string>


+ 2
- 0
app/src/main/res/values-pt-rBR/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Encaminhar</string>
<string name="title_reply_all">Responder a todos</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-pt-rPT/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-ro/strings.xml View File

@ -130,6 +130,8 @@
<string name="title_thread">Arată conversație</string>
<string name="title_seen">Marchează ca Citit</string>
<string name="title_unseen">Marcare ca necitit</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Redirecționează</string>
<string name="title_reply_all">Răspunde tuturor</string>
<string name="title_show_headers">Arată antetul</string>


+ 2
- 0
app/src/main/res/values-ru/strings.xml View File

@ -134,6 +134,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-sr/strings.xml View File

@ -130,6 +130,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-sv-rSE/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-tr/strings.xml View File

@ -126,6 +126,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Okundu olarak işaretle</string>
<string name="title_unseen">Okunmadı olarak işaretle</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">İlet</string>
<string name="title_reply_all">Tümünü yanıtla</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-uk/strings.xml View File

@ -134,6 +134,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-vi/strings.xml View File

@ -122,6 +122,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-zh-rCN/strings.xml View File

@ -122,6 +122,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">标记为已读</string>
<string name="title_unseen">标记为未读</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">转发</string>
<string name="title_reply_all">回复全部</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values-zh-rTW/strings.xml View File

@ -122,6 +122,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


+ 2
- 0
app/src/main/res/values/strings.xml View File

@ -147,6 +147,8 @@
<string name="title_thread">Show conversation</string>
<string name="title_seen">Mark read</string>
<string name="title_unseen">Mark unread</string>
<string name="title_flag">Add star</string>
<string name="title_unflag">Remove star</string>
<string name="title_forward">Forward</string>
<string name="title_reply_all">Reply to all</string>
<string name="title_show_headers">Show headers</string>


Loading…
Cancel
Save