Show identity color in send dialog

pull/198/head
M66B 4 years ago
parent 36ef00fc32
commit 80f884aa93

@ -5764,6 +5764,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
same = false; same = false;
log("identityEmail changed", next.id); log("identityEmail changed", next.id);
} }
if (!Objects.equals(prev.identityColor, next.identityColor)) {
same = false;
log("identityColor changed", next.id);
}
if (!Objects.equals(prev.identitySynchronize, next.identitySynchronize)) { if (!Objects.equals(prev.identitySynchronize, next.identitySynchronize)) {
same = false; same = false;
log("identitySynchronize changed", next.id); log("identitySynchronize changed", next.id);

@ -49,7 +49,7 @@ public interface DaoMessage {
", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" + ", 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" + ", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" + ", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" + ", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.color AS identityColor, identity.synchronize AS identitySynchronize" +
", '[' || group_concat(message.`from`, ',') || ']' AS senders" + ", '[' || group_concat(message.`from`, ',') || ']' AS senders" +
", '[' || group_concat(message.`to`, ',') || ']' AS recipients" + ", '[' || group_concat(message.`to`, ',') || ']' AS recipients" +
", COUNT(message.id) AS count" + ", COUNT(message.id) AS count" +
@ -127,7 +127,7 @@ public interface DaoMessage {
", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" + ", 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" + ", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" + ", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" + ", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.color AS identityColor, identity.synchronize AS identitySynchronize" +
", '[' || group_concat(message.`from`, ',') || ']' AS senders" + ", '[' || group_concat(message.`from`, ',') || ']' AS senders" +
", '[' || group_concat(message.`to`, ',') || ']' AS recipients" + ", '[' || group_concat(message.`to`, ',') || ']' AS recipients" +
", COUNT(message.id) AS count" + ", COUNT(message.id) AS count" +
@ -196,7 +196,7 @@ public interface DaoMessage {
", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" + ", 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" + ", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" + ", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" + ", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.color AS identityColor, identity.synchronize AS identitySynchronize" +
", message.`from` AS senders" + ", message.`from` AS senders" +
", message.`to` AS recipients" + ", message.`to` AS recipients" +
", 1 AS count" + ", 1 AS count" +
@ -433,7 +433,7 @@ public interface DaoMessage {
", account.pop AS accountProtocol, account.name AS accountName, identity.color AS accountColor" + ", account.pop AS accountProtocol, account.name AS accountName, identity.color AS accountColor" +
", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" + ", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" + ", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" + ", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.color AS identityColor, identity.synchronize AS identitySynchronize" +
", message.`from` AS senders" + ", message.`from` AS senders" +
", message.`to` AS recipients" + ", message.`to` AS recipients" +
", 1 AS count" + ", 1 AS count" +
@ -465,7 +465,7 @@ public interface DaoMessage {
", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" + ", 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" + ", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +
", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" + ", folder.name AS folderName, folder.color AS folderColor, folder.display AS folderDisplay, folder.type AS folderType, folder.unified AS folderUnified, folder.read_only AS folderReadOnly" +
", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.synchronize AS identitySynchronize" + ", IFNULL(identity.display, identity.name) AS identityName, identity.email AS identityEmail, identity.color AS identityColor, identity.synchronize AS identitySynchronize" +
", message.`from` AS senders" + ", message.`from` AS senders" +
", message.`to` AS recipients" + ", message.`to` AS recipients" +
", 1 AS count" + ", 1 AS count" +

@ -37,6 +37,7 @@ import android.database.Cursor;
import android.database.MatrixCursor; import android.database.MatrixCursor;
import android.graphics.Bitmap; import android.graphics.Bitmap;
import android.graphics.BitmapFactory; import android.graphics.BitmapFactory;
import android.graphics.Color;
import android.graphics.Matrix; import android.graphics.Matrix;
import android.graphics.Typeface; import android.graphics.Typeface;
import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable;
@ -5872,6 +5873,7 @@ public class FragmentCompose extends FragmentBase {
final SwitchCompat swSendReminders = dview.findViewById(R.id.swSendReminders); final SwitchCompat swSendReminders = dview.findViewById(R.id.swSendReminders);
final TextView tvSendRemindersHint = dview.findViewById(R.id.tvSendRemindersHint); final TextView tvSendRemindersHint = dview.findViewById(R.id.tvSendRemindersHint);
final TextView tvTo = dview.findViewById(R.id.tvTo); final TextView tvTo = dview.findViewById(R.id.tvTo);
final TextView tvViaTitle = dview.findViewById(R.id.tvViaTitle);
final TextView tvVia = dview.findViewById(R.id.tvVia); final TextView tvVia = dview.findViewById(R.id.tvVia);
final CheckBox cbPlainOnly = dview.findViewById(R.id.cbPlainOnly); final CheckBox cbPlainOnly = dview.findViewById(R.id.cbPlainOnly);
final TextView tvPlainHint = dview.findViewById(R.id.tvPlainHint); final TextView tvPlainHint = dview.findViewById(R.id.tvPlainHint);
@ -6165,6 +6167,8 @@ public class FragmentCompose extends FragmentBase {
MessageHelper.formatAddresses(tos, name_email, false), extra)); MessageHelper.formatAddresses(tos, name_email, false), extra));
tvTo.setTextColor(Helper.resolveColor(context, tvTo.setTextColor(Helper.resolveColor(context,
to + extra > RECIPIENTS_WARNING ? R.attr.colorWarning : android.R.attr.textColorPrimary)); to + extra > RECIPIENTS_WARNING ? R.attr.colorWarning : android.R.attr.textColorPrimary));
if (draft.identityColor != null && draft.identityColor != Color.TRANSPARENT)
tvViaTitle.setTextColor(draft.identityColor);
tvVia.setText(draft.identityEmail); tvVia.setText(draft.identityEmail);
cbPlainOnly.setChecked(draft.plain_only != null && draft.plain_only && !dsn); cbPlainOnly.setChecked(draft.plain_only != null && draft.plain_only && !dsn);

@ -47,6 +47,7 @@ public class TupleMessageEx extends EntityMessage {
public boolean folderReadOnly; public boolean folderReadOnly;
public String identityName; public String identityName;
public String identityEmail; public String identityEmail;
public Integer identityColor;
public Boolean identitySynchronize; public Boolean identitySynchronize;
public Address[] senders; public Address[] senders;
public Address[] recipients; public Address[] recipients;
@ -117,6 +118,7 @@ public class TupleMessageEx extends EntityMessage {
this.folderReadOnly == other.folderReadOnly && this.folderReadOnly == other.folderReadOnly &&
Objects.equals(this.identityName, other.identityName) && Objects.equals(this.identityName, other.identityName) &&
Objects.equals(this.identityEmail, other.identityEmail) && Objects.equals(this.identityEmail, other.identityEmail) &&
Objects.equals(this.identityColor, other.identityColor) &&
Objects.equals(this.identitySynchronize, other.identitySynchronize) && Objects.equals(this.identitySynchronize, other.identitySynchronize) &&
MessageHelper.equal(this.senders, other.senders) && MessageHelper.equal(this.senders, other.senders) &&
MessageHelper.equal(this.recipients, other.recipients) && MessageHelper.equal(this.recipients, other.recipients) &&

Loading…
Cancel
Save