From 9ca9a864168b5da918e023315f50ab9203ed6313 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 2 Jan 2020 21:02:31 +0100 Subject: [PATCH] Always set card background color --- .../java/eu/faircode/email/ViewCardOptional.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ViewCardOptional.java b/app/src/main/java/eu/faircode/email/ViewCardOptional.java index 3f4661fcd2..83bf7d435e 100644 --- a/app/src/main/java/eu/faircode/email/ViewCardOptional.java +++ b/app/src/main/java/eu/faircode/email/ViewCardOptional.java @@ -37,7 +37,6 @@ public class ViewCardOptional extends CardView { private boolean threading; private int margin; private int ident; - private Integer color = null; public ViewCardOptional(@NonNull Context context) { super(context); @@ -83,16 +82,12 @@ public class ViewCardOptional extends CardView { @Override public void setCardBackgroundColor(int color) { - if (this.color == null || this.color != color) { - this.color = color; + SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); + boolean cards = prefs.getBoolean("cards", true); + if (cards && color == Color.TRANSPARENT) + color = Helper.resolveColor(getContext(), R.attr.colorCardBackground); - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext()); - boolean cards = prefs.getBoolean("cards", true); - if (cards && color == Color.TRANSPARENT) - color = Helper.resolveColor(getContext(), R.attr.colorCardBackground); - - super.setCardBackgroundColor(color); - } + super.setCardBackgroundColor(color); } public void setOutgoing(boolean outgoing) {