Added highlight unread color to folder items

This commit is contained in:
M66B 2019-09-08 17:27:50 +02:00
parent 0a3c6832cf
commit a2961b3dd7
1 changed files with 9 additions and 1 deletions

View File

@ -82,6 +82,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
private float textSize;
private int textColorPrimary;
private int textColorSecondary;
private int colorUnread;
private List<Long> disabledIds = new ArrayList<>();
private List<TupleFolderEx> all = new ArrayList<>();
@ -236,7 +237,7 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
tvName.setText(folder.getDisplayName(context, folder.parent_ref == null ? null : folder.parent_ref));
tvName.setTypeface(folder.unseen > 0 ? Typeface.DEFAULT_BOLD : Typeface.DEFAULT);
tvName.setTextColor(folder.unseen > 0 ? textColorPrimary : textColorSecondary);
tvName.setTextColor(folder.unseen > 0 ? colorUnread : textColorSecondary);
if (listener == null && folder.selectable) {
StringBuilder sb = new StringBuilder();
@ -682,6 +683,13 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
this.textColorPrimary = Helper.resolveColor(context, android.R.attr.textColorPrimary);
this.textColorSecondary = Helper.resolveColor(context, android.R.attr.textColorSecondary);
boolean highlight_unread = prefs.getBoolean("highlight_unread", false);
if (highlight_unread)
this.colorUnread = Helper.resolveColor(context, R.attr.colorUnread);
else
this.colorUnread = this.textColorPrimary;
setHasStableIds(true);
owner.getLifecycle().addObserver(new LifecycleObserver() {