1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 17:27:00 +00:00
This commit is contained in:
M66B 2020-09-30 08:56:16 +02:00
parent 8d42316660
commit 2f7ac1b2f8

View file

@ -966,7 +966,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
tvCount.setTypeface(typeface); tvCount.setTypeface(typeface);
int colorUnseen = (message.unseen > 0 ? colorUnread : colorRead); int colorUnseen = (message.unseen > 0 ? colorUnread : colorRead);
if (tvFrom.getTag() == null || (int) tvFrom.getTag() != colorUnseen) { if (!Objects.equals(tvFrom.getTag(), colorUnseen)) {
tvFrom.setTag(colorUnseen); tvFrom.setTag(colorUnseen);
tvFrom.setTextColor(colorUnseen); tvFrom.setTextColor(colorUnseen);
tvSize.setTextColor(colorUnseen); tvSize.setTextColor(colorUnseen);
@ -977,14 +977,14 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
int colorBackground = int colorBackground =
(message.accountColor == null || !ActivityBilling.isPro(context) (message.accountColor == null || !ActivityBilling.isPro(context)
? colorSeparator : message.accountColor); ? colorSeparator : message.accountColor);
if (vwColor.getTag() == null || (int) vwColor.getTag() != colorBackground) { if (!Objects.equals(vwColor.getTag() == null, colorBackground)) {
vwColor.setTag(colorBackground); vwColor.setTag(colorBackground);
vwColor.setBackgroundColor(colorBackground); vwColor.setBackgroundColor(colorBackground);
} }
vwColor.setVisibility(color_stripe ? View.VISIBLE : View.GONE); vwColor.setVisibility(color_stripe ? View.VISIBLE : View.GONE);
// Expander // Expander
if (ibExpander.getTag() == null || (boolean) ibExpander.getTag() != expanded) { if (!Objects.equals(ibExpander.getTag(), expanded)) {
ibExpander.setTag(expanded); ibExpander.setTag(expanded);
ibExpander.setImageLevel(expanded ? 0 /* less */ : 1 /* more */); ibExpander.setImageLevel(expanded ? 0 /* less */ : 1 /* more */);
} }
@ -1051,16 +1051,20 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
(viewType == ViewType.THREAD && (outgoing || EntityFolder.SENT.equals(message.folderType))) || (viewType == ViewType.THREAD && (outgoing || EntityFolder.SENT.equals(message.folderType))) ||
viewType == ViewType.SEARCH viewType == ViewType.SEARCH
? View.VISIBLE : View.GONE); ? View.VISIBLE : View.GONE);
if (ivType.getTag() == null || (int) ivType.getTag() != icon) { if (!Objects.equals(ivType.getTag(), icon)) {
ivType.setTag(icon); ivType.setTag(icon);
ivType.setImageResource(icon); ivType.setImageResource(icon);
} }
ivFound.setVisibility(message.ui_found && found ? View.VISIBLE : View.GONE); ivFound.setVisibility(message.ui_found && found ? View.VISIBLE : View.GONE);
ibSnoozed.setImageResource( int snoozy = (message.ui_snoozed != null && message.ui_snoozed == Long.MAX_VALUE
message.ui_snoozed != null && message.ui_snoozed == Long.MAX_VALUE ? R.drawable.twotone_visibility_off_24
? R.drawable.twotone_visibility_off_24 : R.drawable.twotone_timelapse_24); : R.drawable.twotone_timelapse_24);
if (!Objects.equals(ibSnoozed.getTag(), snoozy)) {
ibSnoozed.setTag(snoozy);
ibSnoozed.setImageResource(snoozy);
}
if (message.ui_unsnoozed) if (message.ui_unsnoozed)
ibSnoozed.setColorFilter(colorAccent); ibSnoozed.setColorFilter(colorAccent);
else else
@ -1114,7 +1118,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
// Message text preview // Message text preview
int textColor = (contrast ? textColorPrimary : textColorSecondary); int textColor = (contrast ? textColorPrimary : textColorSecondary);
if (tvPreview.getTag() == null || (int) tvPreview.getTag() != textColor) { if (!Objects.equals(tvPreview.getTag(), textColor)) {
tvPreview.setTag(textColor); tvPreview.setTag(textColor);
tvPreview.setTextColor(textColor); tvPreview.setTextColor(textColor);
if (preview_lines == 1) if (preview_lines == 1)