Always set card background color

This commit is contained in:
M66B 2020-01-02 21:02:31 +01:00
parent d1bdb7f4ed
commit 9ca9a86416
1 changed files with 5 additions and 10 deletions

View File

@ -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) {