mirror of https://github.com/M66B/FairEmail.git
Added highlight unread color to folder items
This commit is contained in:
parent
0a3c6832cf
commit
a2961b3dd7
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue