summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2017-12-21 16:28:55 -0800
committerEric Erfanian <erfanian@google.com>2017-12-22 08:57:54 -0800
commit6aa961b5fa429ad64a9c0bf02d3a1673950ef743 (patch)
tree7c595cded5f0ff9622849bab219c19e6d63318d1 /java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
parent126c0e599ea98b639549d91ff99bc4e780d769b5 (diff)
Differentiate read/unread voicemails in the NUI Voicemail by bolding.
Voicemails that are unread in the annotated call log table will show up as bold. Voicemails that are marked as read will show up as normal (non bold). A follow up CL will update the underlying table and mark them as read when a viewholder is expanded. Bug: 64882313,70900195 Test: Unit Tests PiperOrigin-RevId: 179872932 Change-Id: I927711aa8c6c6324e43f519c14a58b5f2b8e7ca9
Diffstat (limited to 'java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java')
-rw-r--r--java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
index 24bed0f04..dac4ebafc 100644
--- a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
+++ b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
@@ -21,6 +21,7 @@ import static android.view.View.VISIBLE;
import android.app.FragmentManager;
import android.content.Context;
import android.database.Cursor;
+import android.graphics.Typeface;
import android.net.Uri;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
@@ -124,6 +125,9 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On
transcriptionTextView.setText(voicemailTranscription);
}
+ // Bold if voicemail is unread
+ boldViewHolderIfUnread();
+
itemView.setOnClickListener(this);
menuButton.setOnClickListener(
NewVoicemailMenu.createOnClickListener(context, voicemailEntryOfViewHolder));
@@ -173,6 +177,20 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On
mediaPlayerView.getVisibility() == VISIBLE);
}
+ private void boldViewHolderIfUnread() {
+ LogUtil.v(
+ "NewVoicemailViewHolder.boldViewHolderIfUnread",
+ "id:%d, isRead:%d",
+ voicemailEntryOfViewHolder.id(),
+ voicemailEntryOfViewHolder.isRead());
+
+ if (voicemailEntryOfViewHolder.isRead() == 0) {
+ primaryTextView.setTypeface(null, Typeface.BOLD);
+ secondaryTextView.setTypeface(null, Typeface.BOLD);
+ transcriptionTextView.setTypeface(null, Typeface.BOLD);
+ }
+ }
+
// TODO(uabdullah): Consider/Implement TYPE (e.g Spam, TYPE_VOICEMAIL)
private void setPhoto(VoicemailEntry voicemailEntry) {
ContactPhotoManager.getInstance(context)
@@ -214,6 +232,10 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On
isViewHolderExpanded = false;
viewHolderVoicemailUri = null;
+ primaryTextView.setTypeface(null, Typeface.NORMAL);
+ secondaryTextView.setTypeface(null, Typeface.NORMAL);
+ transcriptionTextView.setTypeface(null, Typeface.NORMAL);
+
mediaPlayerView.reset();
LogUtil.i(