Unified folder colors

pull/206/head
M66B 3 years ago
parent 0760db212a
commit 5aa128b156

@ -7,6 +7,7 @@
### Next version ### Next version
* Added theme option for default light original message view * Added theme option for default light original message view
* Unified color based on account folder colors
### 1.1731 ### 1.1731

@ -7,6 +7,7 @@
### Next version ### Next version
* Added theme option for default light original message view * Added theme option for default light original message view
* Unified color based on account folder colors
### 1.1731 ### 1.1731

@ -98,6 +98,11 @@ public class AdapterNavUnified extends RecyclerView.Adapter<AdapterNavUnified.Vi
} else } else
ivItem.setImageResource(EntityFolder.getIcon(folder.type)); ivItem.setImageResource(EntityFolder.getIcon(folder.type));
if (folder.color != null && folder.colorCount == 1)
ivItem.setColorFilter(folder.color);
else
ivItem.clearColorFilter();
long count; long count;
if (EntityFolder.DRAFTS.equals(folder.type) || if (EntityFolder.DRAFTS.equals(folder.type) ||
EntityFolder.OUTBOX.equals(folder.type)) EntityFolder.OUTBOX.equals(folder.type))

@ -176,6 +176,7 @@ public interface DaoFolder {
", COUNT(message.id) AS messages" + ", COUNT(message.id) AS messages" +
", SUM(CASE WHEN NOT message.ui_seen THEN 1 ELSE 0 END) AS unseen" + ", SUM(CASE WHEN NOT message.ui_seen THEN 1 ELSE 0 END) AS unseen" +
", CASE WHEN folder.account IS NULL THEN folder.sync_state ELSE NULL END AS sync_state" + ", CASE WHEN folder.account IS NULL THEN folder.sync_state ELSE NULL END AS sync_state" +
", folder.color, COUNT (DISTINCT folder.color) AS colorCount" +
" FROM folder" + " FROM folder" +
" LEFT JOIN account ON account.id = folder.account" + " LEFT JOIN account ON account.id = folder.account" +
" LEFT JOIN message ON message.folder = folder.id AND NOT message.ui_hide" + " LEFT JOIN message ON message.folder = folder.id AND NOT message.ui_hide" +

@ -26,6 +26,8 @@ public class TupleFolderUnified {
public int messages; public int messages;
public int unseen; public int unseen;
public String sync_state; public String sync_state;
public Integer color;
public int colorCount;
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
@ -34,7 +36,9 @@ public class TupleFolderUnified {
return (Objects.equals(this.type, other.type) && return (Objects.equals(this.type, other.type) &&
this.messages == other.messages && this.messages == other.messages &&
this.unseen == other.unseen && this.unseen == other.unseen &&
Objects.equals(this.sync_state, other.sync_state)); Objects.equals(this.sync_state, other.sync_state) &&
Objects.equals(this.color, other.color) &&
this.colorCount == other.colorCount);
} else } else
return false; return false;
} }

@ -7,6 +7,7 @@
### Next version ### Next version
* Added theme option for default light original message view * Added theme option for default light original message view
* Unified color based on account folder colors
### 1.1731 ### 1.1731

Loading…
Cancel
Save