mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-03 09:49:21 +02:00
introduce color 'unknown_sender' and use it for forwarded messages, forwarded quotes, quotes with unknown sender
This commit is contained in:
parent
d4ef19b9cf
commit
12e4d6b30e
4 changed files with 28 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue