introduce color 'unknown_sender' and use it for forwarded messages, forwarded quotes, quotes with unknown sender

This commit is contained in:
B. Petersen 2020-11-25 19:56:56 +01:00
parent d4ef19b9cf
commit 12e4d6b30e
No known key found for this signature in database
GPG key ID: 3B88E92DEA8E9AFC
4 changed files with 28 additions and 15 deletions

View file

@ -141,15 +141,23 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
private void setQuoteAuthor(@Nullable Recipient author) {
if (author == null) {
authorView.setVisibility(GONE);
return;
}
DcContact contact = author.getDcContact();
if (contact != null) {
quoteBarView.setBackgroundColor(getForwardedColor());
} else if (quotedMsg.isForwarded()) {
authorView.setVisibility(VISIBLE);
authorView.setText(contact.getDisplayName());
quoteBarView.setBackgroundColor(contact.getArgbColor());
authorView.setTextColor(contact.getArgbColor());
authorView.setText(getContext().getString(R.string.forwarded_message));
authorView.setTextColor(getForwardedColor());
quoteBarView.setBackgroundColor(getForwardedColor());
} else {
DcContact contact = author.getDcContact();
if (contact == null) {
authorView.setVisibility(GONE);
quoteBarView.setBackgroundColor(getForwardedColor());
} else {
authorView.setVisibility(VISIBLE);
authorView.setText(contact.getDisplayName());
authorView.setTextColor(contact.getArgbColor());
quoteBarView.setBackgroundColor(contact.getArgbColor());
}
}
}
@ -217,4 +225,8 @@ public class QuoteView extends FrameLayout implements RecipientForeverObserver {
public DcMsg getOriginalMsg() {
return quotedMsg;
}
private int getForwardedColor() {
return getResources().getColor(R.color.unknown_sender);
}
}