1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 02:37:16 +00:00

Color code all messages

This commit is contained in:
M66B 2018-11-11 07:17:52 +00:00
parent 5f4d6bd9ab
commit d9b59d4896
2 changed files with 5 additions and 6 deletions

View file

@ -318,7 +318,6 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
ivAvatar.setVisibility(photo ? View.VISIBLE : View.GONE);
vwColor.setBackgroundColor(message.accountColor == null ? Color.TRANSPARENT : message.accountColor);
vwColor.setVisibility(viewType == ViewType.UNIFIED && message.accountColor != null ? View.VISIBLE : View.GONE);
ivExpander.setImageResource(show_expanded ? R.drawable.baseline_expand_less_24 : R.drawable.baseline_expand_more_24);
ivExpander.setVisibility(viewType == ViewType.THREAD ? View.VISIBLE : View.GONE);

View file

@ -36,7 +36,7 @@ public interface DaoMessage {
// https://www.sqlite.org/lang_select.html
@Query("SELECT message.*" +
", account.name AS accountName, IFNULL(identity.color,account.color) AS accountColor" +
", account.name AS accountName, IFNULL(identity.color, account.color) AS accountColor" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", COUNT(message.id) AS count" +
", SUM(CASE WHEN message.ui_seen" +
@ -66,7 +66,7 @@ public interface DaoMessage {
DataSource.Factory<Integer, TupleMessageEx> pagedUnifiedInbox(String sort, boolean debug);
@Query("SELECT message.*" +
", account.name AS accountName, IFNULL(identity.color,account.color) AS accountColor" +
", account.name AS accountName, identity.color AS accountColor" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", COUNT(message.id) AS count" +
", SUM(CASE WHEN message.ui_seen" +
@ -97,7 +97,7 @@ public interface DaoMessage {
DataSource.Factory<Integer, TupleMessageEx> pagedFolder(long folder, String sort, boolean found, boolean debug);
@Query("SELECT message.*" +
", account.name AS accountName, IFNULL(identity.color,account.color) AS accountColor" +
", account.name AS accountName, identity.color AS accountColor" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", (SELECT COUNT(m1.id) FROM message m1 WHERE m1.account = message.account AND m1.thread = message.thread AND NOT m1.ui_hide) AS count" +
", CASE WHEN message.ui_seen THEN 0 ELSE 1 END AS unseen" +
@ -168,7 +168,7 @@ public interface DaoMessage {
List<Long> getMessageWithoutPreview();
@Query("SELECT message.*" +
", account.name AS accountName, IFNULL(identity.color,account.color) AS accountColor" +
", account.name AS accountName, identity.color AS accountColor" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", (SELECT COUNT(m1.id) FROM message m1 WHERE m1.account = message.account AND m1.thread = message.thread AND NOT m1.ui_hide) AS count" +
", CASE WHEN message.ui_seen THEN 0 ELSE 1 END AS unseen" +
@ -182,7 +182,7 @@ public interface DaoMessage {
LiveData<TupleMessageEx> liveMessage(long id);
@Query("SELECT message.*" +
", account.name AS accountName, IFNULL(identity.color,account.color) AS accountColor" +
", account.name AS accountName, IFNULL(identity.color, account.color) AS accountColor" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType" +
", 1 AS count" +
", 1 AS unseen" +