Use warning color for POP3 accounts

pull/198/head
M66B 4 years ago
parent 7acfc93fd3
commit 784e9f5846

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

Loading…
Cancel
Save