mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Experiment: show number of unseen messages in lists
This commit is contained in:
parent
c1c3dab41c
commit
4bb5e13877
3 changed files with 23 additions and 1 deletions
|
@ -1043,7 +1043,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
tvCount.setVisibility(threading ? View.VISIBLE : View.GONE);
|
||||
ivThread.setVisibility(View.VISIBLE);
|
||||
|
||||
tvCount.setText(NF.format(message.visible));
|
||||
if (BuildConfig.DEBUG)
|
||||
tvCount.setText(NF.format(message.visible_unseen) + "/" + NF.format(message.visible));
|
||||
else
|
||||
tvCount.setText(NF.format(message.visible));
|
||||
|
||||
if (selected)
|
||||
ivThread.setColorFilter(colorAccent);
|
||||
|
@ -5116,6 +5119,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
same = false;
|
||||
log("visible changed " + prev.visible + "/" + next.visible, next.id);
|
||||
}
|
||||
if (prev.visible_unseen != next.visible_unseen) {
|
||||
same = false;
|
||||
log("visible_unseen changed " + prev.visible_unseen + "/" + next.visible_unseen, next.id);
|
||||
}
|
||||
if (!Objects.equals(prev.totalSize, next.totalSize)) {
|
||||
same = false;
|
||||
log("totalSize changed", next.id);
|
||||
|
|
|
@ -60,6 +60,11 @@ public interface DaoMessage {
|
|||
" CASE WHEN NOT message.hash IS NULL THEN message.hash" +
|
||||
" WHEN NOT message.msgid IS NULL THEN message.msgid" +
|
||||
" ELSE message.id END) AS visible" +
|
||||
", COUNT(DISTINCT" +
|
||||
" CASE WHEN message.ui_seen THEN NULL" +
|
||||
" WHEN NOT message.hash IS NULL THEN message.hash" +
|
||||
" WHEN NOT message.msgid IS NULL THEN message.msgid" +
|
||||
" ELSE message.id END) AS visible_unseen" +
|
||||
", SUM(message.total) AS totalSize" +
|
||||
", message.priority AS ui_priority" +
|
||||
", message.importance AS ui_importance" +
|
||||
|
@ -132,6 +137,11 @@ public interface DaoMessage {
|
|||
" CASE WHEN NOT message.hash IS NULL THEN message.hash" +
|
||||
" WHEN NOT message.msgid IS NULL THEN message.msgid" +
|
||||
" ELSE message.id END) AS visible" +
|
||||
", COUNT(DISTINCT" +
|
||||
" CASE WHEN message.ui_seen THEN NULL" +
|
||||
" WHEN NOT message.hash IS NULL THEN message.hash" +
|
||||
" WHEN NOT message.msgid IS NULL THEN message.msgid" +
|
||||
" ELSE message.id END) AS visible_unseen" +
|
||||
", SUM(message.total) AS totalSize" +
|
||||
", message.priority AS ui_priority" +
|
||||
", message.importance AS ui_importance" +
|
||||
|
@ -193,6 +203,7 @@ public interface DaoMessage {
|
|||
", (message.ui_encrypt IN (2, 4)) AS signed" +
|
||||
", (message.ui_encrypt IN (1, 3)) AS encrypted" +
|
||||
", 1 AS visible" +
|
||||
", NOT message.ui_seen AS visible_unseen" +
|
||||
", message.total AS totalSize" +
|
||||
", message.priority AS ui_priority" +
|
||||
", message.importance AS ui_importance" +
|
||||
|
@ -382,6 +393,7 @@ public interface DaoMessage {
|
|||
", (message.ui_encrypt IN (2, 4)) AS signed" +
|
||||
", (message.ui_encrypt IN (1, 3)) AS encrypted" +
|
||||
", 1 AS visible" +
|
||||
", NOT message.ui_seen AS visible_unseen" +
|
||||
", message.total AS totalSize" +
|
||||
", message.priority AS ui_priority" +
|
||||
", message.importance AS ui_importance" +
|
||||
|
@ -413,6 +425,7 @@ public interface DaoMessage {
|
|||
", (message.ui_encrypt IN (2, 4)) AS signed" +
|
||||
", (message.ui_encrypt IN (1, 3)) AS encrypted" +
|
||||
", 1 AS visible" +
|
||||
", NOT message.ui_seen AS visible_unseen" +
|
||||
", message.total AS totalSize" +
|
||||
", message.priority AS ui_priority" +
|
||||
", message.importance AS ui_importance" +
|
||||
|
|
|
@ -55,6 +55,7 @@ public class TupleMessageEx extends EntityMessage {
|
|||
public int signed;
|
||||
public int encrypted;
|
||||
public int visible;
|
||||
public int visible_unseen;
|
||||
public Long totalSize;
|
||||
public Integer ui_priority;
|
||||
public Integer ui_importance;
|
||||
|
@ -113,6 +114,7 @@ public class TupleMessageEx extends EntityMessage {
|
|||
this.signed == other.signed &&
|
||||
this.encrypted == other.encrypted &&
|
||||
this.visible == other.visible &&
|
||||
this.visible_unseen == other.visible_unseen &&
|
||||
Objects.equals(this.totalSize, other.totalSize) &&
|
||||
Objects.equals(this.ui_priority, other.ui_priority) &&
|
||||
Objects.equals(this.ui_importance, other.ui_importance) &&
|
||||
|
|
Loading…
Reference in a new issue