Use folder folor as semi-transparent background of duplicate messages

This commit is contained in:
M66B 2020-02-20 13:40:30 +01:00
parent c05517aaca
commit a1ea7330e4
3 changed files with 9 additions and 5 deletions

View File

@ -4724,6 +4724,9 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
if (filter_duplicates && message.duplicate) {
holder.card.setCardBackgroundColor(message.folderColor == null
? Color.TRANSPARENT
: ColorUtils.setAlphaComponent(message.folderColor, 128));
holder.tvFolder.setText(context.getString(R.string.title_duplicate_in, message.getFolderName(context)));
holder.tvFolder.setTypeface(message.unseen > 0 ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
holder.tvFolder.setTextColor(message.unseen > 0 ? colorUnread : colorRead);

View File

@ -46,7 +46,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" +
", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", '[' || group_concat(message.`from`, ',') || ']' AS senders" +
", COUNT(message.id) AS count" +
@ -105,7 +105,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" +
", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", '[' || group_concat(message.`from`, ',') || ']' AS senders" +
", COUNT(message.id) AS count" +
@ -159,7 +159,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" +
", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", message.`from` AS senders" +
", 1 AS count" +
@ -316,7 +316,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.pop AS accountProtocol, account.name AS accountName, identity.color AS accountColor" +
", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", message.`from` AS senders" +
", 1 AS count" +
@ -369,7 +369,7 @@ public interface DaoMessage {
@Query("SELECT message.*" +
", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" +
", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" +
", message.`from` AS senders" +
", 1 AS count" +

View File

@ -39,6 +39,7 @@ public class TupleMessageEx extends EntityMessage {
public boolean accountNotify;
public boolean accountAutoSeen;
public String folderName;
public Integer folderColor;
public String folderDisplay;
public String folderType;
public boolean folderReadOnly;