diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 7274425a91..ac6e908daa 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -1369,15 +1369,22 @@ public class AdapterMessage extends RecyclerView.Adapter 0; int color = (message.color == null || !pro ? colorAccent : message.color); - ibFlagged.setImageResource(flagged > 0 ? R.drawable.twotone_star_24 : R.drawable.twotone_star_border_24); - ibFlagged.setImageTintList(ColorStateList.valueOf(flagged > 0 ? color : textColorSecondary)); + if (!Objects.equals(ibFlagged.getTag(), flagged)) { + ibFlagged.setTag(flagged); + ibFlagged.setImageResource(flagged ? R.drawable.twotone_star_24 : R.drawable.twotone_star_border_24); + } + + ColorStateList csl = ibFlagged.getImageTintList(); + if (csl == null || csl.getColorForState(new int[0], 0) != color) + ibFlagged.setImageTintList(ColorStateList.valueOf(flagged ? color : textColorSecondary)); + ibFlagged.setEnabled(message.uid != null || message.accountProtocol != EntityAccount.TYPE_IMAP); card.setCardBackgroundColor( - flags_background && flagged > 0 && !expanded + flags_background && flagged && !expanded ? ColorUtils.setAlphaComponent(color, 127) : Color.TRANSPARENT); if (flags)