Highlight unread messages

This commit is contained in:
M66B
2018-08-06 15:07:46 +00:00
parent 601d63482d
commit 33c0ec0efe
5 changed files with 18 additions and 7 deletions

View File

@@ -245,14 +245,19 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
} else
holder.tvCount.setText(Helper.localizeFolderName(context, message.folderName));
holder.ivAttachments.setVisibility(message.attachments > 0 ? View.VISIBLE : View.GONE);
boolean unseen = (message.thread == null ? message.unseen > 0 : !message.seen);
int visibility = (unseen ? Typeface.BOLD : Typeface.NORMAL);
holder.tvFrom.setTypeface(null, visibility);
holder.tvTime.setTypeface(null, visibility);
holder.ivAttachments.setVisibility(message.attachments > 0 ? View.VISIBLE : View.GONE);
holder.tvSubject.setTypeface(null, visibility);
holder.tvCount.setTypeface(null, visibility);
holder.tvFrom.setTextColor(Helper.resolveColor(context, unseen ? R.attr.colorUnread : android.R.attr.textColorSecondary));
holder.tvTime.setTextColor(Helper.resolveColor(context, unseen ? R.attr.colorUnread : android.R.attr.textColorSecondary));
holder.wire();
}
}