Use warning color for POP3 accounts

This commit is contained in:
M66B
2021-05-12 22:08:56 +02:00
parent 7acfc93fd3
commit 784e9f5846

View File

@@ -74,6 +74,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
private LifecycleOwner owner;
private LayoutInflater inflater;
private int colorWarning;
private int colorUnread;
private int textColorSecondary;
private boolean debug;
@@ -165,9 +166,11 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
ivPrimary.setVisibility(account.primary ? View.VISIBLE : View.GONE);
ivNotify.setVisibility(account.notify ? View.VISIBLE : View.GONE);
if (settings)
if (settings) {
tvName.setText(account.name);
else {
tvName.setTextColor(account.protocol == EntityAccount.TYPE_IMAP
? textColorSecondary : colorWarning);
} else {
if (account.unseen > 0)
tvName.setText(context.getString(R.string.title_name_count, account.name, NF.format(account.unseen)));
else
@@ -499,6 +502,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean highlight_unread = prefs.getBoolean("highlight_unread", true);
this.colorWarning = Helper.resolveColor(context, R.attr.colorWarning);
int colorHighlight = prefs.getInt("highlight_color", Helper.resolveColor(context, R.attr.colorUnreadHighlight));
this.colorUnread = (highlight_unread ? colorHighlight : Helper.resolveColor(context, R.attr.colorUnread));
this.textColorSecondary = Helper.resolveColor(context, android.R.attr.textColorSecondary);